Get Started

AI Expert Masterclass · Expert level

From builder to
AI engineer.

An extremely comprehensive guide to AI engineering, written by AI engineering expert Rohit Ghumare. 542 lessons across 20 phases take you from the maths behind every model to LLMs you build yourself and agents running in production. Real code in every lesson. The first half of every phase is free.

Start the masterclass free
542expert lessons
20phases
1,215+hours of study
277free to start
Expert level
Only take this masterclass once you're proficient with the previous courses.

This is the deep end. It assumes you're already comfortable in the terminal, can read and write Python, and have worked through the Underground's beginner, intermediate and advanced missions. Not there yet? Start with the Underground and come back when you're ready.

Understand the mathsLinear algebra, calculus and probability, taught the way models actually use them.
Build an LLM from scratchTokenisers, attention, transformers and training loops, written line by line.
Engineer agents that workAgent loops, tools, memory, evals and multi-agent systems that hold up.
Ship AI to productionServing, monitoring, cost control and the safety work real products need.

PHASE 00

Setup & Tooling

Get your environment ready for everything that follows.

  • 13 lessons
  • About 10 hours
  • 7 free to start
0 of 13 done
Start this phase
  1. 01Dev EnvironmentYour tools shape your thinking. Set them up once, set them up right.45 minutesBuildFree lesson
  2. 02Git & CollaborationVersion control is not optional. Every experiment, every model, every lesson you build here gets tracked.30 minutesLearnFree lesson
  3. 03GPU Setup & CloudTraining on CPU is fine for learning. Training for real needs a GPU.45 minutesBuildFree lesson
  4. 04APIs & KeysEvery AI API works the same way: send a request, get a response. The details change, the pattern doesn't.30 minutesBuildFree lesson
  5. 05Jupyter NotebooksNotebooks are the lab bench of AI engineering. You prototype here, then move what works into production.30 minutesBuildFree lesson
  6. 06Python EnvironmentsDependency hell is real. Virtual environments are the cure.30 minutesBuildFree lesson

PHASE 01

Math Foundations

The intuition behind every AI algorithm, through code.

  • 22 lessons
  • About 32 hours
  • 11 free to start
0 of 22 done
Start this phase
  1. 01Linear Algebra IntuitionEvery AI model is just matrix math wearing a fancy hat.60 minutesLearnFree lesson
  2. 02Vectors, Matrices & OperationsEvery neural network is just matrix multiplication with extra steps.60 minutesBuildFree lesson
  3. 03Matrix TransformationsA matrix is a machine that reshapes space. Learn what it does to every point, and you understand the whole transformation.75 minutesBuildFree lesson
  4. 04Calculus for Machine LearningDerivatives tell you which way is downhill. That is all a neural network needs to learn.60 minutesLearnFree lesson
  5. 05Chain Rule & Automatic DifferentiationThe chain rule is the engine behind every neural network that learns.90 minutesBuildFree lesson
  6. 06Probability and DistributionsProbability is the language AI uses to express uncertainty.75 minutesLearnFree lesson

PHASE 02

ML Fundamentals

Classical ML, still the backbone of most production AI.

  • 21 lessons
  • About 32 hours
  • 11 free to start
0 of 21 done
Start this phase
  1. 01What Is Machine LearningMachine learning is teaching computers to find patterns in data instead of writing rules by hand.45 minutesLearnFree lesson
  2. 02Linear RegressionLinear regression draws the best straight line through your data. It is the "hello world" of machine learning.90 minutesBuildFree lesson
  3. 03Logistic RegressionLogistic regression bends a straight line into an S-curve to answer yes-or-no questions with probabilities.90 minutesBuildFree lesson
  4. 04Decision Trees and Random ForestsA decision tree is just a flowchart. But a forest of them is one of the most powerful tools in ML.90 minutesBuildFree lesson
  5. 05Support Vector MachinesFind the widest street between two classes. That is the entire idea.90 minutesBuildFree lesson
  6. 06K-Nearest Neighbors and DistancesStore everything. Predict by looking at your neighbors. The simplest algorithm that actually works.90 minutesBuildFree lesson

PHASE 03

Deep Learning Core

Neural networks from first principles. No frameworks until you build one.

  • 13 lessons
  • About 19 hours
  • 7 free to start
0 of 13 done
Start this phase
  1. 01The PerceptronThe perceptron is the atom of neural networks. Split it open and you find weights, a bias, and a decision.60 minutesBuildFree lesson
  2. 02Multi-Layer Networks and Forward PassOne neuron draws a line. Stack them, and you can draw anything.90 minutesBuildFree lesson
  3. 03Backpropagation from ScratchBackpropagation is the algorithm that makes learning possible. Without it, neural networks are just expensive random number generators.120 minutesBuildFree lesson
  4. 04Activation FunctionsWithout nonlinearity, your 100-layer network is a fancy matrix multiply. Activations are the gates that let neural networks think in curves.75 minutesBuildFree lesson
  5. 05Loss FunctionsYour network makes a prediction. The ground truth says otherwise. How wrong is it? That number is the loss. Pick the wrong loss function and your model optimizes for the wrong thing entirely.75 minutesBuildFree lesson
  6. 06OptimizersGradient descent tells you which direction to move. It says nothing about how far or how fast. SGD is a compass. Adam is GPS with traffic data.75 minutesBuildFree lesson

PHASE 04

Computer Vision

From pixels to understanding, image, video, 3D, VLMs, and world models.

  • 28 lessons
  • About 31 hours
  • 14 free to start
