Building an AI model with Ollama — from scratch, then inspected end to end
Byte-Level Bard
A 10.8-million-parameter transformer, trained from random weights on one GPU, converted into a real Ollama model, then traced all the way down — real computation graphs, real GPU kernels, real sampling probabilities, and a plain-language explainer series for all of it. Every page below is real, captured data; nothing is staged.
Plain-language series
No jargon. Best read in order — each page builds on the last, using the same real numbers throughout.
The reasoning experiment
Can the same machine be given a <think> span? We trained it on worked additions instead of Shakespeare, then tested whether the working is real.
Technical deep dives
The same claims, at full resolution — real op graphs, real GPU kernels, real sampling trees.
The Journey One prompt traced end to end through tiny-shakespeare: tokens, all 201 real ggml ops, softmax, sampling. the_journey.html
The Larger Journey The same journey for deepseek-r1:8b, with an honestly-named gap where the data runs out. the_larger_journey.html
Live Computation Graph Every PyTorch module that fired during a real forward pass, via forward hooks. graph_trace.html
tiny-shakespeare Graph All 201 real ggml ops, captured by running llama.cpp's eval-callback natively in WSL. ggml_graph.html
deepseek-r1:8b Graph The same trace for the 8B reasoning model — 1,266 real ops, RoPE, SwiGLU, Q/K-norm. ggml_graph_deepseek.html
GPU Kernel Trace Real CUDA kernels from one inference call, profiled with Nsight Systems, matched back to the ggml ops. gpu_trace.html
Sampling Tree tiny-shakespeare's real token-by-token sampling as an interactive vis-network tree. sampling_tree.html
The Sheep Riddle deepseek-r1's real chain-of-thought on the classic "all but 9 die" riddle. sampling_tree_sheep_riddle.html
Before the Script The 560 tokens deepseek-r1 spent reasoning before writing any code. sampling_tree_before_script.html
Writing the Script Just the 261 tokens where it actually wrote the batch file. sampling_tree_batchfile_script.html
Every page here is a self-contained static HTML file — open any of them directly, no server required. Some pages load vis-network or Google Fonts from a CDN, so they need an internet connection to render fully.