Instructions to use build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B") model = PeftModel.from_pretrained(base_model, "build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA") - Notebooks
- Google Colab
- Kaggle
AI Puppet Theater MiniCPM5 Actor LoRA
LoRA/QLoRA adapter for openbmb/MiniCPM5-1B, fine-tuned to act as an Actor agent for AI Puppet Theater.
The adapter is trained to produce one short, theatrical, speakable Actor JSON object for a single puppet-show beat. It is not a general chat model.
Base Model
- Base model:
openbmb/MiniCPM5-1B - Method: LoRA/QLoRA supervised fine-tuning
- Dataset: AI Puppet Theater Actor SFT synthetic dataset
- Current best candidate: v0 adapter
Intended Output Schema
{
"intent": "inspect_prop",
"line": "This rubber duck squeaks exactly like a guilty witness.",
"emotion": "investigative",
"gesture": "leans toward the glowing prop",
"stage_effect": "prop_table_glow",
"memory_update": "Noted that the rubber duck behaved like evidence.",
"tool_request": {
"tool": "inspect_prop",
"args": {"prop": "rubber duck"},
"reason": "The prop may reveal a stage clue."
}
}
tool_request may be null. Current AI Puppet Theater runtime tool schemas:
inspect_prop:{"prop": "..."}consult_stage_oracle:{"question": "..."}change_lighting:{"mood": "..."}
Eval Summary
The v0 adapter is the current best candidate for the hackathon demo. The v1 hardening experiment added useful audit/eval tooling and corrected schema alignment, but did not outperform v0 on full eval at the time this card was written.
Runtime should use JSON extraction, strict validation, sanitized Actor JSON, tool-argument normalization, and deterministic fallback.
Recent v1 smoke eval after schema metric split showed why sanitizer support matters:
- raw clean JSON: 9/10
- extracted JSON parse: 10/10
- has required fields: 9/10
- exact top-level schema: 6/10
- sanitized actor JSON usable: 9/10
Example Prompt Shape
premise: A moon mayor denies stealing the town's last spoon
show_state JSON: {"story_phase":"complication","latest_prop":"silver spoon",...}
actor JSON: {"name":"Mina Moonbutton","goal":"Find the emotional truth...",...}
director_instruction: Use the latest prop as evidence and request inspection if useful.
Expected assistant response:
{"intent":"inspect_prop","line":"This silver spoon squeaks exactly like a guilty witness.","emotion":"investigative","gesture":"leans toward the glowing prop","stage_effect":"prop_table_glow","memory_update":"Noted that the silver spoon behaved like evidence.","tool_request":{"tool":"inspect_prop","args":{"prop":"silver spoon"},"reason":"The prop may reveal one concrete stage clue."}}
Usage Example
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base_model = "openbmb/MiniCPM5-1B"
adapter_id = "build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA"
tokenizer = AutoTokenizer.from_pretrained(adapter_id, trust_remote_code=True)
base = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, adapter_id)
messages = [
{"role": "system", "content": "You are an Actor agent in AI Puppet Theater. Return only one valid JSON object. No markdown. No commentary. Keep the puppet line short, theatrical, and speakable."},
{"role": "user", "content": "premise: ...\nshow_state JSON: {...}\nactor JSON: {...}\ndirector_instruction: ..."},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=192, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Limitations
- Synthetic dataset; not a broad creative-writing model.
- Actor-only behavior; Director planning is handled elsewhere.
- Can emit extra top-level fields or copied state fields; use runtime sanitizer and fallback.
- Tool calls must be validated before execution.
- Demo-safe filters are simple and do not replace product-level safety review.
Related Artifacts
- Space: https://huggingface.co/spaces/build-small-hackathon/AI-Puppet-Theater
- Dataset repo placeholder: https://huggingface.co/datasets/build-small-hackathon/AI-Puppet-Theater-Actor-SFT
- Model repo placeholder: https://huggingface.co/build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA
License
TODO: confirm the final project, base model, and adapter license before publishing.
- Downloads last month
- 46
Model tree for build-small-hackathon/AI-Puppet-Theater-MiniCPM5-Actor-LoRA
Base model
openbmb/MiniCPM5-1B