AI Engineering From Scratch: Free Open-Source Course

Published · AI Daily — AI-assisted deep research, methodology & disclosure

ai-engineering-from-scratch is a free, MIT-licensed open-source AI engineering course with 542 lessons across 20 phases, covering Python, TypeScript, Rust and Julia. It goes beyond concepts: learners build model internals, retrieval pipelines and agent runtimes by hand, then test them, inspect failures and keep the code and evaluation results. Three learning paths are offered: model foundations, LLM systems, and agents and delivery. It also includes an interactive gradient descent lab and hands-on projects with staged starter code and a local grader, such as a retrieval evaluation lab. You can learn on the website, pair it with a coding agent, or run the code locally. It suits developers who want to fill gaps in AI engineering skills, and teams that need to practice evaluation and regression checks.

Background and Context

Most AI engineering learning material falls into two groups. One group explains theory in papers and textbooks. The other gives quick tutorials that call a ready-made API. Readers of the first group often cannot ship a working system. Readers of the second often cannot explain why their system fails. ai-engineering-from-scratch targets the gap between the two.

The project describes its goal plainly: implement model internals, retrieval pipelines and agent runtimes, then test them, inspect the failures, and keep the code and the evaluation results. Its motto is to learn it, build it, and ship it to others. It is not a framework or a model. It is a full course repository, free to use under the MIT license. According to the source, it has more than 70,000 stars on GitHub, which suggests many learners value a from-scratch path.

The scale is the most visible feature. The repository lists 542 lessons in 20 phases, with code in Python, TypeScript, Rust and Julia. The phases start with environment setup and tooling. They move through math foundations and machine learning basics, then reach LLM engineering and agent engineering. Documentation entry points exist in more than thirty languages, including Simplified and Traditional Chinese, Japanese, Korean, Spanish, German and Arabic. That is unusually wide coverage for a course of this kind.

Deep Analysis

What is ai-engineering-from-scratch, and how does it teach AI engineering? It is a free, MIT-licensed open-source course of 542 lessons across 20 phases. Learners build the parts of an AI system by hand, then test them and keep the evaluation results. The course does not stop at explanation. It asks for working code and recorded evidence. The course offers three starting routes. Learners who want solid model foundations begin with development environment setup. Learners who want to build LLM systems begin with prompt engineering. Learners who want to build agents and delivery pipelines begin with the agent loop. This lets people with different backgrounds enter at a useful point instead of reading 542 lessons in order. The math lessons use interaction rather than formulas alone. The optimization lesson includes a gradient descent visualization. Twenty starting points descend a quadratic loss surface, and the page shows their positions and the average loss after each update. Learners can change the learning rate and watch the effect. In code, they can compare gradient descent, momentum and Adam. This approach, which shows the behavior first and then the implementation, helps build intuition. The hands-on projects show the course attitude best. The repository offers three projects. Each has staged starter code, a reference implementation and a local grader. The starter code is designed to fail until the learner implements each stage. The first project, the retrieval evaluation lab, uses a realistic scenario. A new retrieval system raises mean NDCG, yet one query now ranks its most relevant evidence lower. The task is to write a per-query comparison, report the regression, and make a release check able to block that version.

The project needs Python 3.10 or newer. The source suggests reviewing the RAG and model evaluation lessons first. Learners then implement ranking validation, precision and recall, and rank-sensitive metrics, and finish with a system comparison. They initialize the project directory with scripts/project_test.py plus the project name, then check results by stage or in full with a strict mode. The required output is a reproducible comparison with per-query deltas and the judgments used for scoring. The source also reminds learners that a metric only describes those judgments. There are three ways to learn. Learners can follow the course path on the website. They can pair the material with a coding agent that reads and edits alongside them. They can also clone the repository and run the code locally.

Industry Impact

Once AI applications reach production, teams often lack more than another API example. They lack people who can take a system apart, locate a regression, and write a check that catches it. This course puts evaluation, failure inspection and result retention in the main learning line. That matches the retrieval evaluation lab, where an average metric improves while one important query gets worse.

For individual developers, the course offers a systematic way to fill gaps. A developer who has only called hosted models can learn what happens inside a model, a retrieval pipeline or an agent loop. For teams, the projects work as practice for evaluation and regression checks. The local grader means a team can run the exercises without a hosted service. The multi-language documentation and four code languages also widen the audience. Rust and Julia lessons sit beside Python and TypeScript, so learners from systems or scientific computing backgrounds are not left out. The risks are clear. The course is large, and learners may drop out without a plan for their own pace. Maintaining many documentation languages and four code languages is a long-term burden. Whether translations and examples stay current with new changes is worth watching. The project relies on sponsorship to stay free, so its sustainability depends on community support. The repository introduction also shows only part of the content, so real lesson quality can only be judged by trying it.

Outlook

Several signals deserve attention. One is how many hands-on projects the course adds beyond the current three. Another is whether the local grader can cover more agent scenarios, since agent runtimes are harder to score than ranking metrics. A third is whether the community forms steady contribution and discussion around the lessons.

For developers who want a systematic start or a refresher, the cost of testing the course is low. Pick one of the three routes and study a few lessons. Then try one project, such as the retrieval evaluation lab, and see whether the staged starter code and the local grader fit your learning style. A learner who finishes that project will have a reproducible comparison with per-query deltas, which is useful evidence of evaluation skill.

Sources

FAQ

What is ai-engineering-from-scratch?

ai-engineering-from-scratch is a free, MIT-licensed open-source AI engineering course with 542 lessons across 20 phases, covering Python, TypeScript, Rust and Julia. Learners build model internals, retrieval pipelines and agent runtimes by hand, then test them, inspect failures and keep the code and evaluation results.

Why does the ai-engineering-from-scratch course matter?

The ai-engineering-from-scratch course matters because teams running AI in production often lack people who can take a system apart, locate a regression and write a regression check. The course puts evaluation, failure inspection and result keeping at the center of its lessons, which helps individuals and teams build engineering discipline.

What should learners watch before starting ai-engineering-from-scratch?

For ai-engineering-from-scratch, watch three risks: the course is large, so learners may drop out without a pacing plan; translations and multi-language code need ongoing upkeep; and free access depends on sponsors. A low-cost next step is to pick one learning path, study a few lessons, then try one hands-on project.