rohitg00 /
ai-engineering-from-scratch
Free 20-phase course that teaches AI engineering by building each piece by hand
- 72.5k stars
- 10k stars since 3 Oct
- Python
- Updated today
- Beginner friendly
- Learning & resource lists
Many AI tutorials teach in scattered pieces: a paper, a fine-tuning post, an agent demo. This repo lays out one path through all of it. It has 20 phases that start with setup and math and end with agents, production infrastructure and capstone projects.
Each lesson sits in its own folder with runnable code, a written narrative (docs/en.md) and an outputs folder. The README describes a Build It / Use It split. You first write the algorithm from raw math, such as backprop, a tokenizer, attention or an agent loop. Then you run the same thing through a production library.
It also ships as agent skills. With npx and a skill-capable coding agent such as Claude Code or Codex, you can install a tutor that runs a placement quiz, saves a study plan to LEARNING.md and teaches one lesson per session. There are focused routes for MCP and Agent Skills, and the lessons are also on a website.
What it does
A full 20-phase curriculum
Phases cover setup, math, ML, deep learning, vision, NLP, speech, transformers, generative AI, LLMs, tools and protocols, agents, multi-agent systems, infrastructure, ethics and capstones.
Build It, then Use It
Algorithms are built from raw math first, then run through the production library, so you see what the framework does for you.
A reusable artifact per lesson
Each lesson produces something you can keep, such as a prompt, a skill, an agent or an MCP server.
Installable AI tutor
Installing the skills with npx adds a placement quiz, a personal plan in LEARNING.md, one-lesson-per-session teaching and phase quizzes.
Focused learning paths
Shorter routes cover MCP (17 lessons), Agent Skills (5 lessons), using coding agents, and certification prep.
What you could build
- Learn how backprop, tokenizers and attention work by writing them yourself.
- Follow a structured route from Python and math basics to building LLM applications.
- Build an agent loop and then an MCP server as part of the tools and agents phases.
- Write and ship Agent Skills by following the focused five-lesson path.
- Use a coding agent as a tutor that quizzes you and tracks your progress.
Get started
Clone the repo and run the setup check, then the first math lesson from the repository root. Save the terminal output as your first evidence. To add the tutor, install the skills with npx and choose your coding agent when asked.
git clone https://github.com/rohitg00/ai-engineering-from-scratch.gitcd ai-engineering-from-scratchpython3 phases/00-setup-and-tooling/01-dev-environment/code/verify.py --route beginnerCommands are copied from the project's README. Read it on GitHub for the full setup.
More in Learning & resource lists
LLMs-from-scratch
Code for the book that walks you through building a GPT-style model in PyTorch