inside the model — sentence → reply
case file 04 — live inference, traced stage by stage

Watch a real language model turn a sentence into a reply.

This runs an actual TinyStories-8M model client-side, in your browser — no server, no API. Type something below and step through what the model actually computes: tokenize, embed, attend, predict.

log
click run to load the model (first time only)
01Tokenize
02Embed
03Attend
04Predict
calibration notes
What's real
TOK EMB ATT PRE

Tokenization uses TinyStories-8M's actual BPE tokenizer. The vectors in "embed" are pulled directly from the model's first attention layer during the same forward pass used for prediction — genuine per-token internal state. "Predict" softmaxes the actual output logits from that same pass.

What's approximated
TOK EMB ATT PRE

The in-browser runtime doesn't expose TinyStories-8M's internal attention matrices, so "attend" shows cosine similarity between the real embeddings as a stand-in — a genuine signal from real vectors, but not literally the model's softmax attention weights.

§ Self-hosted vs. external
self-hosted ~13.6MBexternal ~28.5MB

The JS library and WASM runtime ship with this site. The TinyStories-8M weights (~28.5MB, quantized) load from huggingface.co at runtime — just over Cloudflare Pages' 25MB single-file limit, so it stays external rather than bundled. Cached after first load.