Lozo AI Course. AI engineering, with notes for owners.

Every phase and lesson of AI Engineering from Scratch, the free open course, in one reader. On top of each lesson, a note from Lozo in plain English: what it is, and where it shows up in a business.

Lessons pulled October 28, 202620 phases, 542 lessons

Start with lesson 1

Phase 0, Lesson 1 of 13Dev Environment

Start here

If you run a business

Nine parts of the course an owner can use, in plain English, with the sources behind them.

  1. 01Phases 7, 10

    How a model works

    A language model writes one word at a time, picking what most likely comes next from patterns in a huge pile of text. It has no memory between chats and sees nothing of your business unless you hand it over.

    Why it matters Know this and you stop expecting it to know your stock or last week's orders.

    Phase 7: Transformers Deep Dive Phase 10: LLMs from Scratch

    Sources the course links 2
  2. 02Phase 11

    Prompting and context

    The prompt is your instructions. The context is everything the model can see when it answers: the prompt, your notes, a file, the last few messages.

    Why it matters Most weak answers come from thin context, not a weak model.

    Phase 11: LLM Engineering

    Sources the course links 3
  3. 03Phases 11, 13

    Tools and function calling

    A model can ask your software to do something: look up an order, book a slot, save a draft. You describe each tool, the model picks one and fills in the details, and your code runs it.

    Why it matters This is the step from a chat window to AI that does work inside your systems.

    Phase 11: LLM Engineering Phase 13: Tools & Protocols

    Sources the course links 3
  4. 04Phase 11

    Knowledge bases (RAG)

    Retrieval-augmented generation: before the model answers, the system finds the right passages in your own documents and hands them over. The answer then rests on your policy, not a guess.

    Why it matters It is how an assistant answers from your handbook, menu or FAQ.

    Phase 11: LLM Engineering

    Sources the course links 2
  5. 05Phase 14

    Agents

    An agent is a model in a loop: it plans, uses a tool, checks the result and goes again until the job is done or it needs you.

    Why it matters Agents fit open-ended jobs. When the steps never change, a fixed workflow is cheaper and safer.

    Phase 14: Agent Engineering

    Sources the course links 3
  6. 06Phase 16

    Teams of agents

    Several agents split one job. A lead plans and hands parts to helpers that work side by side, then pulls their results together.

    Why it matters Worth it for wide research work. For a single task, one agent is simpler.

    Phase 16: Multi-Agent & Swarms

    Sources the course links 3
  7. 07Phase 11

    Evals

    An eval is a fixed set of real questions with the answers you expect. Run it each time you change a prompt, a model or a tool, and you see what got better or worse.

    Why it matters Without one, every change is a guess you test on customers.

    Phase 11: LLM Engineering

    Sources the course links 3
  8. 08Phases 11, 18

    Guardrails and safe use

    The checks around the model: what it may read, which actions wait for a person to approve, and filters on what goes in and what comes out.

    Why it matters One wrong action, like an email to the wrong list, undoes the time AI saved.

    Phase 11: LLM Engineering Phase 18: Ethics, Safety & Alignment

    Sources the course links 3
  9. 09Phases 13, 17

    Shipping and running it

    Once it works, it has to stay fast, affordable and visible: reuse what repeats, log every call, and watch cost and errors week to week.

    Why it matters A build nobody watches drifts. The logs show what customers really ask.

    Phase 13: Tools & Protocols Phase 17: Infrastructure & Production

    Sources the course links 2

The full course

Every phase, every lesson

