Wink Pings

Writing a mini-sglang from scratch: this free course breaks down the inference engine from start to finish

Datawhale and RadixArk jointly created zero-to-sglang, and it is now complete, with all chapters available in Chinese and English. It first explains inference concepts clearly, then hand-writes mini-sglang, and finally returns to the real SGLang source code and PR workflow.

zero-to-sglang 课程封面

The written course for zero-to-sglang is now complete. The project was jointly initiated by Datawhale and RadixArk; the latter was founded by the SGLang team. The course is free, with all chapters completed in both Chinese and English. Writing began on August 24, 2026, and ended on November 10. The accompanying videos are still in production and are expected to be finished by the end of November 2026; they will be published on YouTube and Bilibili, and links will be added to the course outline.

Course repository: https://github.com/datawhalechina/zero-to-sglang

Main SGLang repository: https://github.com/sgl-project/sglang

Inference engine tutorials have long had an awkward gap: concept-focused ones stop at concepts and never touch code; source-code-first ones drop beginners into the SGLang repository to find the entry point. zero-to-sglang aims to fill that gap. Its path is divided into four parts.

Part 0 first deploys an SGLang Server and runs it with Qwen3-0.6B on your own GPU. Part I covers concepts only and does not require a GPU, covering LLMs, inference, GPUs, KV Cache, and benchmarks. Part II starts hand-writing mini-sglang, from forward pass, generation, KV Cache, and HTTP serving all the way to Continuous Batching, Paged KV Cache, RadixAttention, multiprocessing and tensor parallelism, and speculative decoding. Part III returns to the real SGLang and covers Attention backends, quantization and low-precision inference, hierarchical caching, DP Attention/EP/PP, and Prefill-Decode disaggregation. Part IV is more contribution-oriented: deploy with the Cookbook, do profiling and trace analysis, and go through the SGLang PR workflow.

The course FAQ explains the hardware requirements: Part I does not require a GPU; most code in Part II can be debugged on CPU, but a GPU is best for the full implementation and performance testing, and cloud GPUs are fine too. You do not need to learn CUDA first; you can pick it up when you encounter attention backends in Part III.

推文配图

Someone in the replies asked whether there is a list of beginner-friendly issues that can be paired with the course. Yichi Zhang replied to search GitHub for the good first issue label. Another person said they had already started the mini project this week and were making good progress. This kind of feedback is more real than equating bookmarking with learning.

mini-sglang reference implementation: https://github.com/sgl-project/mini-sglang

If you just want the shortest path: first read Part I to build the big picture, follow Part II to write mini-sglang, then use Part III to compare against the real source code, and finally use Part IV to make your first PR. The course is already there; what remains is to start doing.

发布时间: 2026-11-10 19:28