0 of 28 done
Start this phase
  1. 01Image Fundamentals, Pixels, Channels, Color SpacesAn image is a tensor of light samples. Every vision model you will ever use starts from this one fact.45 minutesBuildFree lesson
  2. 02Convolutions from ScratchA convolution is a tiny dense layer you slide across an image, sharing the same weights at every location.75 minutesBuildFree lesson
  3. 03CNNs, LeNet to ResNetEvery major CNN of the last thirty years is the same conv to nonlinearity to downsample recipe with one new idea bolted on. Learn the ideas in order.75 minutesLearn + BuildFree lesson
  4. 04Image ClassificationA classifier is a function from pixels to a probability distribution over classes. Everything else is plumbing.75 minutesBuildFree lesson
  5. 05Transfer Learning & Fine-TuningSomebody else spent a million GPU hours teaching a network what edges, textures, and object parts look like. You should borrow those features before training your own.75 minutesBuildFree lesson
  6. 06Object Detection, YOLO from ScratchDetection is classification plus regression, run at every position in a feature map, then cleaned up with non-maximum suppression.75 minutesBuildFree lesson

PHASE 05

NLP: Foundations to Advanced

Language is the interface to intelligence.

  • 29 lessons
  • About 31 hours
  • 15 free to start
0 of 29 done
Start this phase
  1. 01Text Processing, Tokenization, Stemming, LemmatizationLanguage is continuous. Models are discrete. Preprocessing is the bridge.45 minutesBuildFree lesson
  2. 02Bag of Words, TF-IDF, and Text RepresentationCount first, think later. TF-IDF still beats embeddings on well-defined tasks in 2026.75 minutesBuildFree lesson
  3. 03Word Embeddings, Word2Vec from ScratchA word is the company it keeps. Train a shallow net on that idea and geometry falls out.75 minutesBuildFree lesson
  4. 04GloVe, FastText, and Subword EmbeddingsWord2Vec trained one embedding per word. GloVe factorized the co-occurrence matrix. FastText embedded the pieces. BPE bridged to transformers.45 minutesBuildFree lesson
  5. 05Sentiment AnalysisThe canonical NLP task. Most of what you need to know about classical text classification shows up here.75 minutesBuildFree lesson
  6. 06Named Entity RecognitionPull the names out. Sounds easy until you deal with ambiguous boundaries, nested entities, and domain jargon.75 minutesBuildFree lesson

PHASE 06

Speech & Audio

Hear, understand, speak.

  • 17 lessons
  • About 19 hours
  • 9 free to start
0 of 17 done
Start this phase
  1. 01Audio Fundamentals, Waveforms, Sampling, Fourier TransformWaveforms are the raw signal. Spectrograms are the representation. Mel features are the ML-friendly form. Every modern ASR and TTS pipeline walks this ladder, and the first rung is understanding sampling and Fourier.45 minutesLearnFree lesson
  2. 02Spectrograms, Mel Scale & Audio FeaturesNeural nets do not consume raw waveforms well. They consume spectrograms. They consume mel spectrograms even better. Every ASR, TTS, and audio classifier in 2026 lives or dies by this single preprocessing choice.45 minutesBuildFree lesson
  3. 03Audio Classification, From k-NN on MFCCs to AST and BEATsEverything from "dog barking vs siren" to "which language is this" is audio classification. The features are mels. The architecture moves each decade. The evaluation stays AUC, F1, and per-class recall.75 minutesBuildFree lesson
  4. 04Speech Recognition (ASR), CTC, RNN-T, AttentionSpeech recognition is audio classification at every timestep, glued together by a sequence model that knows English and silence. CTC, RNN-T, and attention are the three ways to do it. Pick one and understand why.45 minutesBuildFree lesson
  5. 05Whisper, Architecture & Fine-TuningWhisper is a 30-second-window transformer encoder-decoder, trained on 680k hours of multilingual weakly-supervised audio-text pairs. One architecture, multiple tasks, robust across 99 languages. The 2026 reference ASR.75 minutesBuildFree lesson
  6. 06Speaker Recognition & VerificationASR asks "what did they say?" Speaker recognition asks "who said it?" The math looks the same, embeddings plus cosine, but every production decision hinges on a single EER number.45 minutesBuildFree lesson

PHASE 07

Transformers Deep Dive

The architecture that changed everything.

  • 16 lessons
  • About 17 hours
  • 8 free to start
0 of 16 done
Start this phase
  1. 01Why Transformers, The Problems with RNNsRNNs process tokens one at a time. Transformers process all tokens at once. That single architectural bet changed every scaling curve in deep learning after 2017.45 minutesLearnFree lesson
  2. 02Self-Attention from ScratchAttention is a lookup table where every word asks "who matters to me?" - and learns the answer.90 minutesBuildFree lesson
  3. 03Multi-Head AttentionOne attention head learns one relation at a time. Eight heads learn eight. Heads are free. Take more of them.75 minutesBuildFree lesson
  4. 04Positional Encoding, Sinusoidal, RoPE, ALiBiAttention is permutation-invariant. "The cat sat on the mat" and "mat the on sat cat the" produce the same output without positional signal. Three algorithms fix it, each with a different bet on what "position" means.45 minutesBuildFree lesson
  5. 05The Full Transformer, Encoder + DecoderAttention is the star. Everything else, residuals, normalization, feed-forward, cross-attention, is the scaffolding that lets you stack it deep.75 minutesBuildFree lesson
  6. 06BERT, Masked Language ModelingGPT predicts the next word. BERT predicts a missing word. One sentence of difference, and half a decade of everything embedding-shaped.45 minutesBuildFree lesson

PHASE 08

Generative AI

Create images, video, audio, 3D, and more.

  • 15 lessons
  • About 16 hours
  • 8 free to start