Tap a phase to see its lessons. Each lesson keeps the course's own text, figures and quiz, with a short note for owners on top.

  1. Setup & Tooling0/13 13 lessons
  2. Math Foundations0/22 22 lessons
  3. ML Fundamentals0/21 21 lessons
  4. Deep Learning Core0/13 13 lessons
  5. Computer Vision0/28 28 lessons
  6. NLP, Foundations to Advanced0/29 29 lessons
  7. Speech & Audio0/17 17 lessons
  8. Transformers Deep Dive0/16 16 lessons
  9. Generative AI0/15 15 lessons
  10. Reinforcement Learning0/12 12 lessons
  11. LLMs from Scratch0/24 24 lessons
  12. LLM Engineering0/17 17 lessons
  13. Multimodal AI0/25 25 lessons
  14. Tools & Protocols0/45 45 lessons

    For owners. How AI connects to the tools you already use: the calendar, the inbox, the order system.

    1. 01The Tool Interface — Why Agents Need Structured I/O
    2. 02Function Calling Deep Dive — OpenAI, Anthropic, Gemini
    3. 03Parallel Tool Calls and Streaming with Tools
    4. 04Structured Output — JSON Schema, Pydantic, Zod, Constrained Decoding
    5. 05Tool Schema Design — Naming, Descriptions, Parameter Constraints
    6. 06MCP Fundamentals: Stateless Requests and JSON-RPC
    7. 07Building an MCP Server: Stateless Python and TypeScript
    8. 08Building an MCP Client: Discovery, Routing, and Dual-Era Fallback
    9. 09MCP Transports: stdio and Stateless Streamable HTTP
    10. 10MCP Resources and Prompts: Addressable Context for Stateless Servers
    11. 11MCP Model Input: Sampling Migration and Stateless MRTR
    12. 12Explicit Scope and Stateless Elicitation
    13. 13MCP Tasks Extension: Durable Work on a Stateless Core
    14. 14MCP Apps on the Stateless Protocol
    15. 15MCP Security: Poisoned Metadata, Routing, and MRTR State
    16. 16MCP Authorization: CIMD, Issuer Binding, PKCE, and Step-Up
    17. 17Stateless MCP Gateways and Registry Admission
    18. 18MCP Auth in Production: Issuer-Bound Enrollment and Tokens
    19. 19A2A — Agent-to-Agent Protocol
    20. 20OpenTelemetry GenAI — Tracing Tool Calls End-to-End
    21. 21LLM Routing Layer — LiteLLM, OpenRouter, Portkey
    22. 22Agent Skills: Portable Contract and Runtime Boundary
    23. 23Capstone: Stateless Tool Ecosystem
    24. 24Skill Discovery and Progressive Disclosure
    25. 25Skill Invocation and Routing
    26. 26Skill Permissions, Sandboxes, and Trust
    27. 27Skill Evals, Packaging, and Portability
    28. 28MCP Tool Contracts and Content
    29. 29MCP Reliability, Cancellation, and Flow Control
    30. 30MCP Registry Supply Chain: Admission, Drift, and Rollback
    31. 31MCP Conformance Engineering: Versioning, Evidence, and Operations
    32. 32Program Anatomy: An ELF Reader From Scratch
    33. 33Disassembly and Control Flow: From Bytes to a Graph You Can Check
    34. 34Lifting to Pseudocode: IR, SSA, and Structuring From Scratch
    35. 35Evidence, Confidence, and Unknowns in Binary Analysis
    36. 36Rebuild and Prove Equal: Differential Tests, Byte Comparison, and the Evidence Loop
    37. 37The Reverse Engineering Landscape: History, Tool Families, and How a Decompiler Is Built
    38. 38Calling Conventions and Stack Frames: System V, Windows x64, and AArch64
    39. 39Compiler Idioms: What Optimization Does to Your Code and How to Read It Back
    40. 40Linking, Loading, and Stripped Binaries: PLT, GOT, Imports, Fixups, and Function Identification
    41. 41Recovering Data and Types: Structs, Arrays, C++ Objects, and DWARF
    42. 42Dynamic Analysis of Your Own Program: Debuggers, Traces, and Confirming Static Claims
    43. 43Beyond Native Code: Python, JVM, .NET, and WebAssembly Bytecode
    44. 44Binary Diffing and Symbolic Execution: Matching Functions and Solving for Inputs
    45. 45AI-Assisted Reverse Engineering: LLM Decompilers, Analysis Agents, and Ground Truth
    Open the phase: Tools & Protocols
  15. Agent Engineering0/54 54 lessons

    For owners. Agents that take steps on their own. Read the notes before you let one act for your business.

    1. 01The Agent Loop: Observe, Think, Act
    2. 02ReWOO and Plan-and-Execute: Decoupled Planning
    3. 03Reflexion: Verbal Reinforcement Learning
    4. 04Tree of Thoughts and LATS: Deliberate Search
    5. 05Self-Refine and CRITIC: Iterative Output Improvement
    6. 06Tool Use and Function Calling
    7. 07Agent Memory — Virtual Context and Memory Paging
    8. 08Memory Blocks and Sleep-Time Compute
    9. 09Hybrid Memory: Vector + Graph + KV
    10. 10Skill Libraries and Lifelong Learning (Voyager)
    11. 11Planning with HTN and Evolutionary Search
    12. 12Anthropic's Workflow Patterns: Simple Over Complex
    13. 13Stateful Graph Orchestration — Durable Execution and Checkpoints
    14. 14The Actor Model for Agents — Async Messages and Typed Runtimes
    15. 15Role-Based Agent Teams — Roles, Tasks, Processes
    16. 16OpenAI Agents SDK: Handoffs, Guardrails, Tracing
    17. 17The Harness as a Library — Subagents and Session Store
    18. 18Production Agent Runtimes — Fast Instantiation and Typed Workflows
    19. 19Benchmarks: SWE-bench, GAIA, AgentBench
    20. 20Benchmarks: WebArena and OSWorld
    21. 21Computer Use: Claude, OpenAI CUA, Gemini
    22. 22Voice Agents: Pipecat and LiveKit
    23. 23OpenTelemetry GenAI Semantic Conventions
    24. 24Agent Observability: Langfuse, Phoenix, Opik
    25. 25Multi-Agent Debate and Collaboration
    26. 26Failure Modes: Why Agents Break
    27. 27Prompt Injection and the PVE Defense
    28. 28Orchestration Patterns: Supervisor, Swarm, Hierarchical
    29. 29Production Runtimes: Queue, Event, Cron
    30. 30Eval-Driven Agent Development
    31. 31Agent Workbench Engineering: Why Capable Models Still Fail
    32. 32The Minimal Agent Workbench
    33. 33Agent Instructions as Executable Constraints
    34. 34Repo Memory and Durable State
    35. 35Initialization Scripts for Agents
    36. 36Scope Contracts and Task Boundaries
    37. 37Runtime Feedback Loops
    38. 38Verification Gates
    39. 39Reviewer Agent: Separate Builder from Marker
    40. 40Multi-Session Handoff
    41. 41The Workbench on a Real Repo
    42. 42Capstone: Ship a Reusable Agent Workbench Pack
    43. 43Frame the Task Before the Agent Writes Code
    44. 44Build an Evidence-Backed Execution Plan
    45. 45Delegate Agent Work with Isolation and Merge Contracts
    46. 46Turn Every Agent Correction into a System Improvement
    47. 47Define the Outcome Before You Choose the Output
    48. 48Discover the Workflow People Actually Perform
    49. 49Map Assumptions and Resolve the Riskiest One First
    50. 50Choose the Smallest Slice That Can Change the Decision
    51. 51Write Specifications That Preserve Judgment
    52. 52Design Success Metrics Before the Result Exists
    53. 53Choose Prototype, Pilot, or Production Deliberately
    54. 54Build a Feedback Ratchet with Ownership and Retirement
    Open the phase: Agent Engineering
  16. Autonomous Systems0/22 22 lessons
  17. Multi-Agent & Swarms0/25 25 lessons
  18. Infrastructure & Production0/29 29 lessons

    For owners. Keeping an AI build fast, affordable and watched once it is live.

    1. 01Managed LLM Platforms — Bedrock, Vertex AI, Azure OpenAI
    2. 02Inference Platform Economics — Fireworks, Together, Baseten, Modal, Replicate, Anyscale
    3. 03GPU Autoscaling on Kubernetes — Karpenter, KAI Scheduler, Gang Scheduling
    4. 04Serving Engine Internals — PagedAttention, Continuous Batching, Chunked Prefill
    5. 05EAGLE-3 Speculative Decoding in Production
    6. 06Prefix-Cache Serving — RadixAttention and KV Reuse
    7. 07Hardware-Specialized Inference Compilation — FP8 and NVFP4 on Blackwell
    8. 08Inference Metrics — TTFT, TPOT, ITL, Goodput, P99
    9. 09Production Quantization — AWQ, GPTQ, GGUF K-quants, FP8, MXFP4/NVFP4
    10. 10Cold Start Mitigation for Serverless LLMs
    11. 11Multi-Region LLM Serving and KV Cache Locality
    12. 12Edge Inference — Apple Neural Engine, Qualcomm Hexagon, WebGPU/WebLLM, Jetson
    13. 13LLM Observability Stack Selection
    14. 14Prompt Caching and Semantic Caching Economics
    15. 15Batch APIs — the 50% Discount as Industry Standard
    16. 16Model Routing as a Cost-Reduction Primitive
    17. 17Disaggregated Prefill/Decode — NVIDIA Dynamo and llm-d
    18. 18Production Serving Stack — KV Offloading and Cache-Aware Routing
    19. 19AI Gateways — LiteLLM, Portkey, Kong AI Gateway, Bifrost
    20. 20Shadow Traffic, Canary Rollout, and Progressive Deployment for LLMs
    21. 21A/B Testing LLM Features — GrowthBook, Statsig, and the Vibes Problem
    22. 22Load Testing LLM APIs — Why k6 and Locust Lie
    23. 23SRE for AI — Multi-Agent Incident Response, Runbooks, Predictive Detection
    24. 24Chaos Engineering for LLM Production
    25. 25Security — Secrets, API Key Rotation, Audit Logs, Guardrails
    26. 26Compliance — SOC 2, HIPAA, GDPR, PCI-DSS, EU AI Act, ISO 42001
    27. 27FinOps for LLMs — Unit Economics and Multi-Tenant Attribution
    28. 28Self-Hosted Serving Selection — Matching Engine to Hardware and Scale
    29. 29Model Demo Interfaces — From a Function to a Shareable App
    Open the phase: Infrastructure & Production
  19. Ethics, Safety & Alignment0/30 30 lessons
  20. Capstone Projects0/85 85 lessons

    For owners. Full projects that pull the course together. A good test for an engineer you plan to hire.

    1. 01Capstone 01 — Terminal-Native Coding Agent
    2. 02Capstone 02 — RAG over Codebase (Cross-Repo Semantic Search)
    3. 03Capstone 03 — Real-Time Voice Assistant (ASR to LLM to TTS)
    4. 04Capstone 04 — Multimodal Document QA (Vision-First PDF, Tables, Charts)
    5. 05Capstone 05 — Autonomous Research Agent (AI-Scientist Class)
    6. 06Capstone 06 — DevOps Troubleshooting Agent for Kubernetes
    7. 07Capstone 07 — End-to-End Fine-Tuning Pipeline (Data to SFT to DPO to Serve)
    8. 08Capstone 08 — Production RAG Chatbot for a Regulated Vertical
    9. 09Capstone 09 — Code Migration Agent (Repo-Level Language / Runtime Upgrade)
    10. 10Capstone 10 — Multi-Agent Software Engineering Team
    11. 11Capstone 11 — LLM Observability & Eval Dashboard
    12. 12Capstone 12 — Video Understanding Pipeline (Scene, QA, Search)
    13. 13Capstone 13: Stateless MCP Server with Registry and Governance
    14. 14Capstone 14 — Speculative-Decoding Inference Server
    15. 15Capstone 15 — Constitutional Safety Harness + Red-Team Range
    16. 16Capstone 16 — GitHub Issue-to-PR Autonomous Agent
    17. 17Capstone 17 — Personal AI Tutor (Adaptive, Multimodal, with Memory)
    18. 18Agent Harness Loop Contract
    19. 19Tool Registry with Schema Validation
    20. 20JSON-RPC 2.0 Over Newline-Delimited Stdio
    21. 21Function Call Dispatcher
    22. 22Plan-Execute Control Flow
    23. 23Capstone Lesson 25: Verification Gates and the Observation Budget
    24. 24Capstone Lesson 26: Sandbox Runner with Denylist and Path Jail
    25. 25Capstone Lesson 27: Eval Harness with Fixture Tasks
    26. 26Capstone Lesson 28: Observability with OTel GenAI Spans and Prometheus Metrics
    27. 27Capstone Lesson 29: End-to-End Coding Agent on the Harness
    28. 28BPE Tokenizer From Scratch
    29. 29Tokenized Dataset with Sliding Window
    30. 30Token and Positional Embeddings
    31. 31Multi-Head Self-Attention
    32. 32Transformer Block from Scratch
    33. 33GPT Model Assembly
    34. 34Training Loop and Evaluation
    35. 35Loading Pretrained Weights
    36. 36Capstone Lesson 38: Classifier Fine-Tuning by Head Swap
    37. 37Capstone Lesson 39: Instruction Tuning by Supervised Fine-Tuning
    38. 38Capstone Lesson 40: Direct Preference Optimization from Scratch
    39. 39Capstone Lesson 41: Full Evaluation Pipeline
    40. 40Large Corpus Downloader
    41. 41HDF5 Tokenized Corpus
    42. 42Cosine LR with Linear Warmup
    43. 43Gradient Clipping and Mixed Precision
    44. 44Gradient Accumulation
    45. 45Checkpoint Save and Resume
    46. 46Distributed Data Parallel and FSDP from Scratch
    47. 47Language Model Evaluation Harness
    48. 48Hypothesis Generator
    49. 49Literature Retrieval
    50. 50Experiment Runner
    51. 51Result Evaluator
    52. 52Paper Writer
    53. 53Critic Loop
    54. 54Iteration Scheduler
    55. 55End-to-End Research Demo
    56. 56Vision Encoder Patches
    57. 57Vision Transformer Encoder
    58. 58Projection Layer for Modality Alignment
    59. 59Cross-Attention Fusion
    60. 60Vision-Language Pretraining
    61. 61Multimodal Evaluation
    62. 62Chunking Strategies, Compared
    63. 63Hybrid Retrieval with BM25 and Dense Embeddings
    64. 64Cross-Encoder Reranker
    65. 65Query Rewriting: HyDE, Multi-Query, and Decomposition
    66. 66RAG Evaluation: Precision, Recall, MRR, nDCG, Faithfulness, Answer Relevance
    67. 67End-to-End RAG System
    68. 68Task Spec Format
    69. 69Classical Metrics
    70. 70Code Exec Metric
    71. 71Perplexity and Calibration
    72. 72Leaderboard Aggregation
    73. 73End-to-End Eval Runner
    74. 74Collective Ops From Scratch
    75. 75Data Parallel DDP From Scratch
    76. 76ZeRO Optimizer State Sharding
    77. 77Pipeline Parallel and Bubble Analysis
    78. 78Sharded Checkpoint and Atomic Resume
    79. 79End-to-End Distributed Training
    80. 80Capstone 82 — Jailbreak Taxonomy
    81. 81Capstone 83 — Prompt Injection Detector
    82. 82Capstone 84 — Refusal Evaluation
    83. 83Capstone 85 — Content Classifier Integration
    84. 84Capstone 86 — Constitutional Rules Engine
    85. 85Capstone 87 — End-to-End Safety Gate
    Open the phase: Capstone Projects

Lessons from AI Engineering from Scratch by Rohit Ghumare and contributors, MIT license. Notes for owners by Lozo. License

Next step

Rather have it built for you?

Reading is optional. Tell me what's stuck and I'll build it into the business you already run.

  • A real conversation, not a pitch
  • You keep your accounts
  • Nothing sends without your yes