Labs
Hands-on labs with runnable code. Some run fully offline with zero installs (great for verifying you understand the mechanics); others need an API key or GPU (production-shaped). Every lab maps to a phase and feeds the Capstone.
Labs
| # | Lab | Runs offline? | Phase |
|---|---|---|---|
| 01 | OpenAI SDK Fundamentals | needs API key | 1, 10 |
| 02 | Local Inference with Ollama | needs Ollama | 6 |
| 03 | RAG Pipeline from Scratch | needs API key | 9 |
| 04 | Agent with Tool Calling | needs API key | 10 |
| 05 | Build an Eval Harness | ✅ scorers.py offline | 12 |
| 06 | Tokenizer & KV-Cache Calculator | ✅ fully offline | 2, 6.02 |
| 07 | vLLM Serving & Benchmark | needs GPU | 7.01 |
| 08 | Build an LLM Gateway | ✅ gateway.py offline | 8 |
| 09 | Hybrid Search from Scratch | ✅ fully offline | 9.05 |
| 10 | Structured Output & Validation | ✅ validate.py offline | 10.02 |
| 11 | Unit-Economics Cost Calculator | ✅ fully offline | 15.05 |
| 12 | Observability & Load Test | ✅ load_test.py offline | 7.08 |
| 13 | LoRA / QLoRA Fine-Tune | needs GPU | 13.02 |
| 14 | Prompt-Injection Red-Team | ✅ redteam.py offline | 14.01 |
Start here (no setup needed)
These run with just Python 3 (zero installs) — do them first to cement the mechanics:
python3 lab-06-tokenizer-and-kv-cache/kv_cache_calc.py --params 70 --bits 4 --ctx 32768 --batch 8 --bandwidth 3350
python3 lab-11-cost-calculator/cost_calc.py
PYTHONHASHSEED=0 python3 lab-09-hybrid-search/hybrid_search.py
python3 lab-05-eval-harness/scorers.py
python3 lab-08-llm-gateway/gateway.py # routing + fallback + metering
python3 lab-14-prompt-injection-redteam/redteam.py # attack leaks vs architecture contains
python3 lab-10-structured-output/validate.py # constrained != correct
python3 lab-12-observability/load_test.py # p50/p95/p99 under load
How labs fit together
- Fundamentals: 06 (memory/speed math), 09 (retrieval), 05 (eval), 11 (cost).
- Applied: 01 (SDK), 03 (RAG), 04 (agents), 10 (structured output), 14 (security).
- Production: 02/07 (serving), 08 (gateway), 12 (observability), 13 (fine-tuning).
- Integrate them all in the Capstone.
The offline labs are deliberately dependency-free so you can run them anywhere and verify your mental model. The numbers they print are the numbers you quote in interviews (interview-prep/).