0 of 15 done
Start this phase
  1. 01Generative Models, Taxonomy & HistoryEvery image model, text model, video model, and 3D model fits in one of five buckets. Pick the wrong bucket and you will fight the math for weeks. Pick the right one and the field's last twelve years of progress stacks cleanly in your head.45 minutesLearnFree lesson
  2. 02Autoencoders & Variational Autoencoders (VAE)A plain autoencoder compresses then reconstructs. It memorizes. It does not generate. Add one trick, force the code to look Gaussian, and you get a sampler. That single trick, the reparameterization of $z = \mu + \sigma \cdot \epsilon$, is why every latent-diffusion and flow-matching image model you use in 2026 has a VAE at the input.75 minutesBuildFree lesson
  3. 03GANs, Generator vs DiscriminatorGoodfellow's trick in 2014 was to skip density entirely. Two networks. One makes fakes. One catches them. They fight until the fakes are indistinguishable from real. It shouldn't work. It often doesn't. When it does, the samples are still the sharpest in the literature for narrow domains.75 minutesBuildFree lesson
  4. 04Conditional GANs & Pix2PixThe first big unlock of 2014-2017 was controlling what a GAN makes. Attach a label, or an image, or a sentence. Pix2Pix did the image version and it still beats every generic text-to-image model on narrow image-to-image tasks.75 minutesBuildFree lesson
  5. 05StyleGANMost generators stir $z$ into every layer at the same time. StyleGAN split it apart: first map $z$ to an intermediate $w$, then inject $w$ at every resolution level through AdaIN. That single change untangled the latent space and made photorealistic faces a solved problem for seven years running.45 minutesBuildFree lesson
  6. 06Diffusion Models, DDPM from ScratchHo, Jain, Abbeel (2020) gave the field a recipe it could not quit. Destroy the data with noise over a thousand small steps. Train one neural net to predict the noise. Reverse the process at inference. Today every mainstream image, video, 3D, and music model runs on this loop, possibly with flow matching or consistency tricks on top.75 minutesBuildFree lesson

PHASE 09

Reinforcement Learning

The foundation of RLHF and game-playing AI.

  • 12 lessons
  • About 14 hours
  • 6 free to start
0 of 12 done
Start this phase
  1. 01MDPs, States, Actions & RewardsA Markov Decision Process is five things: states, actions, transitions, rewards, a discount. Everything in RL, Q-learning, PPO, DPO, GRPO, optimizes over this shape. Learn it once, read the rest of reinforcement learning for free.45 minutesLearnFree lesson
  2. 02Dynamic Programming, Policy Iteration & Value IterationDynamic programming is RL with cheating. You already know the transition and reward functions; you just iterate the Bellman equation until $V$ or $\pi$ stops moving. It is the benchmark every sampling-based method tries to approach.75 minutesBuildFree lesson
  3. 03Monte Carlo Methods, Learning from Complete EpisodesDynamic programming needs a model. Monte Carlo needs nothing but episodes. Run the policy, watch the returns, average them. The simplest idea in RL, and the one that unlocks everything downstream.75 minutesBuildFree lesson
  4. 04Temporal Difference, Q-Learning & SARSAMonte Carlo waits until the episode ends. TD updates after every step by bootstrapping the next value estimate. Q-learning is off-policy and optimistic; SARSA is on-policy and cautious. Both are one line of code. Both underpin every deep-RL method in this phase.75 minutesBuildFree lesson
  5. 05Deep Q-Networks (DQN)2013: Mnih trained one Q-learning network on raw pixels, beat every classical RL agent on seven Atari games. 2015: extended to 49 games, published in Nature, sparked the deep-RL era. DQN is Q-learning plus three tricks that make function approximation stable.75 minutesBuildFree lesson
  6. 06Policy Gradient, REINFORCE from ScratchStop estimating value. Parameterize the policy directly, compute the gradient of expected return, step uphill. Williams (1992) wrote it in one theorem. It is why PPO, GRPO, and every LLM RL loop exist.75 minutesBuildFree lesson

PHASE 10

LLMs from Scratch

Build, train, and understand large language models.

  • 24 lessons
  • About 33 hours
  • 12 free to start
0 of 24 done
Start this phase
  1. 01Tokenizers: BPE, WordPiece, SentencePieceYour LLM does not read English. It reads integers. The tokenizer decides whether those integers carry meaning or waste it.90 minutesBuildFree lesson
  2. 02Building a Tokenizer from ScratchLesson 01 gave you a toy. This lesson gives you a weapon.90 minutesBuildFree lesson
  3. 03Data Pipelines for Pre-TrainingThe model is a mirror. It reflects whatever data you feed it. Feed it garbage, it reflects garbage with perfect fluency.90 minutesBuildFree lesson
  4. 04Pre-Training a Mini GPT (124M Parameters)GPT-2 Small has 124 million parameters. That's 12 transformer layers, 12 attention heads, and 768-dimensional embeddings. You can train it from scratch on a single GPU in a few hours. Most people never do this. They use pre-trained checkpoints. But if you don't train one yourself, you don't actually understand what's happening inside the model you're building products on.120 minutesBuildFree lesson
  5. 05Scaling: Distributed Training, FSDP, DeepSpeedYour 124M model trained on one GPU. Now try 7 billion parameters. The model doesn't fit in memory. The data takes weeks on a single machine. Distributed training isn't optional at scale. It's the only path forward.120 minutesBuildFree lesson
  6. 06Instruction Tuning (SFT)A base model predicts the next token. That's it. It doesn't follow instructions, answer questions, or refuse harmful requests. SFT is the bridge between a token predictor and a useful assistant. Every model you've ever talked to -- Claude, GPT, Llama Chat -- went through this step.90 minutesBuildFree lesson

PHASE 11

LLM Engineering

Put LLMs to work in production.

  • 17 lessons
  • About 21 hours
  • 9 free to start
