Skip to content

Projects / 2026

SquirrelGPT

A GPT trained from scratch in pure Python, no ML frameworks.

Overview

A GPT-style transformer built and trained from scratch in under 100 lines of pure Python, using only the standard library: no PyTorch, TensorFlow or NumPy. It includes its own tiny autograd engine, a character-level tokenizer, a causal attention head, an MLP and a compact optimizer.

There are two ways in: a notebook course that expands the model into readable code with explanations and experiments, and the compressed single-file version to read afterwards. Watching the output go from noise to recognizable fragments of the training rhyme makes it a hands-on way to understand how LLMs work under the hood.