MiniCPM5-1B Kids Storyteller — GGUF 🦁📖

A tiny, fast, on-device storyteller for children aged 2–5. It writes gentle, easy-to-picture stories and poems with simple words, sound effects, and a repeating refrain, and it runs on a laptop CPU with no GPU and no cloud API.

This repo is the 4-bit GGUF build (≈700 MB) for llama.cpp. The full-precision (merged 16-bit) model is at ThePradip/minicpm5-1b-kids-storyteller.

Built for the Build Small Hackathon (June 2026). Fine-tuned cheaply on a single Modal A10G.

This is the model that powers the Jungle Story Time app — both its cloud Story API (served on Modal via llama.cpp) and its fully offline LOCAL_MODE=1.


Why on-device?

A storyteller for a toddler should be:

  • fast — a 3-year-old will not wait 30 seconds;
  • private — it hears your child's name, which should never leave the machine;
  • cheap — it runs on the family laptop, no API bill;
  • stylistically reliable — tiny sentences, sound words, a refrain repeated 3×.

Style is exactly what small-model fine-tuning is good at. At ~60 tokens/sec on an M-series MacBook CPU this 1B model is faster than a child can listen, runs on a free CPU-only Space, and the model that hears your kid's name never touches a server.

Files

File Quant Size Notes
MiniCPM5-1B.Q4_K_M.gguf Q4_K_M ≈700 MB Recommended — best quality/size balance for CPU

Quickstart

Python — llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
    repo_id="ThePradip/minicpm5-1b-kids-storyteller-GGUF",
    filename="MiniCPM5-1B.Q4_K_M.gguf",
    n_ctx=2048,
    n_threads=8,        # match your CPU cores
    n_gpu_layers=0,     # CPU-only; set -1 to offload to Metal/CUDA
    verbose=False,
)

SYSTEM = ("You are a kind storyteller for children aged 2-5. Write tiny, happy, "
          "easy-to-picture stories and poems with very simple words, sounds, "
          "repetition, and nothing scary.")

# the exact prompt shape the model was fine-tuned and served on
prompt = ("Tell a story for Riya, age 3. It stars a yellow duck at the village pond. "
          "It should help the child learn: the quack sound. Say Riya's name in the story. "
          "Keep it very simple for a small child, easy to picture, with sounds and a "
          "repeating line.")

out = llm.create_chat_completion(
    messages=[{"role": "system", "content": SYSTEM},
              {"role": "user", "content": prompt}],
    max_tokens=340, temperature=0.8, top_p=0.95, repeat_penalty=1.08,
)
print(out["choices"][0]["message"]["content"])

Tip: the base MiniCPM5 supports a <think> reasoning block. This model is trained with thinking disabled so stories stream instantly, but if you ever see <think>…</think>, strip it: re.sub(r"<think>.*?(</think>|$)", "", text, flags=re.S).

CLI — llama.cpp

# download just the GGUF
hf download ThePradip/minicpm5-1b-kids-storyteller-GGUF MiniCPM5-1B.Q4_K_M.gguf --local-dir .

# run it
llama-cli -m MiniCPM5-1B.Q4_K_M.gguf \
  -p "Tell a tiny bedtime story for a 3-year-old about a sleepy bunny under the moon. Use sounds and a repeating line." \
  -n 340 --temp 0.8 --top-p 0.95 --repeat-penalty 1.08

Recommended generation settings

Param Value Why
max_tokens 340 a full toddler story/poem, no padding
temperature 0.8 playful but coherent
top_p 0.95
repeat_penalty 1.08 refrains repeat on purpose; keep this gentle
n_ctx 2048 plenty for these short stories

Sample output

Prompt: "Riya, age 3, a yellow duck, the quack sound"

Riya sees a yellow duck at the pond. The duck quacks, quacks, quacks! His legs wiggle like little frogs. The water is warm and cool. See, see! Riya hops over one leg. The duck quacks, quacks, quacks! …