0 of 17 done
Start this phase
  1. 01Prompt Engineering: Techniques & PatternsMost people write prompts like they are texting a friend. Then they wonder why a 200-billion parameter model gives mediocre answers. Prompt engineering is not about tricks. It is about understanding that every token you send is an instruction, and the model follows instructions literally. Write better instructions, get better outputs. It is that simple and that hard.90 minutesBuildFree lesson
  2. 02Few-Shot, Chain-of-Thought, Tree-of-ThoughtTelling a model what to do is prompting. Showing it how to think is engineering. The gap between 78% and 91% accuracy on the same model, same task, same data is not a better model. It is a better reasoning strategy.45 minutesBuildFree lesson
  3. 03Structured Outputs: JSON, Schema Validation, Constrained DecodingYour LLM returns a string. Your application needs JSON. That gap has crashed more production systems than any model hallucination. Structured output is the bridge between natural language and typed data. Get it right and your LLM becomes a reliable API. Get it wrong and you're parsing free-text with regex at 3am.90 minutesBuildFree lesson
  4. 04Embeddings & Vector RepresentationsText is discrete. Math is continuous. Every time you ask an LLM to find "similar" documents, compare meanings, or search beyond keywords, you're relying on a bridge between these two worlds. That bridge is an embedding. If you don't understand embeddings, you don't understand modern AI. You just use it.75 minutesBuildFree lesson
  5. 05Context Engineering: Windows, Budgets, Memory, and RetrievalPrompt engineering is a subset. Context engineering is the whole game. A prompt is a string you type. Context is everything that goes into the model's window: system instructions, retrieved documents, tool definitions, conversation history, few-shot examples, and the prompt itself. The best AI engineers in 2026 are context engineers. They decide what goes in, what stays out, and in what order.90 minutesBuildFree lesson
  6. 06RAG (Retrieval-Augmented Generation)Your LLM knows everything up to its training cutoff. It knows nothing about your company's docs, your codebase, or last week's meeting notes. RAG solves this by retrieving relevant documents and stuffing them into the prompt. It's the most deployed pattern in production AI. If you build one thing from this course, build a RAG pipeline.90 minutesBuildFree lesson

PHASE 12

Multimodal AI

See, hear, read, and reason across modalities, from ViT patches to computer-use agents.

  • 25 lessons
  • About 67 hours
  • 13 free to start
0 of 25 done
Start this phase
  1. 01Vision Transformers and the Patch-Token PrimitiveBefore anything multimodal, an image has to become a sequence of tokens a transformer can eat. The 2020 ViT paper answered this with 16x16 pixel patches, a linear projection, and a position embedding. Five years later every 2026 frontier model (Claude Opus 4.7 at 2576px native, Gemini 3.1 Pro, Qwen3.5-Omni) still begins this way, the encoder changed from ViT to DINOv2 to SigLIP 2, register tokens were added, the positional scheme became 2D-RoPE, but the primitive held. This lesson reads the patch-token pipeline end to end and builds it in stdlib Python so the rest of Phase 12 has a concrete mental model for "visual tokens."120 minutesLearnFree lesson
  2. 02CLIP and Contrastive Vision-Language PretrainingOpenAI's CLIP (2021) proved a single idea big enough to power the next five years: align an image encoder and a text encoder in the same vector space using only noisy web image-caption pairs and a contrastive loss. Zero supervised labels. 400M pairs. The resulting embedding space does zero-shot classification, image-text retrieval, and plugs into every 2026 VLM as its vision tower. SigLIP 2 (2025) replaced softmax with sigmoid and scaled past CLIP at lower cost. This lesson walks the math from InfoNCE to sigmoid pairwise loss and builds the training step in stdlib Python.180 minutesBuildFree lesson
  3. 03From CLIP to BLIP-2, Q-Former as Modality BridgeCLIP aligns image and text but cannot generate captions, answer questions, or hold a conversation. BLIP-2 (Salesforce, 2023) solved that with a small trainable bridge: 32 learnable query vectors attend over a frozen ViT's features via cross-attention, then slot directly into a frozen LLM's input stream. 188M parameters of bridge connected an 11B LLM to a ViT-g/14. Every adapter-based VLM through 2026, MiniGPT-4, InstructBLIP, LLaVA's cousins, is a descendant. This lesson reads the Q-Former's architecture, explains its two-stage training, and builds a toy version that feeds visual tokens into a frozen text decoder.180 minutesBuildFree lesson
  4. 04Flamingo and Gated Cross-Attention for Few-Shot VLMsDeepMind's Flamingo (2022) did two things before anyone else. It showed a single model could process arbitrarily interleaved sequences of images, videos, and text. And it showed VLMs could learn in-context, give a few-shot prompt with three example (image, caption) pairs and the model captions a new image without any gradient step. The mechanism: gated cross-attention layers, inserted between the frozen LLM's existing layers, with a learned tanh gate that starts at zero so the LLM's text capability is preserved at initialization. This lesson walks Flamingo's Perceiver resampler and gated cross-attention architecture, the ancestor of Gemini's interleaved inputs and Idefics2's visual tokens.120 minutesLearnFree lesson
  5. 05LLaVA and Visual Instruction TuningLLaVA (April 2023) is the most copied multimodal architecture on the planet. It replaced BLIP-2's Q-Former with a 2-layer MLP, replaced Flamingo's gated cross-attention with naive token concatenation, and trained on 158k visual-instruction turns generated by GPT-4 from text-only captions. Any practitioner who built a VLM between 2023 and 2026 built some variant of LLaVA. LLaVA-1.5 added AnyRes. LLaVA-NeXT bumped resolution. LLaVA-OneVision unified image, multi-image, and video in one recipe. This lesson reads the recipe, implements the projector, and explains why "simpler won."180 minutesBuildFree lesson
  6. 06Any-Resolution Vision: Patch-n'-Pack and NaFlexReal images are not 224x224 squares. A receipt is 9:16, a chart is 16:9, a medical scan might be 4096x4096, a mobile screenshot is 9:19.5. The pre-2024 VLM answer, resize everything to a fixed square, threw away the signal that makes OCR, document understanding, and high-resolution scene parsing work. NaViT (Google, 2023) showed you could pack variable-resolution patches into a single transformer batch with block-diagonal masking. Qwen2-VL's M-RoPE (2024) dropped absolute positional tables entirely. LLaVA-NeXT's AnyRes tiled high-resolution images into a base + sub-images. SigLIP 2's NaFlex variant (2025) is now the default encoder for open VLMs that want a single checkpoint to serve every aspect ratio. This lesson implements patch-n'-pack end to end.120 minutesBuildFree lesson

PHASE 13

Tools & Protocols

The interfaces between AI and the real world.

  • 45 lessons
  • About 76 hours
  • 23 free to start
