TinyGPT

in-browser playground
Feedback

Train a small GPT — the kind of model behind ChatGPT, only ~0.8 million parameters instead of a trillion — from scratch, right here in this tab. No server, no install. Watch the loss curve fall, then ask it to write you a sentence. Source ↗

Train

Corpus
picks load automatically · or paste your own text below
Hyperparameters — preset above sets these. Click to edit individually.
Model
Estimated run time
Advanced
Your machine detecting… computing…

computing…

Want to go further?
4 Resources curated rabbit holes — 3Blue1Brown, Karpathy, papers, and this repo's own docs

Start here (visual + intuitive)

Go deeper (code + papers)

This project's own write-ups

Related projects

5 WebGPU matmul benchmark Same matmul on WebGPU + WASM, side-by-side, with a live speedup number

Runs the same matmul through the WebGPU compute kernel and the WASM kernel, parity-checks they agree, and reports the per-shape speedup on your hardware. Needs Chrome / Edge 113+. For the full end-to-end speedup curve across the preset table, see /speedup.

Not run yet.

Keyboard shortcuts

?Show this sheet EscClose any popover / dialog ⌘ / Ctrl EnterStart training ⌘ / Ctrl GGenerate from the model TTake the tour SShare this setup PPause / resume training 15Pick a size preset (Tiny → XL)

Are you sure?

Welcome to TinyGPT

A complete transformer that trains from scratch — right here, in this tab, with no server. Load the pretrained Shakespeare model to see it work in one click, or train your own from scratch (a few minutes on the small preset, ~15 minutes on the larger ones). Every layer was written by hand. Want a 90-second tour first?