ai-engineering-from-scratch
From linear algebra to autonomous agent swarms. learn AI with AI, then ship the tools.
🧭 Quick Navigation
🚀 Get Started · 🤖 AI-Native · 🗺️ The Journey · 🧰 Toolkit · 📚 Glossary · 🛣️ Roadmap · 🤝 Contribute · 🌐 Website
💬 "84% of students already use AI tools. Only 18% feel prepared to use them professionally.
This course closes that gap."
283+ lessons. 20 phases. ~320 hours. From linear algebra to autonomous agent swarms. Python, TypeScript, Rust, Julia. Every lesson produces something reusable: prompts, skills, agents, and MCP servers.
You don't just learn AI. You learn AI with AI. Then you build real things. Then you ship tools others can use.
🆚 Why This Course?
| 📺 Traditional Courses | 🧠 This Course |
|---|---|
| Scope One slice (NLP or Vision or Agents) |
Scope 🌍 Everything — math · ML · DL · NLP · vision · speech · transformers · LLMs · agents · swarms |
| Languages Python only |
Languages 🐍 Python · 🟦 TypeScript · 🦀 Rust · 🟣 Julia |
| Output "I learned something" |
Output 📦 A portfolio of tools, prompts, skills, and agents you can install |
| Depth Surface-level or theory-heavy |
Depth 🔬 Build from scratch first, then use frameworks |
| Format Videos you watch |
Format 💻 Runnable code + docs + web app + AI-powered quizzes |
| Style Passive consumption |
Style 🤖 AI-native — Claude Code skills test you as you go |
🤖 AI-Native Learning
This isn't a course you watch. It's a course you use with your AI coding agent.
🎯 Learn with AI, not just about AI
# 🧪 Find where to start based on what you already know
/find-your-level
# ✅ Quiz yourself after completing a phase
/check-understanding 3
# 📦 Every lesson produces a reusable artifact
ls phases/03-deep-learning-core/05-loss-functions/outputs/
# ├── prompt-loss-function-selector.md
# └── prompt-loss-debugger.md
🛠️ Built-in Claude Code Skills
🚢 Every Lesson Ships Something
Other courses end with "congratulations, you learned X." Our lessons end with a reusable tool:
|
📝 |
🎴 |
🤖 |
🔌 |
277-term searchable glossary. Full lesson catalog. ~306 hours of content with per-lesson time estimates.
🌐 Browse the website →
🗺️ The Journey
20 phases · 283+ lessons · click any phase to expand
Legend: hands-on implementation ·
concept + intuition
|
🟣 Phase 1 — Math Foundations 22 lessons The intuition behind every AI algorithm, through code.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | Linear Algebra Intuition | 🐍 🟣 | |
| 02 | Vectors, Matrices & Operations | 🐍 🟣 | |
| 03 | Matrix Transformations & Eigenvalues | 🐍 🟣 | |
| 04 | Calculus for ML: Derivatives & Gradients | 🐍 | |
| 05 | Chain Rule & Automatic Differentiation | 🐍 | |
| 06 | Probability & Distributions | 🐍 | |
| 07 | Bayes' Theorem & Statistical Thinking | 🐍 | |
| 08 | Optimization: Gradient Descent Family | 🐍 | |
| 09 | Information Theory: Entropy, KL Divergence | 🐍 | |
| 10 | Dimensionality Reduction: PCA, t-SNE, UMAP | 🐍 | |
| 11 | Singular Value Decomposition | 🐍 🟣 | |
| 12 | Tensor Operations | 🐍 | |
| 13 | Numerical Stability | 🐍 | |
| 14 | Norms & Distances | 🐍 | |
| 15 | Statistics for ML | 🐍 | |
| 16 | Sampling Methods | 🐍 | |
| 17 | Linear Systems | 🐍 | |
| 18 | Convex Optimization | 🐍 | |
| 19 | Complex Numbers for AI | 🐍 | |
| 20 | The Fourier Transform | 🐍 | |
| 21 | Graph Theory for ML | 🐍 | |
| 22 | Stochastic Processes | 🐍 |
🔵 Phase 2 — ML Fundamentals 18 lessons Classical ML — still the backbone of most production AI.
🟢 Phase 3 — Deep Learning Core 13 lessons Neural networks from first principles. No frameworks until you build one.
🟠 Phase 4 — Computer Vision 28 lessons From pixels to understanding — image, video, 3D, VLMs, and world models.
🔴 Phase 5 — NLP: Foundations to Advanced 29 lessons Language is the interface to intelligence.
🟢 Phase 6 — Speech & Audio 17 lessons Hear, understand, speak.
🟢 Phase 7 — Transformers Deep Dive 14 lessons The architecture that changed everything.
💗 Phase 8 — Generative AI 14 lessons Create images, video, audio, 3D, and more.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | Generative Models: Taxonomy & History | 🐍 | |
| 02 | Autoencoders & VAE | 🐍 | |
| 03 | GANs: Generator vs Discriminator | 🐍 | |
| 04 | Conditional GANs & Pix2Pix | 🐍 | |
| 05 | StyleGAN | 🐍 | |
| 06 | Diffusion Models — DDPM from Scratch | 🐍 | |
| 07 | Latent Diffusion & Stable Diffusion | 🐍 | |
| 08 | ControlNet, LoRA & Conditioning | 🐍 | |
| 09 | Inpainting, Outpainting & Editing | 🐍 | |
| 10 | Video Generation | 🐍 | |
| 11 | Audio Generation | 🐍 | |
| 12 | 3D Generation | 🐍 | |
| 13 | Flow Matching & Rectified Flows | 🐍 | |
| 14 | Evaluation: FID, CLIP Score | 🐍 |
🟣 Phase 9 — Reinforcement Learning 12 lessons The foundation of RLHF and game-playing AI.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | MDPs, States, Actions & Rewards | 🐍 | |
| 02 | Dynamic Programming | 🐍 | |
| 03 | Monte Carlo Methods | 🐍 | |
| 04 | Q-Learning, SARSA | 🐍 | |
| 05 | Deep Q-Networks (DQN) | 🐍 | |
| 06 | Policy Gradients — REINFORCE | 🐍 | |
| 07 | Actor-Critic — A2C, A3C | 🐍 | |
| 08 | PPO | 🐍 | |
| 09 | Reward Modeling & RLHF | 🐍 | |
| 10 | Multi-Agent RL | 🐍 | |
| 11 | Sim-to-Real Transfer | 🐍 | |
| 12 | RL for Games | 🐍 |
🟧 Phase 10 — LLMs from Scratch 22 lessons Build, train, and understand large language models.
🟥 Phase 11 — LLM Engineering 15 lessons Put LLMs to work in production.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | Prompt Engineering: Techniques & Patterns | 🐍 | |
| 02 | Few-Shot, CoT, Tree-of-Thought | 🐍 | |
| 03 | Structured Outputs | 🐍 🟦 | |
| 04 | Embeddings & Vector Representations | 🐍 | |
| 05 | Context Engineering | 🐍 🟦 | |
| 06 | RAG: Retrieval-Augmented Generation | 🐍 🟦 | |
| 07 | Advanced RAG: Chunking, Reranking | 🐍 | |
| 08 | Fine-Tuning with LoRA & QLoRA | 🐍 | |
| 09 | Function Calling & Tool Use | 🐍 | |
| 10 | Evaluation & Testing | 🐍 | |
| 11 | Caching, Rate Limiting & Cost | 🐍 | |
| 12 | Guardrails & Safety | 🐍 | |
| 13 | Building a Production LLM App | 🐍 | |
| 14 | Model Context Protocol (MCP) | 🐍 | |
| 15 | Prompt Caching & Context Caching | 🐍 |
🟩 Phase 12 — Multimodal AI 25 lessons See, hear, read, and reason across modalities — from ViT patches to computer-use agents.
🟦 Phase 13 — Tools & Protocols 23 lessons The interfaces between AI and the real world.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | The Tool Interface | 🐍 | |
| 02 | Function Calling Deep Dive | 🐍 | |
| 03 | Parallel and Streaming Tool Calls | 🐍 | |
| 04 | Structured Output | 🐍 | |
| 05 | Tool Schema Design | 🐍 | |
| 06 | MCP Fundamentals | 🐍 | |
| 07 | Building an MCP Server | 🐍 | |
| 08 | Building an MCP Client | 🐍 | |
| 09 | MCP Transports | 🐍 | |
| 10 | MCP Resources and Prompts | 🐍 | |
| 11 | MCP Sampling | 🐍 | |
| 12 | MCP Roots and Elicitation | 🐍 | |
| 13 | MCP Async Tasks | 🐍 | |
| 14 | MCP Apps | 🐍 | |
| 15 | MCP Security I — Tool Poisoning | 🐍 | |
| 16 | MCP Security II — OAuth 2.1 | 🐍 | |
| 17 | MCP Gateways and Registries | 🐍 | |
| 18 | MCP Auth in Production — DCR + JWKS on iii | 🐍 | |
| 19 | A2A Protocol | 🐍 | |
| 20 | OpenTelemetry GenAI | 🐍 | |
| 21 | LLM Routing Layer | 🐍 | |
| 22 | Skills and Agent SDKs | 🐍 | |
| 23 | Capstone — Tool Ecosystem | 🐍 |
🟧 Phase 14 — Agent Engineering 30 lessons Build agents from first principles — loop, memory, planning, frameworks, benchmarks, production.
🟩 Phase 15 — Autonomous Systems 22 lessons Long-horizon agents, self-improvement, and the 2026 safety stack.
🟩 Phase 16 — Multi-Agent & Swarms 25 lessons Coordination, emergence, and collective intelligence.
⬛ Phase 17 — Infrastructure & Production 28 lessons Ship AI to the real world.
| # | Lesson | Type | Lang |
|---|---|---|---|
| 01 | Managed LLM Platforms — Bedrock, Azure OpenAI, Vertex AI | 🐍 | |
| 02 | Inference Platform Economics — Fireworks, Together, Baseten, Modal | 🐍 | |
| 03 | GPU Autoscaling on Kubernetes — Karpenter, KAI Scheduler | 🐍 | |
| 04 | vLLM Serving Internals — PagedAttention, Continuous Batching, Chunked Prefill | 🐍 | |
| 05 | EAGLE-3 Speculative Decoding in Production | 🐍 | |
| 06 | SGLang and RadixAttention for Prefix-Heavy Workloads | 🐍 | |
| 07 | TensorRT-LLM on Blackwell with FP8 and NVFP4 | 🐍 | |
| 08 | Inference Metrics — TTFT, TPOT, ITL, Goodput, P99 | 🐍 | |
| 09 | Production Quantization — AWQ, GPTQ, GGUF, FP8, NVFP4 | 🐍 | |
| 10 | Cold Start Mitigation for Serverless LLMs | 🐍 | |
| 11 | Multi-Region LLM Serving and KV Cache Locality | 🐍 | |
| 12 | Edge Inference — ANE, Hexagon, WebGPU, Jetson | 🐍 | |
| 13 | LLM Observability Stack Selection | 🐍 | |
| 14 | Prompt Caching and Semantic Caching Economics | 🐍 | |
| 15 | Batch APIs — the 50% Discount as Industry Standard | 🐍 | |
| 16 | Model Routing as a Cost-Reduction Primitive | 🐍 | |
| 17 | Disaggregated Prefill/Decode — NVIDIA Dynamo and llm-d | 🐍 | |
| 18 | vLLM Production Stack with LMCache KV Offloading | 🐍 | |
| 19 | AI Gateways — LiteLLM, Portkey, Kong, Bifrost | 🐍 | |
| 20 | Shadow, Canary, and Progressive Deployment | 🐍 | |
| 21 | A/B Testing LLM Features — GrowthBook and Statsig | 🐍 | |
| 22 | Load Testing LLM APIs — k6, LLMPerf, GenAI-Perf | 🐍 | |
| 23 | SRE for AI — Multi-Agent Incident Response | 🐍 | |
| 24 | Chaos Engineering for LLM Production | 🐍 | |
| 25 | Security — Secrets, PII Scrubbing, Audit Logs | 🐍 | |
| 26 | Compliance — SOC 2, HIPAA, GDPR, EU AI Act, ISO 42001 | 🐍 | |
| 27 | FinOps for LLMs — Unit Economics and Multi-Tenant Attribution | 🐍 | |
| 28 | Self-Hosted Serving Selection — llama.cpp, Ollama, TGI, vLLM, SGLang | 🐍 |
🟪 Phase 18 — Ethics, Safety & Alignment 30 lessons Build AI that helps humanity. Not optional.
🏆 Phase 19 — Capstone Projects 17 projects 2026 end-to-end shippable products, 20-40 hours each.
🧰 Course Output: The Toolkit
Other courses give you a certificate. This one gives you a toolkit.
Every lesson produces a reusable artifact — a prompt, skill, agent, or MCP server you can install and use immediately. By the end of the course you have:
outputs/
├── 📝 prompts/ Prompt templates for every AI task
├── 🎴 skills/ SKILL.md files for AI coding agents
├── 🤖 agents/ Agent definitions ready to deploy
└── 🔌 mcp-servers/ MCP servers you built during the course
💡 Install them with SkillKit. Plug them into Claude Code, Cursor, or any AI agent. These are real tools, not homework.
📐 How Each Lesson Works
phases/XX-phase-name/NN-lesson-name/
├── 💻 code/ Runnable implementations (Python, TS, Rust, Julia)
├── 📖 docs/
│ └── en.md Lesson documentation
└── 📦 outputs/ Prompts, skills, agents produced by this lesson
🔄 Every lesson follows 6 steps
| Step | What happens |
|---|---|
| 🎯 Motto | One-line core idea that sticks |
| ❓ Problem | A concrete scenario where not knowing this hurts |
| 🧠 Concept | Mermaid diagrams and intuition — no code yet |
| 🔨 Build It | Implement from scratch in pure Python. No frameworks. |
| ⚙️ Use It | Same thing with PyTorch, sklearn, or the real tool |
| 🚢 Ship It | The prompt, skill, or agent this lesson produces |
🔑 The Build It / Use It split is the key. You understand what the framework does because you built it yourself first.
🚀 Getting Started
🅰️ Option A — Just start reading
Pick any completed lesson from the website or expand any phase above.
🅱️ Option B — Clone and run
git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
cd ai-engineering-from-scratch
python phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py
🅲 Option C — Find your level (recommended) ⭐
If you already know some ML/DL, don't start from Phase 1. Use the built-in assessment:
# In Claude Code:
/find-your-level
This 10-question quiz maps your knowledge to a starting phase and builds a personalized path with hour estimates.
✅ Prerequisites
- You can write code (Python or any language)
- You want to understand how AI actually works, not just call APIs
👤 Who This Is For
| 🧑💻 You are... | 🚪 Start at... | ⏱️ Time to complete |
|---|---|---|
| 🌱 New to programming + AI | Phase 0 (Setup) | ~306 hours |
| 🐍 Know Python, new to ML | Phase 1 (Math) | ~270 hours |
| 📊 Know ML, new to DL | Phase 3 (Deep Learning) | ~200 hours |
| 🧠 Know DL, want LLMs/agents | Phase 10 (LLMs from Scratch) | ~100 hours |
| 🚀 Senior eng, want agents only | Phase 14 (Agent Engineering) | ~60 hours |
📰 Why This Matters Now
📈 The Industry Signal
|
📚 Foundational Papers Covered
|
🤝 Contributing
We welcome contributions of all kinds — new lessons, translations, fixes, and outputs.
| 📋 Want to... | 👉 Read |
|---|---|
| Contribute a lesson or fix | CONTRIBUTING.md |
| Fork for your team or school | FORKING.md |
| See the lesson template | LESSON_TEMPLATE.md |
| Track progress | ROADMAP.md |
| Code of conduct | CODE_OF_CONDUCT.md |
⭐ Star History
🌟 If this helped you, please star the repo! It keeps the project alive.
💚 Built with care by Rohit Ghumare and the community.
📜 MIT License — Use it however you want. Fork it. Teach it. Sell it. Ship it.
✨ From linear algebra to autonomous agent swarms — one lesson at a time. ✨