Refrain ✓ · sound words ✓ · tiny sentences ✓ · the child's name ✓


The base model

Base openbmb/MiniCPM5-1B — OpenBMB, May 2026, Apache-2.0
Parameters ~1B
Architecture LlamaForCausalLM (standard Llama layout)
Chat format ChatML (`<

Why this model. A toddler storyteller is a narrow style task, not a reasoning task. Small models are style sponges, so a 1B is the right tool: it fine-tunes in seconds, runs on a CPU, and keeps data on-device. MiniCPM5-1B is a plain LlamaForCausalLM, so the whole Unsloth toolchain works with zero patches — unlike hybrid-Mamba models, which need a heavier TRL+PEFT path. We train with the model's own chat template and enable_thinking=False so stories stream with no visible <think> block.

The dataset

Fine-tuned on kids-stories-personalized — a hand-authored set, not scraped and not bulk-generated by a frontier API. We tried a free vision model as teacher (8–17% usable) and a strong open model as teacher (~67% usable); hand-authoring was the only path to 100% usable, on-style data.

  • ~258 story/poem plots (round 2) across 12 categories: animals, birds, colors, shapes, surroundings, family, friends, environment, morals, speech practice ("Ba, ba, ball!"), early learning (counting, big/small), and rhymes.
  • Authored as markdown blocks with a metadata header (kid · age · characters · place · category · teach) so non-programmers can write them.
  • Published openly: build-small-hackathon/kids-story.

Style contract — machine-enforced by author_kit.py before anything is published:

  • 30–170 words · average sentence ≤ 9 words
  • a refrain repeated 3×
  • at least one sound word (quack, splash, whoosh…)
  • a visualizability score — concrete picture-words a toddler can see; abstract stories rejected
  • nothing scary · clean ending · the child's name appears

How it was fine-tuned

Method LoRA via Unsloth — r=16, α=32, dropout 0.05, bias none
Target modules q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (attention + MLP)
Loss masking train_on_responses_only — loss on the story tokens only, not the prompt
Optimizer lr 2e-4, cosine, 3% warmup · batch 4 × grad-accum 4 · bf16 · 3 epochs
Quantization merged to 16-bit, then exported to Q4_K_M GGUF via push_to_hub_gguf
Compute Modal A10G (single GPU)

Validation gate. The training script refuses to push to the Hub unless the model proves itself: it generates 5 unseen test stories (new child names, story + poem, different lessons) and requires ≥4 to pass (length, the child's name present, safety wordlist), and the final loss to be ≥10% below the start. Fail → the adapter is parked on the Modal volume and nothing is published.

Results

Round Examples Epochs Loss Validation
1 69 5 2.61 → 2.04 (−22%) 2/3 pass
2 258 3 2.64 → 1.54 (−42%) 5/5 pass ✅

Round 1 exposed the classic small-model failure — asked for a story about Veer, it wrote a perfect on-style story starring Sam. Style transfers reliably from a tiny set; name-faithfulness needed more data. Round 2 (258 examples) fixed exactly that.


Intended use & limitations

Intended for generating short, gentle children's stories and poems in English for ages 2–5, with adult supervision.

Limitations:

  • A 1B model occasionally drifts on the child's name or lets the lesson fade — keep an adult in the loop.
  • English only. Style is tuned narrowly for toddlers; it is not a general assistant.
  • Always review generated text before reading it to a child.

Ethics

This is a storyteller model only. The companion voice in the app uses consented/synthetic narration — we do not clone children's voices.


Links

Apache-2.0 · Build Small Hackathon, June 2026 · MiniCPM5-1B · Unsloth · llama.cpp

Downloads last month
737
GGUF
Model size
1B params
Architecture
llama
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ThePradip/minicpm5-1b-kids-storyteller-GGUF

Quantized
(1)
this model

Dataset used to train ThePradip/minicpm5-1b-kids-storyteller-GGUF

Space using ThePradip/minicpm5-1b-kids-storyteller-GGUF 1