Skip to content

Guide · Open source

How to use ai-engineering-from-scratch: clone, learn and build

Updated · written with AI from the project's own documentation and checked against our catalogue data

ai-engineering-from-scratch is a free, MIT-licensed course with 542 lessons across 20 phases. It covers math foundations, machine learning, LLM engineering and agent engineering, and its stated goal is to implement model internals, retrieval pipelines and agent runtimes, then test them. This guide shows you how to get the repository, choose a learning path and run the local projects so you can check your own work.

AI Engineering from Scratchrohitg00/ai-engineering-from-scratch · ★ 76.3k · MIT

Quick start

  1. 1Check your Python version. Confirm you have Python 3.10 or newer installed, since that is the listed prerequisite.
  2. 2Clone the repository. Run git clone https://github.com/rohitg00/ai-engineering-from-scratch to get the lessons and code locally.
  3. 3Choose a learning path. Pick model foundations, LLM systems or agents and delivery, and open its starting lesson on the companion website.
  4. 4Work through a lesson and its code. Read the lesson, then implement the matching code in the repository, such as the optimizer comparison file.
  5. 5Run a project grader. From the repository root, initialise a project and run the grader stage by stage to check your implementation.

What the course teaches and who it suits

The README describes the course as a way to implement model internals, retrieval pipelines and agent runtimes, test them, inspect failures and keep the code and evaluation results. Lessons are taught on a companion website, with a coding agent, or by running the local code in the repository.

It fits students who want to understand how LLMs, retrieval and agents work internally, and developers who prefer learning by writing code from scratch. It is a course, not a ready-made AI tool, so you will be building things rather than using a finished product.

  • Model foundations: starts at setup and tooling, then math and machine learning
  • LLM systems: starts at prompt engineering
  • Agents and delivery: starts at the agent loop

Install and clone the repository

The install method is clone-and-build, and the prerequisite listed is Python 3.10 or newer. The README points to lessons and project folders rather than a single installable package, so there is no one-line install.

Clone the repository with the command below. The README's setup steps are not part of the excerpt this guide is based on, so follow the setup section in the repository itself after cloning.

  • Check that your Python is 3.10 or newer before you start.
  • Expect to work from folders inside the repository, not from a package manager.
git clone https://github.com/rohitg00/ai-engineering-from-scratch

Pick a learning path

The README lists three routes. Each one names a starting lesson on the companion website. If you are new to the material, begin with the model foundations route, which starts with setup and tooling.

The README also links a comparison of career paths and a section on prerequisites and study time. The study guide section was not included in the excerpt used here, so check the repository for the full list of prerequisites.

  • Model foundations starts at the lesson 'Setup and tooling'.
  • LLM systems starts at 'Prompt engineering'.
  • Agents and delivery starts at 'The agent loop'.

Try the interactive gradient descent lab

The README includes a visual lab on gradient descent. Twenty starting points follow gradient descent on a quadratic loss, and the graph shows their positions and mean loss after each update. You can adjust the learning rate in the lesson.

There is also a code file that compares gradient descent, momentum and Adam, so you can read the optimizer code next to the visual.

  • Lesson: phases/01-math-foundations/08-optimization
  • Code: phases/01-math-foundations/08-optimization/code/optimizers.py

Run the local projects and graders

The README lists three projects with staged starters, reference implementations and local graders. Run the commands from the repository root after completing setup. The starters fail until you implement the stages, which is intended.

The first project, the Retrieval Evaluation Lab, asks you to build a query-by-query comparison that reports regressions. The commands below initialise the project folder, then test stage 1 and all stages.

  • Use Python 3.10 or newer.
  • Read the RAG and model evaluation lessons linked from the project before starting.
  • Keep the output: a reproducible comparison with per-query deltas and the judgments used to score them.
python3 scripts/project_test.py retrieval-evaluation-lab --init learning-artifacts/retrieval-evaluation-lab python3 scripts/project_test.py retrieval-evaluation-lab --stage 1 --path learning-artifacts/retrieval-evaluation-lab --strict python3 scripts/project_test.py retrieval-evaluation-lab --all --path learning-artifacts/retrieval-evaluation-lab --strict

What people use it for

  • Learning how gradient descent, momentum and Adam differ by running and modifying the optimizer code.
  • Building a retrieval evaluation tool that compares two systems query by query and flags regressions.
  • Writing your own model internals or agent runtime from scratch and checking it against the local graders.

Frequently asked questions

Is ai-engineering-from-scratch free?

Yes. The README describes it as free and open source under the MIT licence, and says you can learn on the website, with a coding agent, or by running the local code.

What do I need to install ai-engineering-from-scratch?

The install method is clone-and-build with Python 3.10 or newer. Clone the repository with git clone https://github.com/rohitg00/ai-engineering-from-scratch, then follow the setup steps in the repository.

Is this a single installable package?

No. The README points to lessons and project folders rather than one install command, so it is a course with code you run from the repository, not a package you install with pip.

Do I need to be an expert programmer to use it?

The README lists prerequisites only in part, and the study guide section was not included in the excerpt this guide uses. It is best suited to people already comfortable with Python, so check the repository's prerequisites before starting.

What are the alternatives to ai-engineering-from-scratch?

Comparable projects named in the source include fast.ai Practical Deep Learning, Karpathy's nanoGPT and Neural Networks: Zero to Hero, and the Hugging Face LLM Course. Pick one based on whether you want broad deep learning, a small GPT codebase or LLM-specific material.

How is this different from just using a ready-made AI tool?

A ready-made tool is for getting results quickly. This course asks you to implement model internals, retrieval pipelines and agent runtimes yourself, then test them and keep the evaluation results.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this course if you want to understand how LLMs, retrieval and agents work by writing the code yourself, and you are comfortable with Python 3.10 or newer. Pick a different resource if you want a quick, ready-made AI tool, or if you are a complete beginner to programming and need a gentler start.

Install options & downloads