#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
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| Rank | Project | Score |
|---|---|---|
| 1 | ai-engineering-from-scratchHands-on AI engineering curriculum with 542 lessons across 20 phases | 91 out of 100 |
| 2 | generative-ai-for-beginners21-lesson course on building generative AI apps in Python and TypeScript | 83 out of 100 |
| 3 | rag_techniquesCollection of 42 runnable notebooks implementing RAG techniques | 81 out of 100 |
| #4 | cs249r_bookOpen textbook and course materials for machine learning systems engineering | 81 out of 100 |
| #5 | ai-for-beginners24-lesson AI curriculum with notebooks in PyTorch and TensorFlow | 80 out of 100 |