📚 Open-source AI curriculum on GitHub

อยากเรียน AI Engineering ตั้งแต่ศูนย์?
มีหลักสูตรฟรีบน GitHub ให้เรียนเป็นเส้นทาง

รู้จัก AI Engineering from Scratch หลักสูตรแบบลงมือทำที่พาไปตั้งแต่การเตรียมเครื่องมือ คณิตศาสตร์และ Machine Learning ไปจนถึง LLM, MCP, AI Agent, Multi-Agent และการนำระบบขึ้น Production

523Lessons
20Phases
~342 ชม.เวลาเรียนรวมโดยประมาณ
4 ภาษาPython · TypeScript · Rust · Julia
FreeOpen Source · MIT License
Overview

หลักสูตรนี้คืออะไร?

AI Engineering from Scratch เป็น Repository ที่จัดเนื้อหา AI Engineering เป็นหลักสูตรขนาดใหญ่ ไม่ได้สอนเพียงวิธีเรียก API ของโมเดล แต่พยายามพาผู้เรียนเข้าใจตั้งแต่พื้นฐานว่าโมเดลทำงานอย่างไร แล้วค่อยต่อยอดไปสู่การสร้างแอปพลิเคชันและ Agent ที่ใช้งานจริงได้

แนวคิดสำคัญของหลักสูตรคือ “Learn it → Build it → Use it → Ship it” หรือเรียนแนวคิดให้เข้าใจ ลงมือสร้างกลไกสำคัญด้วยตัวเอง จากนั้นค่อยใช้ Library/Framework ที่ใช้ในงานจริง และจบบทด้วย Artifact ที่สามารถนำไปต่อยอดได้ เช่น Prompt, Skill, Agent หรือ MCP Server

จุดที่น่าสนใจ: คุณไม่จำเป็นต้องเรียนทั้ง 523 บทเรียงตั้งแต่ต้นถึงจบ เพราะ Repository มีเส้นทางเริ่มต้นตามเป้าหมาย เช่น อยากเรียนพื้นฐานทั้งหมด, อยากทำ LLM Application, อยากสร้าง Agent, อยากเรียน MCP หรืออยากทำ Agent Skills
Choose your route

ไม่รู้จะเริ่มตรงไหน? เลือกตาม “เป้าหมาย” ได้เลย

หน้า README ทำตารางให้ผู้เรียนเลือกเส้นทางตามสิ่งที่ต้องการสร้าง ทำให้คนที่มีพื้นฐานต่างกันไม่จำเป็นต้องเริ่มจากบทเดียวกันทั้งหมด

ตารางเลือกเส้นทางเรียน AI Engineering from Scratch ตามเป้าหมาย
ภาพจากหน้า README: เลือกเส้นทางตามเป้าหมาย เช่น Foundation, LLM Applications, Agents, MCP และ Agent Skills
🌱

มือใหม่ เริ่มจากพื้นฐานทั้งหมด

เริ่มที่ Phase 0 เพื่อเตรียม Environment, Git, API, Docker, Terminal และเครื่องมือที่ต้องใช้ตลอดหลักสูตร

🧮

มี Python แล้ว อยากเข้าใจ Math + ML

เริ่ม Phase 1 เพื่อปู Linear Algebra, Calculus, Probability, Optimization และ Statistics ก่อนเข้าสู่ ML

💬

อยากสร้าง LLM Application

สามารถกระโดดไป Phase 11: LLM Engineering เพื่อเรียน Prompt, Context, RAG, Tool Use, Evaluation และ Production App

🤖

อยากสร้าง AI Agent

เริ่ม Phase 14: Agent Engineering โดยตรง แล้วค่อยย้อนกลับไปบทที่เป็น Prerequisite เมื่อจำเป็น

🔌

อยากเรียน MCP

มีเส้นทางเฉพาะ Model Context Protocol ครอบคลุม Server/Client, Transport, Security, Registry และ Conformance

🧩

อยากสร้าง Agent Skills

มี Focused Agent Skills Route สำหรับเรื่อง Contract, Discovery, Invocation, Sandbox และการทดสอบก่อน Release

Learning Roadmap

Roadmap การเรียน — ไล่ตั้งแต่บทแรกไปจนสร้าง AI System ได้จริง

