rohitg00 / ai-engineering-from-scratch

rohitg00 / ai-engineering-from-scratch

84% of students already use AI tools. Only 18% feel prepared to use them professionally. This curriculum closes that gap. 435 lessons. 20 phases. ~320 hours. Python, TypeScript, Rust, Julia. Every lesson ships a reusable artifact: a prompt, a skill, an agent, an MCP server. Free, open source, MIT. You don’t just learn AI. You build it. End-to-end. By hand.

84% 的学生已经在日常学习中使用 AI 工具,但仅有 18% 的人认为自己具备了专业应用这些工具的能力。本课程旨在填补这一鸿沟。课程包含 435 节课、20 个阶段,总计约 320 小时。涵盖 Python、TypeScript、Rust 和 Julia 四种语言。每一节课都会产出一个可复用的成果:一个提示词(Prompt)、一项技能(Skill)、一个智能体(Agent)或一个 MCP 服务器。课程完全免费、开源,采用 MIT 协议。你不仅是在学习 AI,而是在从零开始,亲手构建它。

How this works

Most AI material teaches in scattered pieces. A paper here, a fine-tuning post there, a flashy agent demo somewhere else. The pieces rarely line up. You ship a chatbot but can’t explain its loss curve. You hook a function to an agent but can’t say what attention does inside the model that’s calling it. This curriculum is the spine. 20 phases, 435 lessons, four languages: Python, TypeScript, Rust, Julia. Linear algebra at one end, autonomous swarms at the other. Every algorithm gets built from raw math first. Backprop. Tokenizer. Attention. Agent loop. By the time PyTorch shows up, you already know what it’s doing under the hood. Each lesson runs the same loop: read the problem, derive the math, write the code, run the test, keep the artifact. No five-minute videos, no copy-paste deploys, no hand-holding. Free, open source, and built to run on your own laptop.

课程运作方式

市面上大多数 AI 资料都是零散的:这里一篇论文,那里一篇微调教程,或者某个炫酷的智能体演示。这些碎片往往无法串联起来。你可能做出了一个聊天机器人,却无法解释它的损失曲线;你可能为智能体挂载了一个函数,却说不清模型内部的注意力机制是如何运作的。本课程就是你的“脊梁”。20 个阶段、435 节课,涵盖 Python、TypeScript、Rust 和 Julia。从线性代数开始,到自主智能体集群结束。每一个算法都先从原始数学推导开始构建:反向传播、分词器、注意力机制、智能体循环。当你最终接触 PyTorch 时,你早已洞悉其底层逻辑。每一节课都遵循相同的循环:阅读问题、推导数学、编写代码、运行测试、保留成果。没有五分钟的短视频,没有复制粘贴式的部署,也没有保姆式的教学。课程完全免费、开源,且专为在你的个人电脑上运行而设计。

The shape of the curriculum

Twenty phases stack on top of each other. Math is the floor. Agents and production are the roof. Skip ahead if you already know the lower layers, but don’t skip and then wonder why something at the top is breaking.

课程架构

20 个阶段层层递进。数学是地基,智能体与生产环境应用是顶层。如果你已经掌握了基础层,可以跳过,但请不要在跳过之后又困惑于顶层为何报错。

(Flowchart omitted for brevity)

The shape of a lesson

Each lesson lives in its own folder, with the same structure across the entire curriculum: phases/<NN>-<phase-name>/<NN>-<lesson-name>/ ├── code/ runnable implementations (Python, TypeScript, Rust, Julia) ├── docs/ │ └── en.md lesson narrative └── outputs/ prompts, skills, agents, or MCP servers this lesson produces

Every lesson follows six beats. The Build It / Use It split is the spine — you implement the algorithm from scratch first, then run the same thing through the production library. You understand what the framework is doing because you wrote the smaller version yourself.

课程结构

每一节课都有独立的文件夹,且在整个课程中保持统一结构: phases/<NN>-<phase-name>/<NN>-<lesson-name>/ ├── code/ 可运行的实现(Python, TypeScript, Rust, Julia) ├── docs/ │ └── en.md 课程讲解 └── outputs/ 本节课产出的提示词、技能、智能体或 MCP 服务器

每一节课都遵循六个步骤。其中的“构建(Build It)/ 使用(Use It)”拆分是核心——你先从零实现算法,然后再通过生产级库运行相同的功能。因为你自己写过简化版本,所以你完全理解框架在底层做了什么。

Getting started

Three ways in. Pick one.

  • Option A — read. Open any completed lesson on aiengineeringfromscratch.com or expand a phase under Contents. No setup, no cloning.
  • Option B — clone and run. git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
  • Option C — find your level (recommended). Skip ahead intelligently. Inside Claude, Cursor, Codex, OpenClaw, Hermes, or any agent with SkillKit installed: /find-your-level

如何开始

有三种方式,任选其一:

  • 选项 A — 阅读: 在 aiengineeringfromscratch.com 上打开任何已完成的课程,或在目录中展开某个阶段。无需配置,无需克隆。
  • 选项 B — 克隆并运行: git clone https://github.com/rohitg00/ai-engineering-from-scratch.git
  • 选项 C — 寻找你的水平(推荐): 智能跳级。在 Claude、Cursor、Codex、OpenClaw、Hermes 或任何安装了 SkillKit 的智能体中输入:/find-your-level

Prerequisites

You can write code (any language; Python helps). You want to understand how AI actually works, not just call APIs.

先决条件

你需要具备编程能力(任何语言皆可,Python 会更有帮助)。你需要有渴望理解 AI 底层原理的意愿,而不仅仅是调用 API。

Every lesson ships something

Other curricula end with “congratulations, you learned X.” Each lesson here ends with a reusable tool you can install or paste into your daily workflow.

每一节课都有产出

其他课程的结尾通常是“恭喜你,你学会了 X”。而这里的每一节课,结尾都是一个可复用的工具,你可以将其安装或粘贴到你的日常工作流中。