Repo Frameworks

rohitg00/ai-engineering-from-scratch

Free MIT-licensed curriculum of 523 lessons across 20 phases for building AI systems from scratch in Python, TypeScript, Rust and Julia, with projects, labs and an AI tutor.

  • 66.2k GitHub stars
  • Python
  • ⚖️ MIT
  • 🎯 Intermediate
npx skills add rohitg00/ai-engineering-from-scratch
rohitg00/ai-engineering-from-scratch preview image

What it is

AI Engineering from Scratch is an open-source curriculum of 523 lessons in 20 phases, covering math foundations through agents, infrastructure and capstone projects. You implement model internals, retrieval pipelines and agent runtimes, then test them, inspect failures and keep the code and evaluation results. It can be followed on the website, with a skill-capable coding agent acting as tutor, or by running local code.

Who it's for

  • Developers who can write code and want to understand how AI actually works, not just call APIs
  • Beginners who want a complete foundation, starting from Phase 0 setup
  • Engineers who know ML or deep learning and want to go on to LLMs and agents
  • Senior engineers who want only agent engineering, MCP systems or Agent Skills

Requirements

Requirements

  • Ability to write code in any language (Python helps)
  • Python 3.10+ for the Retrieval Evaluation Lab and Tool Call Firewall projects
  • Node.js 22.18+ and Python 3 for the Agent Trace Debugger project
  • Rust for the Tool Call Firewall project
  • Node.js, npx, python3 and a skill-capable coding agent for the AI tutor route

Setup

  1. Install the AI tutor skills

    If Node.js, npx and a skill-capable coding agent are installed, install the skills and choose the host and scope when the installer asks.

    bash
    npx skills add rohitg00/ai-engineering-from-scratch
  2. Clone the repo and run local code

    Clone the repository, run the beginner preflight, then run the first dependency-free lesson. Run commands from the repository root.

    bash
    git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
    cd ai-engineering-from-scratch
    python3 phases/00-setup-and-tooling/01-dev-environment/code/verify.py --route beginner
    python3 phases/01-math-foundations/01-linear-algebra-intuition/code/vectors.py
  3. Check tutor requirements

    Check the local requirements before using the tutor.

    bash
    node --version
    npx --version
    python3 --version

Examples

Initialize the Retrieval Evaluation Lab

bash
bash
python3 scripts/project_test.py retrieval-evaluation-lab \
  --init learning-artifacts/retrieval-evaluation-lab

What it does: Creates the staged starter for the Python project on ranking metrics and regression checks. Starters fail until you implement the stages.

Grade one project stage strictly

Prompt
prompt
python3 scripts/project_test.py agent-trace-debugger \
  --stage 1 --path learning-artifacts/agent-trace-debugger --strict

Expected output: Runs the local grader for stage 1 of the TypeScript Agent Trace Debugger project against your starter in learning-artifacts.

Grade all stages of the Tool Call Firewall

bash
bash
python3 scripts/project_test.py tool-call-firewall \
  --all --path learning-artifacts/tool-call-firewall --strict

What it does: Checks every stage of the Rust project on role checks and single-use approval receipts.

Start the course with an AI tutor

Prompt
prompt
Use start-learning to begin the course.

Expected output: Invocation for hosts other than Codex and Claude Code. It runs onboarding and a placement quiz, then saves a plan to LEARNING.md.

Pros & cons

Pros

  • Pro:Free and MIT-licensed, with lessons available on the website, through a coding-agent tutor, or as local code
  • Pro:Hands-on projects with staged starters, reference implementations and local graders
  • Pro:Several entry points by background, plus focused MCP and Agent Skills paths with time estimates
  • Pro:Lessons ask you to keep evidence such as commands, exit codes, output and artifacts

Cons

  • Con:Very large scope (523 lessons, up to roughly 306 hours from the beginning), which needs a long time commitment
  • Con:The AI tutor route needs Node.js, npx, python3, a skill-capable host and a writable skill scope
  • Con:Projects use different toolchains (Python, Node.js 22.18+, Rust), so full coverage means setting up several environments

Images