Favicon of AI Engineering From Scratch

AI Engineering From Scratch

Free, open-source AI engineering curriculum: 503 lessons across 20 phases, math to multi-agent systems, in Python, TypeScript, Rust, and Julia.

AI Engineering From Scratch website screenshot
AI Engineering From Scratch GitHub repository preview

AI Engineering from Scratch is a free, open-source curriculum for developers who want to understand how AI systems actually work rather than just call APIs against them. It's built for people who already write code and want a structured path from linear algebra through transformers, LLMs, and multi-agent systems, implementing the core algorithms themselves before switching to production libraries like PyTorch or sklearn.

The curriculum runs 20 phases and 503 lessons, roughly 320 hours of material, spanning Python, TypeScript, Rust, and Julia. Each lesson follows the same loop: read the problem, derive the math, write the code from scratch, run it against a real library, then produce a reusable artifact (a prompt, a skill, an agent, or an MCP server). Everything is MIT-licensed and designed to run on your own laptop.

Key features

  • Build It / Use It split: every lesson has you implement the algorithm from raw math first, then run the equivalent through PyTorch, sklearn, or another production library, so you know what the framework is doing internally.
  • Consistent lesson structure: each lesson folder has a code/ directory with runnable implementations, a docs/en.md narrative, and an outputs/ folder with the shipped artifact.
  • 20 phases, dependency-ordered: math foundations and ML fundamentals sit at the base; vision, NLP, transformers, LLMs, agents, multi-agent systems, and production infra build on top.
  • Shippable outputs per lesson: prompts, Claude/Cursor-style skills, agent implementations, and MCP servers, all usable outside the curriculum.
  • Multi-language coverage: Python for most lessons, with TypeScript, Rust, and Julia appearing where relevant (e.g., linear algebra in Julia, tooling in Rust).
  • Built-in placement and review skills: /find-your-level maps your existing knowledge to a starting phase, and /check-understanding <phase> quizzes you per phase, both usable inside Claude, Cursor, Codex, or similar agent tools.
  • No video, no copy-paste deploys: lessons are text-and-code based, meant to be worked through by writing and running code yourself.

Ideal use cases

This fits developers who already know how to code and want a rigorous, sequential path into AI engineering, starting from math and working up to autonomous agents and multi-agent systems. It's a good fit for self-taught engineers preparing for AI-focused roles, bootcamp grads wanting depth beyond API calls, or teams building internal training material and wanting a reference structure.

It's not a good fit if you want a quick intro to prompting or just need to call an LLM API for a weekend project. It also isn't a fit if you want video-based learning or guided GUI tooling; there's no hand-holding, no five-minute explainer videos, and progress depends on actually writing and running code. If you already have strong ML fundamentals and only want the agent/LLM-engineering phases, you can skip ahead, but the curriculum assumes you'll backfill gaps in earlier phases rather than treat it as pure reference documentation.

Installation

There are three ways to use the curriculum.

Read it directly on the companion site, no setup needed:

Visit aiengineeringfromscratch.com or browse the phase folders in the repo.

Clone and run lessons locally:

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

Use the built-in agent skills (inside Claude, Cursor, Codex, or another agent tool that reads SKILL.md files):

/find-your-level

This runs a ten-question placement quiz and generates a personalized path with hour estimates. After finishing a phase, check your understanding:

/check-understanding 3
ls phases/03-deep-learning-core/05-loss-functions/outputs/

To install all lesson skills at once:

python3 scripts/install_skills.py

Prerequisites are minimal: you should be able to write code in some language (Python helps most), and you should want to understand how AI works internally rather than only calling existing APIs.

Frequently asked questions

Share:

Stars
44.3K
Forks
7.5K
Last commit
2 days ago
Repository age
4 months
License
MIT
Self-hosted
No
Activity score
86/100
View Repository
Ad
Favicon

 

  
 

Similar to AI Engineering From Scratch

Favicon

 

  
 
Favicon

 

  
 
Favicon