AI Engineering from Scratch: 542 lessons, failing project starters and a full PyTorch install
Learn it. Build it. Ship it for others.
At a glance
- What is it?
- rohitg00/ai-engineering-from-scratch is a free, MIT-licensed curriculum of 542 lessons in 20 phases that asks you to implement model internals, retrieval pipelines and agent runtimes yourself. It rewards people who will run local code and graders, and it costs a heavy Python environment and a curriculum that changes every few days.
- Who is it for?
- AI Engineering from Scratch suits learners who want to write and test the code behind models, retrieval and agents, and who can run Python 3.10+ with PyTorch, transformers and audio libraries locally. It suits poorly anyone looking for a short course or a single fixed textbook, since the material spans 542 lessons and ships a new dated edition every few days.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- rohitg00/ai-engineering-from-scratch79,041 ★ · +31,947
| Repository | 2026-08-18 | 2026-11-15 |
|---|---|---|
| rohitg00/ai-engineering-from-scratch | 47.1k | 79k |
31,947 Stars in the last 89 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
542 lessons in 20 phases, entered through one of three routes
The curriculum is large: 542 lessons arranged in 20 phases, with code in Python, TypeScript, Rust and Julia. The stated aim is practical: implement model internals, retrieval pipelines and agent runtimes, test them, inspect the failures, and keep both the code and the evaluation results. Because nobody works through 542 lessons in order on a whim, the entry point is one of three routes. Model foundations starts at phase 00, Setup and tooling, with the dev environment lesson. LLM systems starts at phase 11, LLM engineering, with prompt engineering. Agents and delivery starts at phase 14, Agent engineering, with the agent loop. The consequence of skipping ahead is real: a learner who starts at the agent loop has jumped past the math foundations and ML fundamentals phases that later lessons and projects link back to, such as model evaluation in phase 02. The site offers a page that compares career paths and a study guide covering prerequisites and study time, and those are the place to decide how far back to start.
Project starters fail on purpose until you implement each stage
Three projects ship with staged starters, reference implementations and local graders. Commands run from the repository root after local setup, and the starters fail until you implement the stages. The first, Retrieval Evaluation Lab, is in Python and needs Python 3.10 or newer. Its setup is a scenario taken from real retrieval work: a candidate system improves mean NDCG, yet one query now ranks its most relevant evidence lower. Your job is to build a query-by-query comparison that reports that regression and can fail a release check. The stages run in order: ranking validation, precision and recall, rank-sensitive metrics, then system comparison. Before starting, the project points you to the RAG lesson in phase 11 and the model evaluation lesson in phase 02. Initializing the project looks like this:
python3 scripts/project_test.py retrieval-evaluation-lab \
--init learning-artifacts/retrieval-evaluation-labThe failing starters are the point of the design. A grader that goes red until each stage is done gives you an objective signal of progress, but it also means there is no partial credit for reading: if you only want to skim the ideas, the projects will not reward you.
requirements.txt installs the full deep learning and audio stack
Running lessons locally means installing requirements.txt, and it is not small. It pulls torch>=2.0, torchvision>=0.15 and torchaudio>=2.0, the Hugging Face set of transformers>=4.30, datasets>=2.14, tokenizers>=0.13 and accelerate>=0.20, plus numpy, pandas, scikit-learn, matplotlib, jupyter and pillow. Audio work adds librosa>=0.10 and soundfile>=0.12, and tokenization adds tiktoken>=0.5. Two hosted model SDKs are on the list as well: anthropic>=0.25 and openai>=1.0. Every entry is a minimum version with no upper bound, so a fresh install today resolves to whatever is newest for each package rather than the versions a given lesson was written against. For a learner, that has two consequences. The first install is a large download, especially the PyTorch packages. And if a lesson breaks after an upstream release, the file gives you no pinned set to fall back to, so you have to pin versions yourself. Learners who only want the reading, or who learn on the website, can skip this install entirely.
The website, a coding agent or local code: three ways to study the same lessons
The project offers three ways to work through the material: on the website at aiengineeringfromscratch.com, with a coding agent, or by running local code. Lesson links on the site are addressed by repository path, for example lesson?path=phases/14-agent-engineering/01-the-agent-loop, which keeps the website and the repository in step. The agent route has its own files in the repository: a .claude/ directory, an AGENTS.md at the root and a skills/ folder sit next to the phases. The website is built with Node, and package.json declares Node >=20 with shiki 4.5.0 and its language and theme packages for code highlighting and pagefind 1.5.2 for search. That package is marked private and exists only to build the site, so a learner running Python lessons does not need Node at all. Beyond lessons, the root also holds cheatsheets/, glossary/, interviews/, certifications/, practice/ and book/ directories.
The gradient descent lab shows twenty runs at once
The interactive lab featured on the front page is a gradient descent visualization from phase 01, Math foundations, lesson 08 on optimization. Twenty starting points follow gradient descent on a quadratic loss, and the graph shows their positions and the mean loss after each update. On the website you can adjust the learning rate and watch how the twenty runs respond. The same lesson has a code file, phases/01-math-foundations/08-optimization/code/optimizers.py, that compares plain gradient descent, momentum and Adam. The pairing is typical of how the curriculum is meant to work: see the behavior in the browser, then read and run the code that produces it. Its limit is that a quadratic loss is the friendliest possible surface, with a single minimum, so the lab demonstrates learning rate effects clearly but says nothing on its own about the noisy, non-convex losses you meet when training real networks later in the curriculum.
Dated editions land every few days, so the curriculum keeps moving
Releases are named as editions with dates rather than semantic versions. Edition 2026.10.3 shipped on 2026-10-15. Edition 2026.10.4 followed on 2026-10-19 with highlights, cheat sheets and SGLang material. Edition 2026.10.5 arrived on 2026-10-29 with a lesson screen, vLLM 101 and Miles 101. The last push to main was on 2026-11-02, and the repository carries a CHANGELOG.md and a ROADMAP.md. For learners, three edition tags in two weeks means the lesson you bookmarked may change underneath you, and new topics such as serving engines arrive mid-course. Noting the edition tag you started from makes it possible to diff what changed later. For anyone building on the material, FORKING.md and LESSON_TEMPLATE.md sit at the root, and the whole project is MIT-licensed.
The README is translated into 33 languages, alongside the English original
A collapsible block in the README links translations into 33 languages besides English, including Simplified Chinese, Traditional Chinese (Taiwan), Japanese, Korean, both Portuguese variants, Spanish, German, French, Russian, Ukrainian, Arabic, Persian, Hindi, Bengali, Urdu, Thai, Vietnamese, Indonesian and Tagalog. These live under i18n/ with one README.md per language, and the root also has a languages.json. What these links translate is the README; the lesson links in it, and the project instructions such as the Retrieval Evaluation Lab, point to English lesson docs under paths like phases/11-llm-engineering/06-rag/docs/en.md. A reader who needs the full lessons in another language should check that language's folder before choosing a route rather than assuming that a translated README means a translated curriculum. The project is funded by sponsors, with SerpApi listed, and states that this support keeps every lesson free and open source.
Editorial conclusion
AI Engineering from Scratch suits learners who want to write and test the code behind models, retrieval and agents, and who can run Python 3.10+ with PyTorch, transformers and audio libraries locally. It suits poorly anyone looking for a short course or a single fixed textbook, since the material spans 542 lessons and ships a new dated edition every few days. Before committing, pick one of the three routes, check that the project starters and graders run on your machine, and note which edition tag you started from.
Frequently asked questions
How to be an AI engineer from scratch with AI Engineering from Scratch?
Pick one of its three routes: Model foundations from phase 00 setup, LLM systems from phase 11 prompt engineering, or Agents and delivery from phase 14 the agent loop. Then work through the lessons and the three projects, whose starters fail until you implement each stage.
Is AI Engineering from Scratch good?
It is a free MIT curriculum of 542 lessons in 20 phases built around implementing and testing code, with local graders for its projects. It suits learners willing to run a full PyTorch environment and keep up with frequent dated editions.
Is AI Engineering from Scratch free?
Yes. The curriculum is free and open source under the MIT license, and it can be studied on aiengineeringfromscratch.com, with a coding agent, or by running the code locally.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/rohitg00-ai-engineering-from-scratch)Star history chart for your README
[](https://hysenlabs.com/projects/rohitg00-ai-engineering-from-scratch)Was this useful?