ถ้าเลือกเส้นทางแบบ เริ่มตั้งแต่ศูนย์ หลักสูตรจะค่อย ๆ พาเราเดินจากการเตรียมเครื่องมือ → เข้าใจคณิตศาสตร์ → Machine Learning → Deep Learning → Transformer/LLM → Tool & MCP → AI Agent → Production โดยแต่ละช่วงต่อยอดจากสิ่งที่เรียนก่อนหน้า

ภาพง่าย ๆ: ไม่ได้เริ่มด้วยการสั่ง Prompt แล้วจบ แต่เริ่มจากทำให้เรา “พัฒนา AI ได้” ก่อน จากนั้นค่อยเข้าใจว่าโมเดลทำงานอย่างไร แล้วจึงต่อยอดไปสร้าง Application และ Agent ที่เชื่อม Tool และระบบจริง

STEP 1 — เริ่มบทแรก: เตรียมเครื่องให้พร้อม

Phase 0 · Lesson 01

Dev Environment คือจุดเริ่มต้นของหลักสูตร สำหรับตรวจว่าเครื่องมีสิ่งที่จำเป็นต่อการเรียนหรือไม่ เช่น Python และ Environment ที่พร้อมรันโค้ด จาก README ยังมีคำสั่งตรวจสอบแบบ Beginner Route เพื่อให้เห็นผลลัพธ์แรกก่อนเดินต่อ

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

สิ่งที่ควรได้หลังบทนี้: รู้ว่าเครื่องของเราพร้อมแค่ไหน ขาดอะไร และสามารถรันโค้ดของหลักสูตรจาก Repository ได้จริง

STEP 2 — สร้างพื้นฐานเครื่องมือของ AI Engineer

Phase 0 · Lessons 02–12

หลังตั้ง Environment แล้ว จะค่อย ๆ เก็บเครื่องมือที่ต้องใช้ตลอดเส้นทางการพัฒนา AI ซึ่ง Phase 0 มีทั้งหมด 12 บท

  • 02Git & Collaboration
    จัดการ Version และทำงานร่วมกับ Repository
  • 03GPU Setup & Cloud
    รู้จัก Compute สำหรับงาน AI ที่ใหญ่ขึ้น
  • 04APIs & Keys
    เชื่อมบริการ AI และจัดการ Secret/API Key
  • 05Jupyter Notebooks
    ทดลองโค้ดและวิเคราะห์ผลแบบ Interactive
  • 06Python Environments
    แยก Dependency ของแต่ละ Project ให้เป็นระบบ
  • 07Docker for AI
    ทำ Environment ให้ย้ายและรันซ้ำได้
  • 08Editor Setup
    จัด Editor ให้พร้อมสำหรับการเขียนและ Debug
  • 09Data Management
    จัดการข้อมูลที่ใช้กับ Experiment และ Model
  • 10Terminal & Shell
    ใช้ Command Line ทำงานกับ Project ได้คล่องขึ้น
  • 11Linux for AI
    พื้นฐานระบบที่พบได้บ่อยบน Server/Cloud
  • 12Debugging & Profiling
    หาบั๊กและวิเคราะห์จุดที่ทำให้ระบบช้า

STEP 3 — ปู Math ที่ใช้จริงใน AI

Phase 1 · 22 Lessons

เมื่อใช้เครื่องมือได้แล้ว จึงเข้าสู่ Math Foundations เริ่มจาก Linear Algebra Intuition แล้วค่อยไป Vector/Matrix, Calculus, Gradient, Probability, Bayes, Optimization, Entropy, PCA, SVD, Tensor และ Statistics เป้าหมายคือให้เห็นว่าแนวคิดเหล่านี้เชื่อมกับ Algorithm อย่างไร ไม่ใช่เรียนสูตรแยกจากการใช้งาน

Linear Algebra→Calculus→Probability→Optimization→Tensor & Statistics

STEP 4 — จาก Math ไปสู่ Machine Learning และ Deep Learning

Phases 2–3

Phase 2: ML Fundamentals เริ่มสร้างความเข้าใจ Regression, Classification, Tree-based Models, Clustering และการประเมินโมเดล ก่อนต่อด้วย Phase 3: Deep Learning Core ที่ลงไปถึง Neural Network, Forward Pass, Backpropagation, Loss, Optimizer และการใช้ PyTorch