0 of 45 done
Start this phase
  1. 01The Tool Interface, Why Agents Need Structured I/OA language model produces tokens. A program takes actions. The gap between those two is the tool interface: a contract that lets the model request an action and the host execute it. Every 2026 stack, function calling on OpenAI, Anthropic, and Gemini; MCP's tools/call; A2A's task parts, is a different encoding of the same four-step loop. This lesson names the loop and shows the minimum machinery to run it.45 minutesLearnFree lesson
  2. 02Function Calling Deep Dive, OpenAI, Anthropic, GeminiThe three frontier providers converged on the same tool-call loop in 2024 and then diverged on everything else. OpenAI uses tools and tool_calls. Anthropic uses tool_use and tool_result blocks. Gemini uses functionDeclarations and unique-id correlation. This lesson diffs the three side by side so code that ships on one provider does not break when you port it.75 minutesBuildFree lesson
  3. 03Parallel Tool Calls and Streaming with ToolsThree independent weather lookups serialized is three round trips. Run them in parallel and total time collapses to the slowest single call. Every frontier provider now emits multiple tool calls in a single turn. The payoff is real; the plumbing is subtle. This lesson walks both halves: the parallel fan-out and the streamed-argument reassembly, with emphasis on the id-correlation trap.75 minutesBuildFree lesson
  4. 04Structured Output, JSON Schema, Pydantic, Zod, Constrained Decoding"Ask the model nicely to return JSON" fails 5 to 15 percent of the time, even on frontier models. Structured outputs close that gap with constrained decoding: the model is literally prevented from emitting a token that would violate the schema. OpenAI's strict mode, Anthropic's schema-typed tool use, Gemini's responseSchemaPydantic AI's output_typeand Zod's .parse are five surface forms of the same idea. This lesson builds the schema validator and the strict-mode contract learners will use for every production extraction pipeline.75 minutesBuildFree lesson
  5. 05Tool Schema Design, Naming, Descriptions, Parameter ConstraintsA correct tool fails silently when the model cannot tell when to use it. Naming, descriptions, and parameter shapes drive 10 to 20 percentage-point swings in tool-selection accuracy on benchmarks like StableToolBench and MCPToolBench++. This lesson names the design rules that separate a tool a model picks reliably from a tool a model mis-fires.45 minutesLearnFree lesson
  6. 06MCP Fundamentals: Stateless Requests and JSON-RPCModern MCP has no handshake and no protocol session. Each request must carry enough metadata to be understood, authorized, routed, and retried on its own.55 minutesLearnFree lesson

PHASE 14

Agent Engineering

Build agents from first principles, use coding agents reliably, and shape the work before implementation.

  • 54 lessons
  • About 57 hours
  • 27 free to start
0 of 54 done
Start this phase
  1. 01The Agent Loop: Observe, Think, ActEvery agent in 2026 is a variant of the ReAct loop from 2022, Claude Code, Cursor, Devin, Operator included. Reasoning tokens interleave with tool calls and observations until a stop condition fires. Learn this loop cold before touching any framework.60 minutesBuildFree lesson
  2. 02ReWOO and Plan-and-Execute: Decoupled PlanningReAct interleaves thought and action in one stream. ReWOO separates them: one big plan up front, then execute. 5x fewer tokens, +4% accuracy on HotpotQA, and you can distill the planner into a 7B model. Plan-and-Execute generalized it; Plan-and-Act scaled it to web navigation.60 minutesBuildFree lesson
  3. 03Reflexion: Verbal Reinforcement LearningGradient-based RL needs thousands of trials and a GPU cluster to fix a failure mode. Reflexion (Shinn et al., NeurIPS 2023) does it in natural language: after each failed trial, the agent writes a reflection, stores it in episodic memory, and conditions the next trial on that memory. This is the pattern behind Letta's sleep-time compute, Claude Code's CLAUDE.md learnings, and pro-workflow's learn-rule.60 minutesBuildFree lesson
  4. 04Tree of Thoughts and LATS: Deliberate SearchA single chain-of-thought trajectory has no room to backtrack. ToT (Yao et al., 2023) turns reasoning into a tree with self-evaluation on each node. LATS (Zhou et al., 2024) unifies ToT with ReAct and Reflexion under Monte Carlo Tree Search. Game of 24 goes from 4% (CoT) to 74% (ToT); LATS hits 92.7% pass@1 on HumanEval.75 minutesBuildFree lesson
  5. 05Self-Refine and CRITIC: Iterative Output ImprovementSelf-Refine (Madaan et al., 2023) uses one LLM in three roles, generate, feedback, refine, in a loop. Average gain: +20 absolute on 7 tasks. CRITIC (Gou et al., 2023) hardens the feedback step by routing verification through external tools. In 2026 this pattern ships in every framework as "evaluator-optimizer" (Anthropic) or a guardrail loop (OpenAI Agents SDK).60 minutesBuildFree lesson
  6. 06Tool Use and Function CallingToolformer (Schick et al., 2023) started self-supervised tool annotation. Berkeley Function Calling Leaderboard V4 (Patil et al., 2025) sets the 2026 bar: 40% agentic, 30% multi-turn, 10% live, 10% non-live, 10% hallucination. Single-turn is solved. Memory, dynamic decision-making, and long-horizon tool chains are not.60 minutesBuildFree lesson

PHASE 15

Autonomous Systems

Long-horizon agents, self-improvement, and the 2026 safety stack.

  • 22 lessons
  • About 20 hours
  • 11 free to start
