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

part 1/4

Foundations

— how models think
0/8
  1. 00

    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

    open →
  2. 01

    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

    open →
  3. 02

    Tokenization

    Why does the model think 'strawberry' has two r's? Because it never sees letters.

    playground: build-a-tokenizer code cells

    open →
  4. 03

    Embeddings

    How can math know that 'king' minus 'man' plus 'woman' is 'queen'?

    playground: draggable 2D embedding space

    open →
  5. 04

    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

    open →
  6. 05

    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

    open →
  7. 06

    The transformer block

    GPT, Claude, Gemini, Llama — all of them are this one block, copy-pasted.

    playground: stack blocks, watch shapes flow

    open →
  8. 👾

    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

    open →
part 2/4

Training

— how models learn
0/6
  1. 07

    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

    open →
  2. 08

    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

    open →
  3. 09

    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

    open →
  4. 10

    Pretraining vs finetuning

    Base models are feral. Chat models are trained to behave. Meet both.

    playground: base vs chat side-by-side

    open →
  5. 11

    RLHF

    Why does Claude feel helpful instead of unhinged? Humans voted.

    playground: you-are-the-reward-model game

    open →
  6. 👾

    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

    open →
part 3/4

Using models

— where the jobs are
0/8
  1. 12

    Sampling & temperature

    One slider separates 'boring corporate email' from 'unhinged poetry'. It's yours now.

    playground: probability bars + temperature slider

    open →
  2. 13

    Prompting that actually works

    Same question, four prompts, four wildly different answers. See exactly why.

    playground: prompt comparison lab (gemini free tier)

    open →
  3. 14

    Context windows

    Why does the model 'forget' the start of a long chat? Watch its memory physically run out.

    playground: context overflow visualizer

    open →
  4. 15

    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

    open →
  5. 16

    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

    open →
  6. 17

    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

    open →
  7. 18

    Finetuning in practice (LoRA)

    Full finetuning rewrites billions of weights. LoRA sneaks in tiny adapters instead. 100x cheaper.

    playground: adapter visualizer

    open →
  8. 👾

    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

    open →
part 4/4

Reality check

— limits, evals & what's next
0/6
  1. 19

    Hallucination & limits

    The model doesn't lie. It just always answers — even when it shouldn't. Learn to catch it.

    playground: hallucination hunt

    open →
  2. 20

    Evals

    'It seems good' is not engineering. How do you PROVE your AI works?

    playground: build a mini eval suite

    open →
  3. 21

    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

    open →
  4. 22

    Capstone — ship your own AI

    Everything you've built, combined into one project that's actually yours.

    playground: guided capstone builder

    open →
  5. 23

    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 →
  6. 👾

    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

    open →

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.

start building →