zero-to-sglang
Official SGLang x Datawhale course on LLM inference: understand inference, build a mini-sglang from scratch, then read the real SGLang source and land your firs
What is zero-to-sglang?
Official SGLang x Datawhale course on LLM inference: understand inference, build a mini-sglang from scratch, then read the real SGLang source and land your first PR. Available in English and Chinese.
Overview of zero-to-sglang
What it is
zero-to-sglang is an official course jointly launched by Datawhale and RadixArk (the company founded by the SGLang team). It is a hands-on tutorial on LLM inference. The course covers understanding inference concepts, building a mini-sglang from scratch, reading the real SGLang source code, and landing a first pull request. The course is available in English and Chinese and is still under development. The repository is hosted at https://github.com/datawhalechina/zero-to-sglang with a homepage at https://datawhalechina.github.io/zero-to-sglang.
Key features
- Covers inference fundamentals: KV Cache, prefill/decode, compute-bound vs. memory-bound, and the Roofline model.
- Guides building a mini-sglang from zero to one, adding forward pass, generation, KV Cache, HTTP serving, Continuous Batching, Paged KV Cache, and RadixAttention one at a time.
- Explains how real SGLang optimizations like RadixAttention, Paged KV Cache, and Continuous Batching are implemented.
- Touches on advanced topics: quantization, hierarchical caching, DP Attention / EP / PP, and Prefill-Decode disaggregation.
- Includes a section on profiling, trace analysis, and the full SGLang PR workflow for contributing to open source.
Use cases
This course is designed for developers who want to understand LLM inference engines deeply. It is suitable for those who have basic Python and deep learning knowledge and want to move from conceptual understanding to hands-on code. It can be used by individuals learning inference engine design, by teams onboarding new contributors to SGLang, or by anyone interested in contributing to open-source inference frameworks.
Getting started
bashgit clone https://github.com/datawhalechina/zero-to-sglang.gitcd zero-to-sglang# Install dependencies as each chapter requires
License and pricing
The license is not stated in the provided metadata or README. The project is categorized as open source.
Based on the project's public README and repository metadata.