#5252nd of 88 in Learning and cookbooks

diy-llm

Chinese-language course on building LLMs, adapted from Stanford CS336

Stars
2.9k
License
no license
Last commit
Nov 2026
Last release
Aug 2026
Language
Jupyter Notebook
Stars, last 29 weeks+2,324
21 Apr 2026: 587 stars28 Apr 2026: 643 stars5 May 2026: 678 stars12 May 2026: 732 stars19 May 2026: 775 stars26 May 2026: 807 stars2 Jun 2026: 839 stars9 Jun 2026: 910 stars16 Jun 2026: 939 stars23 Jun 2026: 954 stars30 Jun 2026: 973 stars7 Jul 2026: 1,005 stars14 Jul 2026: 1,029 stars21 Jul 2026: 1,047 stars28 Jul 2026: 1,062 stars4 Aug 2026: 1,119 stars11 Aug 2026: 1,146 stars18 Aug 2026: 1,212 stars25 Aug 2026: 1,238 stars1 Sept 2026: 1,266 stars8 Sept 2026: 1,312 stars15 Sept 2026: 1,362 stars22 Sept 2026: 1,396 stars29 Sept 2026: 1,429 stars6 Oct 2026: 1,445 stars13 Oct 2026: 1,480 stars20 Oct 2026: 1,523 stars27 Oct 2026: 1,947 stars3 Nov 2026: 2,776 stars10 Nov 2026: 2,911 stars

587 on 21 Apr 20262,911 on 10 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

A community-written Chinese course with 16 chapters and 6 coding assignments, reorganized from Stanford CS336 around the LLM engineering pipeline. It covers BPE tokenizers, RoPE/RMSNorm/SwiGLU, MoE, FlashAttention-2 in Triton, distributed training, scaling laws, data filtering, SFT/DPO/GRPO and evaluation. It adds Qwen and DeepSeek examples and C-EVAL.

Who it is for: Chinese-reading engineers with PyTorch skills learning to build LLMs end to end

Strengths

  • Six runnable assignments: tokenizer, model, Triton FlashAttention-2, Common Crawl filtering, GRPO, evaluation
  • Covers the full pipeline from data and pretraining to inference, alignment and multimodal
  • Adds Qwen, DeepSeekMoE, R1/GRPO and C-EVAL cases absent from the original course
  • Offline PDF handouts, CPU debugging and MacBook MPS support for assignment 1

Weaknesses

  • Main text is Chinese; an English version exists under docs/en
  • Chapter 1 is marked as needing work and chapter 16 as still updating
  • Full training in the assignments needs a GPU; CPU only suits debugging
  • Chapter numbering does not match the original CS336 lectures

What it needs

  • GPU optional
  • Needs PyTorch, Triton, W&B, lm-evaluation-harness, evalscope
  • Models: Qwen, DeepSeek, Qwen-VL, LLaVA

Quick answers

Is diy-llm open source?

Its code is public on GitHub, but the repository has no license, so by default nobody may reuse it.

Does diy-llm need a GPU?

No. It runs on a CPU and can use a GPU when you have one.

Also in Learning and cookbooks

See all 88
Also in Learning and cookbooks
RankProjectScore
1ai-engineering-from-scratchHands-on AI engineering curriculum with 542 lessons across 20 phases78.5k stars+10,997 (+16%) in 30 daysMIT91 out of 100
2generative-ai-for-beginners21-lesson course on building generative AI apps in Python and TypeScript123.4k stars+2,347 (+1.9%) in 30 daysMIT83 out of 100
3rag_techniquesCollection of 42 runnable notebooks implementing RAG techniques30.3k stars+563 (+1.9%) in 30 dayscustom license81 out of 100
#4cs249r_bookOpen textbook and course materials for machine learning systems engineering30.1k stars+1,266 (+4.4%) in 30 dayscustom license81 out of 100
#5ai-for-beginners24-lesson AI curriculum with notebooks in PyTorch and TensorFlow Live demo ↗ (opens in a new tab)70.7k stars+1,156 (+1.7%) in 30 daysMIT80 out of 100