Back to directory

zero-to-sglang

A hands-on course that teaches LLM inference engine internals by building a minimal SGLang implementation from scratch and then reading the real SGLang source.

Visit website (opens in a new tab)datawhalechina.github.io
zero-to-sglang

zero-to-sglang is a course on LLM inference that starts from the core questions of why a KV cache exists, how prefill differs from decode, and what compute-bound and memory-bound mean, then walks through building a mini version of SGLang by hand: a forward pass, generation, KV cache, HTTP serving, continuous batching, paged KV cache and RadixAttention, added one at a time.

The final part of the course returns to the real SGLang project and explains how its production optimizations are actually implemented, covering quantization, hierarchical caching, DP Attention, expert and pipeline parallelism, and prefill-decode disaggregation, before walking through profiling, trace analysis and how to land a first pull request against SGLang.

The course is jointly produced by Datawhale and RadixArk, the company founded by the SGLang team, and is available in both English and Chinese, with some later chapters still under development.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.