Regression / Classification→Model Evaluation→Neural Network→Backprop→PyTorch

STEP 5 — เลือกแขนง: Vision, NLP, Speech และ RL

Phases 4–6 & 9

เมื่อมี Deep Learning เป็นฐาน สามารถแตกแขนงไปตามประเภทข้อมูลที่สนใจ เช่น Computer Vision สำหรับภาพ, NLP สำหรับภาษา, Speech & Audio สำหรับเสียง หรือ Reinforcement Learning สำหรับระบบที่เรียนรู้จาก Reward

STEP 6 — เข้าใจ Transformer และสร้าง LLM จากข้างใน

Phases 7–10

เข้าสู่หัวใจของ Generative AI ผ่าน Attention และ Transformer แล้วต่อด้วย Generative AI และ LLMs from Scratch ตั้งแต่ Tokenizer, Pre-training, Instruction Tuning, RLHF/DPO ไปจนถึง Quantization และ Inference Optimization

Attention→Transformer→GPT→Train LLM→Fine-tune / Optimize

STEP 7 — เปลี่ยน LLM ให้เป็น Application ที่ใช้งานจริง

Phases 11–13

LLM Engineering เริ่มจาก Prompt และ Context Engineering ต่อด้วย Embedding, RAG, Tool Use, Evaluation และ Production App จากนั้น Phase 13 จะพาไปเรื่อง Function Calling, MCP, A2A และ Agent Skills ซึ่งเป็นสะพานจาก “โมเดลตอบข้อความ” ไปสู่ “โมเดลที่ลงมือทำงานกับระบบอื่นได้”

Prompt→Context / RAG→Function Calling→MCP→Agent Skills

STEP 8 — สร้าง AI Agent และระบบ Autonomous

Phases 14–16

เริ่มจาก Agent Loop แล้วเพิ่ม Planning, Memory, Reflection, Tool Use, Computer Use และ Evaluation ก่อนขยายไปสู่ Long-running Agent, Human-in-the-loop และ Multi-Agent ที่มี Supervisor, Handoff และ Shared Memory

Agent Loop→Memory & Planning→Autonomous Agent→Multi-Agent

STEP 9 — Production, Safety และ Capstone

Phases 17–19

ช่วงท้ายคือสิ่งที่ทำให้ Project พร้อมใช้จริง: Deployment, Scaling, Observability, Cost, Reliability และ Security พร้อมเรียนเรื่อง Prompt Injection, Red Teaming, Privacy และ Governance ก่อนปิดท้ายด้วย Capstone ที่รวมหลายองค์ประกอบเป็นระบบ End-to-End

Deploy→Observe→Secure→Scale→Capstone
Roadmap นี้เป็น “เส้นทางเต็ม” สำหรับคนเริ่มจากศูนย์: ถ้ามีพื้นฐานอยู่แล้วสามารถกระโดดเข้า Phase ที่ตรงกับเป้าหมายได้ เช่น คนทำ LLM App เริ่ม Phase 11 หรือคนที่ต้องการ Agent โดยตรงเริ่ม Phase 14 ตามที่ Repository แนะนำ
Phase 0

ถ้าเริ่มจากศูนย์ — Phase 0 เตรียมเครื่องมือให้พร้อมก่อน

Phase 0 มีหน้าที่ทำให้เครื่องของเราพร้อมสำหรับบทต่อ ๆ ไป เหมาะกับคนที่เพิ่งเริ่ม Coding หรือยังไม่เคยตั้ง Environment สำหรับงาน AI มาก่อน

Phase 0 Setup and Tooling ของหลักสูตร AI Engineering from Scratch
Phase 0: Setup & Tooling — 12 บทสำหรับเตรียมเครื่องมือและ Environment

Dev Environment

เตรียม Python และตรวจสอบ Environment ให้พร้อมรันบทเรียน

Git & Collaboration

เรียนพื้นฐาน Git ซึ่งจำเป็นสำหรับการทำงานกับ Repository และทีมพัฒนา

GPU Setup & Cloud

เข้าใจการใช้ GPU และ Cloud สำหรับงานที่ต้องใช้ Compute สูงขึ้น

APIs & Keys