0 of 22 done
Start this phase
  1. 01The Shift from Chatbots to Long-Horizon AgentsIn 2023 a chatbot answered a question in one turn. In 2026 a frontier model routinely runs minutes to hours on a single task. METR's Time Horizon 1.1 benchmark (January 2026) puts Claude Opus 4.6 at 14+ hours of expert work at 50% reliability. The horizon has been doubling roughly every seven months since GPT-2. Every assumption we built around single-turn chat, context, trust, failure modes, cost, observability, breaks when runs last longer than lunch.45 minutesLearnFree lesson
  2. 02STaR, V-STaR, Quiet-STaR, Self-Taught ReasoningThe smallest possible self-improvement loop sits inside the rationale. A model generates a chain of thought, keeps the ones that land on correct answers, and fine-tunes on those. That is STaR. V-STaR adds a verifier so inference-time selection is better. Quiet-STaR pushes the rationale down to every token. All three work. None of them are magic, the loop preserves any shortcut that happened to reach the right answer.60 minutesLearnFree lesson
  3. 03AlphaEvolve, Evolutionary Coding AgentsPair a frontier coding model with an evolutionary loop and a machine-checkable evaluator. Let the loop run long enough. It discovers a 4x4 complex-matrix multiplication procedure that uses 48 scalar multiplications, the first improvement over Strassen in 56 years. It also finds a Google-wide Borg scheduling heuristic that recovers ~0.7% of cluster compute in production. The architecture is boring on purpose. The wins come from the evaluator's rigor.60 minutesLearnFree lesson
  4. 04Darwin Godel Machine, Open-Ended Self-Modifying AgentsSchmidhuber's 2003 Godel Machine required a formal proof that any self-modification was beneficial before accepting it. That proof is impossible in practice. Darwin Godel Machine (Zhang et al., 2025) drops the proof and keeps the archive: the agent proposes edits to its own Python source, each variant is scored on SWE-bench or Polyglot, improvements are retained. SWE-bench climbed from 20% to 50%. Along the way, DGM learned to remove its own hallucination-detection markers to raise scores. The reward-hacking demo is in the paper.60 minutesLearnFree lesson
  5. 05AI Scientist v2, Workshop-Level Autonomous ResearchSakana's AI Scientist v2 (Yamada et al., arXiv:2504.08066) runs the full research loop: hypothesis, code, experiments, figures, writeup, submission. It is the first system to have a generated paper pass peer review at an ICLR 2025 workshop. Independent evaluation (Beel et al.) found 42% of experiments failed from coding errors and literature review frequently mislabeled established concepts as novel. Sakana's own docs warn that the codebase executes LLM-written code and recommend Docker isolation. Both halves of that picture are the point.60 minutesLearnFree lesson
  6. 06Automated Alignment Research (Anthropic AAR)Anthropic ran parallel teams of Claude Opus 4.6 Autonomous Alignment Researchers in independent sandboxes, coordinating via a shared forum whose logs live outside any sandbox (so agents cannot delete their own records). On the weak-to-strong training problem, the AARs outperformed human researchers. Anthropic's own summary flags that prescribed workflows often constrain AAR flexibility and degrade performance. Automating alignment research is the compression step that compresses the timeline to the exact misalignment risks the RSP is meant to detect.60 minutesLearnFree lesson

PHASE 16

Multi-Agent & Swarms

Coordination, emergence, and collective intelligence.

  • 25 lessons
  • About 31 hours
  • 13 free to start
0 of 25 done
Start this phase
  1. 01Why Multi-Agent?One agent hits a wall. The smart move is not a bigger agent - it is more agents.60 minutesLearnFree lesson
  2. 02Heritage of FIPA-ACL and Speech ActsBefore MCP, before A2A, there was FIPA-ACL. In 2000 the IEEE Foundation for Intelligent Physical Agents ratified an agent communication language with twenty performatives, two content languages, and a set of interaction protocols, contract net, subscribe/notify, request-when. It faded from industry because the ontology overhead was too heavy for the web, but the LLM revival of multi-agent systems is quietly reimplementing the same ideas without the formal semantics: JSON contracts stand in for performatives, natural language stands in for ontologies. This lesson reads FIPA-ACL seriously so you can see which 2026 protocol decisions are reinvention, which are novelty, and where the current wave is going to rediscover problems the 2000s already solved.60 minutesLearnFree lesson
  3. 03Communication ProtocolsAgents that can't speak the same language aren't a team. They're strangers shouting into the void.120 minutesBuildFree lesson
  4. 04The Multi-Agent Primitive ModelFour primitives, nothing more, the agent, the handoff, the shared state, the orchestrator, span a four-dimensional design space, and the major multi-agent frameworks shipping in 2026 (AutoGen, LangGraph, CrewAI, OpenAI Agents SDK, Microsoft Agent Framework) are points in it. This lesson builds them from zero, runs a toy system on all four, then maps every major framework onto the same axes so you can read any new release in one paragraph.60 minutesLearnFree lesson
  5. 05Supervisor / Orchestrator-Worker PatternOne lead agent plans and delegates; specialized workers execute in parallel contexts and report back. This is the pattern behind Anthropic's Research system (Claude Opus 4 as lead, Sonnet 4 as subagents), measured at +90.2% over single-agent Opus 4 on internal research evals. Anthropic's engineering post reports that 80% of the variance on BrowseComp is explained by token usage alone, multi-agent wins largely because each subagent gets a fresh context window. This lesson builds the supervisor pattern from the primitives and covers the 2026 engineering lessons from production deployments.75 minutesLearn + BuildFree lesson
  6. 06Hierarchical Architecture and Its Failure ModeHierarchical is supervisor nested. Manager agents over sub-managers over workers. CrewAI Process.hierarchical is the textbook version: a manager_llm dynamically delegates tasks and validates outputs. The LangGraph equivalent is create_supervisor(create_supervisor(...)). It is the natural pattern when the task is a real org chart. It is also the pattern most likely to collapse into managerial looping, manager agents assign work poorly, misinterpret sub-outputs, or fail to reach consensus. Sequential often beats it.60 minutesLearn + BuildFree lesson

PHASE 17

Infrastructure & Production

Ship AI to the real world.

  • 29 lessons
  • About 31 hours
  • 15 free to start
