Storyteller — a GPT Trained From Scratch, Writing in Your Browser
Type a prompt and James's own from-scratch GPT — 6.9M parameters trained on a home PC — writes a short story entirely in your browser. Nothing leaves your device.
This is a GPT James trained from scratch — the data pipeline, the tokenizer, the architecture, and the training loop, all built by hand and trained on a home PC with no CUDA GPU and no cloud: 6,917,376 parameters, 66.7 million tokens of TinyStories, about 100 minutes of CPU. The inference engine below is a hand-written TypeScript port of that exact model — it writes stories in your browser, in a web worker.
Nothing you type or generate leaves your device — the only network requests are the one-time 13.8 MB model and 0.6 MB tokenizer download, cached afterwards. And it invents freely: characters drift, names change mid-story, endings aren't guaranteed. That is what a 7M-parameter model is — the limits are part of the demo.
The storyteller
With JavaScript enabled, this card becomes a live story generator: type a prompt and a 6.9M-parameter GPT — trained from scratch on a home PC and hand-ported to run right here in your browser — writes a short story, one token at a time.
How it learned — validation loss
The measured run: 66,674,390 tokens of TinyStories, 4,000 AdamW steps in about 100 minutes on a home PC — validation loss 8.97 → 2.006 (perplexity 7.4).
Watch it learn — same prompt, 16 snapshots
Once upon a timeoopordsugar closely welcome strugg motor gracefullyoop feeding picked picked yawn yawn chocol circle closely sankaying crow places batter batter crow crow sc sc cond cond todd sidewalk chocol sidewalk sidewalk officers recorder recorder prov opening lect soldiers listen past past moral lighter mechanic blood shout past gracefully dod routine strugg strugg dinosaurs todd listenool5aspoonxy four blood
From uniform noise to coherent stories — the recorded samples are exactly what the model wrote at each point during training.