thekosmix/kids-scroll-models
01.6k
Kids Scroll Story Model (GGUF)
This repository hosts the on-device story generation model (`story-model.gguf`) and WebAssembly runtime (`wllama.wasm`) used by **Kids Scroll** โ a lightweight, offline-first Progressive Web App (PWA) designed for toddlers and young children.
๐ Model Overview
- Model File:
story-model.gguf(~26 MB) - Runtime File:
wllama.wasm(~7.4 MB) - Architecture: Causal Transformer Decoder based on the TinyStories architecture by Microsoft Research.
- Context Length: 128 tokens.
- Primary Task: Autocomplete and generate simple, toddler-friendly short stories (ages 2โ6) on edge devices in real time without requiring a server backend or internet connection.
๐ง Training Data & Lineage
- Base Architecture: TinyStories ("TinyStories: How Small Can Language Models Be and Still Speak Coherent English?" by Ronen Eldan and Yuanzhi Li, Microsoft Research).
- Dataset: `roneneldan/TinyStories` consisting of ~2.1 million synthetic short stories generated by GPT-3.5 / GPT-4.
- Vocabulary Focus: Tailored strictly to words and sentence structures understood by 3- to 4-year-old children (animals, sharing, adventures, bedtime, friendship).
๐ Usage
1. In Browser with wllama (WebAssembly)
import { Wllama } from '@wllama/wllama';
const wllama = new Wllama({
'wllama.wasm': 'https://huggingface.co/thekosmix/kids-scroll-models/resolve/main/wllama.wasm'
});
// Load the model
const response = await fetch('https://huggingface.co/thekosmix/kids-scroll-models/resolve/main/story-model.gguf');
const blob = await response.blob();
await wllama.loadModel([blob], { n_ctx: 192 });
// Generate a story segment
const output = await wllama.createCompletion({
prompt: 'Once upon a time, there was a little rabbit.',
max_tokens: 100,
temperature: 0.8,
top_p: 0.9,
stop: ['\n\n', 'The end.']
});
console.log(output.choices[0].text);2. Using llama.cpp CLI
llama-cli -m story-model.gguf -p "Once upon a time, there was a friendly lion." -n 100 --temp 0.8๐ก๏ธ Content Safety & Limitations
- Context Window: The native training context is ~128 tokens. For multi-paragraph stories, client applications should generate short story segments and stitch them.
- Knowledge Boundary: The model possesses no encyclopedic or factual world knowledge; it is specialized exclusively for imaginative children's narratives.
- Client-Side Guardrails: In production (Kids Scroll), generated outputs are paired with client-side blocklist filtering (content-filter.js) and sentence trimming to guarantee age-appropriate content for kids.
๐ Citation & Acknowledgements
If you use this model or dataset, please cite the original TinyStories research:
@article{eldan2023tinystories,
title={TinyStories: How Small Can Language Models Be and Still Speak Coherent English?},
author={Eldan, Ronen and Li, Yuanzhi},
journal={arXiv preprint arXiv:2305.07759},
year={2023}
}