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 ↗

Two ways: browse the gallery for pre-trained models (same architecture, different corpora) and hit Generate, or train your own from scratch using the controls below (~4–15 min).

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. Every layer was written by hand. Three ways to start: