The Open Textbook: How AI Actually Works
Thirty-four chapters, six parts, every code block runs — from what a token is, to the math of attention, to the economics of the build-out. Free, forkable, CC-BY. Consider it your long-weekend read.

It is a holiday weekend in America, which makes it the right moment to point at the quietest thing this desk has published — and the one we may be proudest of.
This desk publishes a lot of numbers. The recycling ratio, the divergence, the Fragility Index — all of them assume something: that the reader knows what the machine under the numbers actually does. Most coverage of AI never explains it. So we wrote the manual.
What it is
First Principles is an open, interactive textbook on how AI actually works — 34 chapters across six parts, from what a token is, to the math of attention, to the economics of the build-out. It is free. It is forkable. It is licensed CC-BY, which means you can copy it, teach from it, translate it, or build on it — with attribution, and nothing else asked.
Every chapter runs the same way: plain-English intuition first, then the actual math, then runnable code, with an interactive you can drive. And every chapter is written at more than one depth — a newcomer and an expert get different books from the same page. There is no gate, no email wall, and a single-file PDF if you prefer to read it off the grid: the whole book, one download.
The tour
I · Foundations (7 chapters) — tokens, embeddings, neural networks, attention, the transformer. II · Models (6) — LLMs, pretraining, alignment, model differences, multimodal, quantization. III · Inference & systems (6) — inference, tokens per second, GPUs, the memory wall, batching, the cluster. IV · Building with AI (6) — prompting, RAG, agents and tools, evals, vector search. V · The frontier & the industry (5) — scaling laws, the labs, the supply chain, the economics of a token. VI · Best practices & tools (4) — choosing a model, cost optimization, safety and guardrails, the tool landscape.
Why a research desk wrote a textbook
Because you cannot judge the economics without the mechanics. When we say the market is pricing a payoff the filings don’t show, the natural question is: what exactly is being paid for? The answer lives in the mechanics — what compute buys, why inference costs what it costs, where the memory wall bites, what scaling laws promise and what they don’t. Part V is the bridge: it walks from the transformer to the token to the dollar, which is the same walk our instruments make in the other direction.
The desk’s standard applies to the book the way it applies to the tape: every figure sourced or labeled, and every code block has to run. A textbook that hand-waves is just a longer opinion.
The holiday pitch
If the build-out matters to your work or your portfolio, the mechanics are worth a weekend. Start at chapter one if you’re new; start at Part V if you already build with this stuff and want the economics. Read at your depth, skip what you know, fork what you’d improve.
Open. Rigorous. Free. That’s the whole announcement.