tinyGPT

A real GPT running in your browser. Port of Karpathy's pure-Python GPT to TypeScript. Train it, generate names, inspect attention heads, watch tokens flow.

params 4,192
heads 4
layers 1
embed 16
vocab 27
ctx 16

Architecture

4,192 params

Click any block to learn more. Train to see data flow.

Training

step 0loss
stop at loss
Click "Step" to begin training

Token Flow

Input
Embed
Attn
MLP
Output

Type a name and click Flow to watch tokens pass through each layer of the GPT. After the pipeline completes, the model generates a continuation.

Temperature Control

conservative0.50 (warm)creative
Low = predictable, common names. High = wild, creative names.

Attention Heads

Train or generate to see attention patterns

Built with Next.js 16 + React 19 + TypeScript + Tailwind v4 + Motion 12 + Recharts

Based on Karpathy's pure-Python GPT — the most atomic way to train a transformer