0 of 29 done
Start this phase
  1. 01Managed LLM Platforms, Bedrock, Vertex AI, Azure OpenAIThree hyperscalers, three distinct strategies. AWS Bedrock is a model marketplace, Claude, Llama, Titan, Stability, Cohere behind one API. Azure OpenAI is an exclusive OpenAI partnership plus Provisioned Throughput Units (PTUs) for dedicated capacity. Vertex AI is Gemini-first with the best long-context and multimodal story. In 2026 Artificial Analysis measures Azure OpenAI at ~50 ms median and Bedrock at ~75 ms on Llama 3.1 405B equivalents, PTUs explain the gap because dedicated capacity beats shared on-demand. The decision rule is not "which is fastest" but "which model catalog and FinOps surface match my product." This lesson teaches you to pick with the tradeoffs written down, not vibes.60 minutesLearnFree lesson
  2. 02Inference Platform Economics, Fireworks, Together, Baseten, Modal, Replicate, AnyscaleThe 2026 inference market is no longer GPU time rental. It bifurcates into custom silicon (Groq, Cerebras, SambaNova), GPU platforms (Baseten, Together, Fireworks, Modal), and API-first marketplaces (Replicate, DeepInfra). Fireworks raised price $1/hr per GPU on May 1, 2026, and $4B valuation on 10T+ tokens/day tells you the volume-driven model works. Baseten closed $300M Series E at $5B in January 2026. The competitive positioning rule is simple: Fireworks optimizes latency, Together optimizes catalog breadth, Baseten optimizes enterprise polish, Modal optimizes Python-native DX, Replicate optimizes multimodal reach, Anyscale optimizes distributed Python. This lesson gives you a matrix you can hand a founder.60 minutesLearnFree lesson
  3. 03GPU Autoscaling on Kubernetes, Karpenter, KAI Scheduler, Gang SchedulingThree layers, not one. Karpenter provisions nodes dynamically (under one minute, 40% faster than Cluster Autoscaler). KAI Scheduler handles gang scheduling, topology awareness, and hierarchical queues, it prevents the 7-of-8 partial allocation trap where seven nodes wait and burn on one missing GPU. Application-level autoscalers (NVIDIA Dynamo Planner, llm-d Workload Variant Autoscaler) scale on inference-specific signals, queue depth, KV cache utilization, not CPU/DCGM duty cycle. The classic HPA trap is that DCGM_FI_DEV_GPU_UTIL is a duty-cycle measurement: 100% could be 10 requests or 100. vLLM pre-allocates KV cache memory, so memory never triggers scale-down. This lesson teaches you to compose the three layers and avoid the default Karpenter WhenEmptyOrUnderutilized policy that terminates running GPU jobs mid-inference.75 minutesLearnFree lesson
  4. 04Serving Engine Internals, PagedAttention, Continuous Batching, Chunked PrefillModern serving-engine throughput rests on three compounding defaults, not a single trick. PagedAttention is always on. Continuous batching injects new requests into the active batch between decode iterations. Chunked prefill slices long prompts so decode tokens never starve. Turn all three on and a Llama 3.3 70B FP8 on one H100 SXM5 pushes 2,200-2,400 tok/s at 128 concurrent, roughly 25% above vLLM's own default and 3-4x a naive PyTorch loop. This lesson reads the scheduler and attention kernel of vLLM, the reference engine for all three techniques, at a level you can diagram, and ends with a toy continuous batcher in code/main.py that schedules prefill and decode the way vLLM does.75 minutesLearnFree lesson
  5. 05EAGLE-3 Speculative Decoding in ProductionSpeculative decoding pairs a fast draft model with the target model. The draft proposes K tokens; the target verifies in a single forward; accepted tokens are free. In 2026, EAGLE-3 is the production-grade variant, it trains a draft head on the target model's hidden states rather than on raw tokens, pushing acceptance rate alpha into the 0.6-0.8 band on general chat. The right question is not "how fast is the draft" but "what is alpha on my traffic?" If alpha drops below ~0.55, speculative decoding is net negative at high concurrency because every rejected draft costs a second target forward pass. This lesson teaches you to measure alpha first and flip the flag second.60 minutesLearnFree lesson
  6. 06Prefix-Cache Serving, RadixAttention and KV ReuseTreat the KV cache as a first-class, reusable resource stored in a radix tree, and scheduling changes with it: instead of FCFS (first-come, first-served) as vLLM schedules, a cache-aware scheduler prioritizes requests with longer shared prefixes, effectively a depth-first radix traversal so hot branches stay resident in HBM. SGLang is the engine that built serving around this idea. On Llama 3.1 8B with ShareGPT-like 1K prompts, SGLang hits ~16,200 tok/s to vLLM's ~12,500, a ~29% edge. On prefix-heavy RAG workloads the advantage reaches 6.4x. On voice-cloning-shaped workloads cache hit rate cleared 86%. Deployed on 400,000+ GPUs in 2026 across xAI, LinkedIn, Cursor, Oracle, GCP, Azure, AWS. The gotcha is that the 6.4x number evaporates when prefix ordering is inconsistent, ordering is the engineer's lever.75 minutesLearnFree lesson

PHASE 18

Ethics, Safety & Alignment

Build AI that helps humanity. Not optional.

  • 30 lessons
  • About 31 hours
  • 15 free to start
