Labs
Learn it by breaking it
Each lab is a small working system you can push on. Every lab says up front what is real (computed for real in your browser) and what is simulated — interviewers respect the distinction, and so should we.
Fundamentals
What happens between a prompt and a token.
- LLM fundamentalsTokens, sampling, KV cacheA real BPE tokenizer on English, Hindi, Hinglish and code; temperature/top-p on a toy distribution; prefill vs decode; KV-cache and GPU memory maths; structured output by token masking; SSE streaming; cosine similarity; a voice latency budget.
- Context window budgetWhat fits, what gets cutBuild a prompt from system, tools, history, retrieved chunks and the question; watch the window fill, cached prefixes, cost per call and what each trimming strategy drops.
Retrieval
Finding the right evidence, and proving you did.
- RAG labChunk, retrieve, fuse, rerank, measureThe whole retrieval pipeline over a 36-document fictional company: five chunking strategies, BM25 vs vectors vs hybrid, RRF, reranking, query rewriting, permissions, superseded documents, graph expansion and an eval table over 42 labelled questions.
- Vector index explorerFlat, HNSW, IVF, PQBuild real HNSW and IVF indexes over random vectors in your browser, sweep efSearch and nprobe for the recall/latency trade-off, and do the memory maths for float32, int8, PQ and binary.
Agents & safety
Loops, tools, patterns and the attacks against them.
- Guardrails attack simulator40 attacks vs your defencesDirect and indirect injection, jailbreaks, exfiltration, tool abuse and denial-of-wallet against a stack of defences you switch on — with false positives on benign traffic, mapped to both OWASP lists.
- Agent trace replayerReplay runs, inject failuresStep through recorded agent runs, inject a failure (bad tool output, injection, timeout, loop) at any step, switch mitigations on, and watch the side-effects ledger.
- Workflow patternsChain, route, parallel, orchestrate, evaluateThe five canonical patterns side by side on the same task, with calls, latency, cost and failure behaviour — plus durable execution with a crash halfway.
Production
Evals, serving, backends and model choices.
- Evals labError analysis, judges, statisticsLabel outputs, build a failure taxonomy, calibrate an LLM judge against your labels (TPR/TNR, position and verbosity bias), and see when an A/B difference is just noise.
- Serving simulatorBatching, KV cache, quantisationContinuous batching on a simulated GPU: arrival rate, batch size, context length and quantisation vs throughput, TTFT, inter-token latency and the KV-cache ceiling.
- Backend for AIStreaming, concurrency, Postgres, testsChoosing sync, streaming, jobs or webhooks, with idempotency keys; async fan-out with semaphores, backoff and Retry-After; Postgres + pgvector queries, indexes and isolation; and how to test code that calls a model.
- Model choice & adaptationPrompt vs RAG vs fine-tuneA decision walk-through for prompting, RAG, fine-tuning, LoRA, distillation and routing, plus a cascade calculator for cost vs quality.