เรียนการจัดการ API และ Key อย่างเป็นระบบ ซึ่งจะใช้ต่อในงาน LLM และ Agent

Docker for AI

ปูพื้นฐาน Container เพื่อให้ Environment ทำซ้ำและ Deploy ได้ง่ายขึ้น

Debugging & Profiling

ฝึกหาสาเหตุเมื่อโปรแกรมมีปัญหา และวิเคราะห์ Performance ของระบบ

เหมาะกับใคร? คนที่อยากเรียนแบบเป็นระบบตั้งแต่ต้น, คนที่ยังไม่คุ้น Terminal/Git/Docker หรือคนที่เคยใช้ AI ผ่านหน้า Chat แต่ยังไม่เคยพัฒนา AI Application ด้วยโค้ด
Phase 1

ต่อด้วย Math Foundations — เข้าใจ “คณิตศาสตร์ข้างใต้ AI” ผ่านโค้ด

Phase 1 ปูพื้นฐานคณิตศาสตร์ที่อยู่เบื้องหลัง Machine Learning และ Neural Network จุดเด่นคือไม่ได้แยกคณิตศาสตร์ออกจากการใช้งาน แต่ให้เรียนควบคู่กับการเขียนโค้ดเพื่อเห็นว่าความคิดทางคณิตศาสตร์กลายเป็น Algorithm ได้อย่างไร

Phase 1 Math Foundations ของหลักสูตร AI Engineering from Scratch
Phase 1: Math Foundations — เริ่มจาก Linear Algebra ไปถึง Statistics, Optimization และ Tensor Operations

Linear Algebra

Vector, Matrix, Matrix Transformations และ Eigenvalues ซึ่งเป็นฐานของ Neural Network และ Embedding

Calculus & Gradients

Derivative, Gradient และ Chain Rule เพื่อเข้าใจว่าโมเดล “เรียนรู้” และอัปเดต Weight อย่างไร

Probability & Statistics

Probability, Distribution, Bayes และ Statistical Thinking สำหรับการตีความข้อมูลและความไม่แน่นอน

Optimization

Gradient Descent และวิธี Optimization ที่เป็นหัวใจในการ Train โมเดล

Information Theory

Entropy และ KL Divergence ซึ่งเชื่อมโยงกับ Loss Function และโมเดล Generative

PCA / SVD / Tensor

ลดมิติ วิเคราะห์โครงสร้างข้อมูล และเข้าใจ Tensor ซึ่งใช้ทั่วทั้ง Deep Learning

Curriculum Map

ภาพรวม 20 Phases — จากพื้นฐานไปจนสร้างระบบ AI จริง

เมื่อดูทั้งหลักสูตร จะเห็นเส้นทางที่ค่อย ๆ ต่อชั้นความรู้ขึ้นไป โดย Math และ ML เป็นฐาน ส่วน LLM, Tools, Agent และ Production อยู่ในช่วงปลายของหลักสูตร

Phaseหัวข้อเรียนอะไร
0Setup & ToolingPython, Git, API, GPU/Cloud, Docker, Terminal, Linux, Debugging
1Math FoundationsLinear Algebra, Calculus, Probability, Statistics, Optimization, Tensor
2ML FundamentalsRegression, Classification, Tree, SVM, Clustering, Model Evaluation
3Deep Learning CoreNeural Network, Backpropagation, Optimizer, PyTorch
4VisionCNN, Detection, Segmentation, Vision Transformer, Vision-Language
5NLPTokenization, Embedding, Search, QA, RAG, Evaluation
6Speech & AudioASR, Whisper, TTS, Voice, Real-time Audio
7TransformersAttention, Multi-Head Attention, GPT/BERT, KV Cache
8Generative AIDiffusion, Stable Diffusion, ControlNet, Video/Audio Generation
9Reinforcement LearningQ-Learning, PPO, Reward Model, RLHF
10LLMs from ScratchTokenizer → Pre-training → SFT → RLHF/DPO → Quantization
11LLM EngineeringPrompt, Context, RAG, Function Calling, Evaluation, Production App
12MultimodalVision + Language + Audio + Document + Computer Use
13Tools & ProtocolsFunction Calling, MCP, A2A, Agent Skills, Security
14Agent EngineeringAgent Loop, Planning, Memory, Tool Use, Computer Use, Evaluation
15Autonomous SystemsLong-running Agent, HITL, Durable Execution, Safety, Rollback
16Multi-Agent & SwarmsSupervisor, Handoff, Shared Memory, Debate, Agent Teams
17Infrastructure & ProductionDeployment, Scaling, Observability, Cost, Gateway, Reliability
18Ethics & AlignmentAlignment, Prompt Injection, Red Team, Privacy, Governance
19Capstone Projectsรวมความรู้ไปสร้างระบบ AI แบบ End-to-End และ Portfolio
How each lesson works

