lab notebook · entry 001 · property of: you
Build your own AI.
By hand.
No videos. No slides. You will tokenize text, tune neurons with your own cursor, train a real (tiny) GPT on your own writing, and build a RAG pipeline line by line — all in your browser, all free.
24 chapters · real code · real models · ₹0
Foundations
— how models think- 00open →
Python in 20 minutes
You'll write real AI code in this app. Here's every piece of Python you need — nothing more.
playground: guided python cells
- 01open →
What is a language model?
Every AI you've ever talked to does exactly one thing: guess the next word. That's it. Seriously.
playground: tokenizer playground
- 02open →
Tokenization
Why does the model think 'strawberry' has two r's? Because it never sees letters.
playground: build-a-tokenizer code cells
- 03open →
Embeddings
How can math know that 'king' minus 'man' plus 'woman' is 'queen'?
playground: draggable 2D embedding space
- 04open →
Neural nets 101
You'll hand-tune 9 neurons to classify points. You will lose to gradient descent. That loss is the lesson.
playground: drag-the-weights net
- 05open →
Attention
In 'the trophy didn't fit in the suitcase because it was too big' — how does the model know what 'it' means?
playground: live attention heatmap
- 06open →
The transformer block
GPT, Claude, Gemini, Llama — all of them are this one block, copy-pasted.
playground: stack blocks, watch shapes flow
- 👾open →
Part 1 Boss: Fix the Pipeline
You've built a tokenizer. You've built cosine similarity. Now debug someone else's broken versions — 2 bugs, hidden in code that LOOKS right.
playground: debug the broken tokenizer + similarity pipeline
Training
— how models learn- 07open →
Loss — how wrong was the guess?
Training needs a single number that says 'you were THIS wrong.' You'll write that number.
playground: loss function code cell
- 08open →
Backprop & gradient descent
Drop a ball on a hilly landscape. Control one dial. Too high — it flies forever. Too low — it never arrives.
playground: loss landscape terrain
- 09open →
The training loop ★
Paste YOUR text. Train a real tiny GPT on it, live. Watch gibberish become your writing style in 2 minutes.
playground: live char-GPT training
- 10open →
Pretraining vs finetuning
Base models are feral. Chat models are trained to behave. Meet both.
playground: base vs chat side-by-side
- 11open →
RLHF
Why does Claude feel helpful instead of unhinged? Humans voted.
playground: you-are-the-reward-model game
- 👾open →
Part 2 Boss: Diagnose the Training Run
Two training runs, two planted bugs — a flipped gradient sign and a learning rate way too high. Diagnose each from the loss curve, then fix it for real.
playground: read the curve, fix the code
Using models
— where the jobs are- 12open →
Sampling & temperature
One slider separates 'boring corporate email' from 'unhinged poetry'. It's yours now.
playground: probability bars + temperature slider
- 13open →
Prompting that actually works
Same question, four prompts, four wildly different answers. See exactly why.
playground: prompt comparison lab (gemini free tier)
- 14open →
Context windows
Why does the model 'forget' the start of a long chat? Watch its memory physically run out.
playground: context overflow visualizer
- 15open →
RAG — build it yourself ★
Ask a model about your college's fees. It hallucinates. You're about to fix that, permanently.
playground: full RAG pipeline builder — you write chunking + cosine similarity
- 16open →
Vector databases
You wrote cosine similarity over a loop. Now see what ChromaDB does when there are 10 million chunks.
playground: brute force vs index race
- 17open →
Agents & tool use
Give a model a calculator, a search box and a notepad. Watch it think in loops and get things done.
playground: build the agent loop
- 18open →
Finetuning in practice (LoRA)
Full finetuning rewrites billions of weights. LoRA sneaks in tiny adapters instead. 100x cheaper.
playground: adapter visualizer
- 👾open →
Part 3 Boss: Fix the RAG Pipeline
A RAG pipeline is returning garbage answers. A hardcoded chunk size and a backwards similarity sort are hiding in plain sight — find both, fix both.
playground: debug the broken RAG pipeline
Reality check
— limits, evals & what's next- 19open →
Hallucination & limits
The model doesn't lie. It just always answers — even when it shouldn't. Learn to catch it.
playground: hallucination hunt
- 20open →
Evals
'It seems good' is not engineering. How do you PROVE your AI works?
playground: build a mini eval suite
- 21open →
Scaling — from 10K to 1T params
Your ch9 model and Claude are the same species. One just ate more.
playground: scale slider: params, data, cost
- 22open →
Capstone — ship your own AI
Everything you've built, combined into one project that's actually yours.
playground: guided capstone builder
- 23open →
The PyTorch bridge
Your next 2-3 months, mapped week by week — from this app to training real models on real GPUs.
playground: roadmap with live checkboxes + your-code-vs-pytorch side-by-sides
- 👾open →
Part 4 Boss: Is This AI Ready to Ship?
A fictional 'ready to ship' report, full of confident numbers. 3 of them are real red flags. Find all 3 — everything else genuinely checks out.
playground: audit the ship-readiness report
finished the chapters? now build your own thing
The Build Path 🛠️
a practical, step-by-step checklist for turning what you learned into something real — picked, built, evaluated, deployed, and on your portfolio.