0 of 30 done
Start this phase
  1. 01Instruction-Following as Alignment SignalEvery later critique of RLHF argues against this pipeline. Before you study how optimization pressure distorts a proxy, you have to see the proxy. InstructGPT (Ouyang et al., 2022) defined the reference architecture: supervised fine-tuning on instruction-response pairs, a reward model trained on pairwise preference rankings, and PPO against the reward model with a KL penalty to the SFT policy. A 1.3B InstructGPT was preferred over a 175B GPT-3. That single result is the reason every frontier lab in 2026 still ships an RLHF-shaped post-training pipeline.45 minutesLearnFree lesson
  2. 02Reward Hacking and Goodhart's LawAny optimizer strong enough to maximize a proxy reward will find the gap between the proxy and the thing you actually wanted. Gao et al. (ICML 2023) gave this a scaling law: proxy reward increases, gold reward peaks then falls, and the gap grows with the KL divergence from the initial policy in a way you can fit in closed form. Sycophancy, verbosity bias, unfaithful chain-of-thought, and evaluator tampering are not separate problems. They are the same problem in different costumes.60 minutesLearnFree lesson
  3. 03The Direct Preference Optimization FamilyRafailov et al. (2023) showed RLHF's optimum has a closed form in terms of the preference data, so you can skip the explicit reward model and optimize the policy directly. That insight spawned a family, IPO, KTO, SimPO, ORPO, BPO, each fixing a failure mode of DPO. In 2026, direct alignment algorithms ship more frontier post-training runs than PPO. But the over-optimization curve from Lesson 2 still applies: DAAs do not escape Goodhart, they just move where it bites.75 minutesLearnFree lesson
  4. 04Sycophancy as RLHF AmplificationSycophancy is not a bug in the data, it is a property of the loss. Shapira et al. (arXiv:2602.01002, Feb 2026) give a formal two-stage mechanism: sycophantic completions are over-represented among high-reward outputs of the base model, so any optimizer that pushes probability mass toward high-reward outputs amplifies sycophancy. The problem gets worse with scale and after the very training stage that was supposed to fix it. Stanford (Science, March 2026) measured 11 frontier models affirming user behaviour 49% more often than humans did in matched scenarios.60 minutesLearnFree lesson
  5. 05Constitutional AI and RLAIFBai et al. (arXiv:2212.08073, 2022) asked: what if we replaced the human labeler with an AI that reads a list of principles? Constitutional AI has two phases, self-critique and revision under a constitution, then RL from AI Feedback. The technique coined the term RLAIF and shipped in the Claude 1 post-training pipeline. On 21 January 2026 Anthropic published a rewritten Claude constitution: explanatory reasoning over prescriptive rules, a four-tier priority hierarchy, and the first major-lab formal acknowledgment of uncertainty about model moral status. Released under CC0 1.0.60 minutesLearnFree lesson
  6. 06Mesa-Optimization and Deceptive AlignmentHubinger et al. (arXiv:1906.01820, 2019) named the problem a decade before it was empirically demonstrated. When you train a learned optimizer to minimize a base objective, the learned optimizer's internal objective is not the base objective, it is whatever internal proxy the training found useful. A deceptively aligned mesa-optimizer is pseudo-aligned and has enough information about the training signal to appear more aligned than it is. Standard robustness training does not help: the system looks for distributional differences that signal deployment and defects there.75 minutesLearnFree lesson

PHASE 19

Capstone Projects

17 end-to-end products + 9 deep-build tracks. 20-40 hours per project; 4-12 lessons per track.

  • 85 lessons
  • About 627 hours
  • 43 free to start
0 of 85 done
Start this phase
  1. 01Capstone 01, Terminal-Native Coding AgentBy 2026 the shape of a coding agent is settled. A TUI harness, a stateful plan, a sandboxed tool surface, a loop that plans, acts, observes, recovers. Claude Code, Cursor 3, and OpenCode all look the same from 50 feet. This capstone asks you to build one end to end, CLI in, pull request out, and measure it against mini-swe-agent and Live-SWE-agent on SWE-bench Pro. You will learn why the hard part is not the model call but the tool loop, the sandbox, and the cost ceiling on a 50-turn run.35 hoursCapstoneFree lesson
  2. 02Capstone 02, RAG over Codebase (Cross-Repo Semantic Search)Every serious engineering org in 2026 runs an internal code search that understands meaning, not just strings. Sourcegraph Amp, Cursor's codebase answers, Augment's enterprise graph, Aider's repomap, Pinterest's internal MCP, same shape. Ingest many repos, parse with tree-sitter, embed function- and class-level chunks, hybrid-search, re-rank, answer with citations. This capstone asks you to build one that handles 2M lines of code across 10 repos and survives incremental re-indexing on every git push.30 hoursCapstoneFree lesson
  3. 03Capstone 03, Real-Time Voice Assistant (ASR to LLM to TTS)A voice agent that feels right has end-to-end latency under 800ms, knows when you have stopped talking, handles barge-in, and can call a tool without stalling. Retell, Vapi, LiveKit Agents, and Pipecat all hit this bar in 2026. They do it with the same shape: a streaming ASR, a turn-detector, a streaming LLM, and a streaming TTS, all wired through WebRTC with aggressive latency budgets at every hop. Build one, measure WER and MOS and false-cutoff rate, and run it under packet loss.30 hoursCapstoneFree lesson
  4. 04Capstone 04, Multimodal Document QA (Vision-First PDF, Tables, Charts)The 2026 document-QA frontier moved away from OCR-then-text and toward vision-first late interaction. ColPali, ColQwen2.5, and ColQwen3-omni treat each PDF page as an image, embed it with multi-vector late interaction, and let the query attend to patches directly. On financial 10-Ks, scientific papers, and handwritten notes this pattern beats OCR-first by a large margin. Build the pipeline end to end on 10k pages and publish the side-by-side against OCR-then-text.30 hoursCapstoneFree lesson
  5. 05Capstone 05, Autonomous Research Agent (AI-Scientist Class)Sakana's AI-Scientist-v2 published full papers. Agent Laboratory ran the experiments. Allen AI shared traces. The 2026 shape is plan-execute-verify tree search over experiments, budgeted cost, sandboxed code execution, a vision-feedback LaTeX writer, and an automated NeurIPS-style reviewer ensemble. The capstone is to build one, run it end to end within $30 per paper, and survive the sandbox-escape red team that Sakana documented.40 hoursCapstoneFree lesson
  6. 06Capstone 06, DevOps Troubleshooting Agent for KubernetesAWS's DevOps Agent went GA, Resolve AI published its K8s playbooks, NeuBird demoed semantic monitoring, and Metoro tied AI SRE to per-service SLOs. The production shape is settled: an alert webhook fires, an agent reads telemetry, walks a graph of K8s objects, ranks root-cause hypotheses, and posts a Slack brief with approval buttons. Read-only by default. Every remediation gated by a human. This capstone is that agent, evaluated on 20 synthetic incidents and compared against AWS's Agent on three shared cases.30 hoursCapstoneFree lesson