ไม่ได้มีแค่ให้อ่าน — แต่บังคับให้ “สร้าง” และเก็บหลักฐานการเรียน

โครงของบทเรียนถูกออกแบบให้ผู้เรียนไม่จบที่การอ่าน Concept หรือ Copy Code เท่านั้น แต่ต้องรันจริง เข้าใจ Output และสามารถปรับสิ่งที่สร้างได้ด้วยตัวเอง

Read the idea อ่านเอกสารและอธิบายแนวคิดหลักด้วยภาษาของตัวเองให้ได้
Build the important part เขียนกลไกสำคัญขึ้นมาเอง เพื่อเข้าใจสิ่งที่ Framework ซ่อนอยู่ข้างใต้
Run it รันคำสั่งจาก Repository จริง และดูว่า Code ทำงานอย่างไร
Keep evidence เก็บ Command, Output, Exit Code และ Artifact ที่สร้างหรือแก้ไข
Change something yourself ต้องสามารถเปลี่ยนส่วนเล็ก ๆ แล้วอธิบายผลที่เกิดขึ้นได้ ไม่ใช่แค่รันตาม
Ship an artifact บทเรียนจำนวนมากจบด้วยของที่นำไปใช้ต่อได้ เช่น Prompt, Skill, Agent หรือ MCP Server
Recommended routes

ถ้าคุณมีเป้าหมายต่างกัน ควรเรียนเส้นทางไหน?

1) มือใหม่จริง ๆ: Phase 0 → 1 → 2 → 3 แล้วค่อยเลือกสาย Vision / NLP / Speech หรือ LLM
2) มี Python และ ML อยู่แล้ว: เริ่ม Phase 7 Transformer → 10 LLMs from Scratch → 11 LLM Engineering
3) อยากทำ AI App / RAG สำหรับองค์กร: Phase 11 → 13 → 17 และเลือก Phase 18 เรื่อง Security/Prompt Injection เพิ่ม
4) อยากทำ AI Agent / AI Automation: Phase 11 → 13 → 14 → 15 → 17 โดยเน้น Tool Use, MCP, Memory, Evaluation และ Production
5) สนใจ MCP โดยเฉพาะ: ใช้ MCP Focused Route ได้เลย โดยไม่จำเป็นต้องเรียนครบทุก Phase
6) อยากทำ Agent Skills: เรียน Focused Agent Skills Route เพื่อเข้าใจตั้งแต่ Skill Contract จนถึง Sandbox และ Release Evaluation
Why it stands out

จุดเด่นของหลักสูตรนี้เมื่อเทียบกับการเรียน AI แบบดูคลิปอย่างเดียว

Getting started

เริ่มเรียนอย่างไร?

ถ้าต้องการลงมือกับ Repository โดยตรง สามารถ Clone โปรเจกต์ลงเครื่อง แล้วทดลองรันบทแรกตามคำสั่งใน README ได้

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

แต่ถ้ายังไม่อยากติดตั้งอะไร สามารถเริ่มจากอ่านผ่านเว็บไซต์ของหลักสูตรก่อน แล้วค่อยกลับมา Clone Repository เมื่อพร้อมลงมือทำ Lab

สรุป: จาก “ใช้ AI เป็น” ไปสู่ “สร้างระบบ AI เป็น”

AI Engineering from Scratch เหมาะมากสำหรับคนที่อยากเข้าใจ AI แบบเป็นระบบ และต้องการขยับจากการใช้ ChatGPT/Claude ไปสู่การสร้าง LLM Application, MCP, Agent และระบบ AI ที่ Deploy ใช้งานจริงได้

เริ่มดูหลักสูตรบน GitHub ↗
← Skill360