CoolFace
Modelpublic

thekosmix/kids-scroll-models

sourceHugging Facemitupdated 23d agoView on Hugging Face
0likes1.6kdownloads
Model Card

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)

javascript
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

bash
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:

bibtex
@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}
}