AIAny
AI Deploy2025
Icon for item

Mini-SGLang

A ~5,000-line Python LLM inference engine that re-implements SGLang's serving optimizations — radix KV-cache reuse, chunked prefill, overlap scheduling, tensor parallelism — as a fully type-annotated reference instead of a black box.

Introduction

Production LLM serving engines like vLLM and the full SGLang have grown into tens of thousands of lines, and their cleverest optimizations sit buried under layers of dispatch logic. Mini-SGLang takes the opposite bet: strip the same engine down to ~5,000 readable, fully type-annotated lines so you can actually trace how a request turns into tokens — without giving up state-of-the-art throughput.

What Sets It Apart
  • It keeps the optimizations that matter, not a toy subset: radix-tree KV-cache reuse across shared prefixes, chunked prefill to cap peak memory on long contexts, overlap scheduling that hides CPU work behind GPU compute, and tensor parallelism for multi-GPU. These are the four things that separate a real serving engine from a for-loop over model.generate().
  • It wires in FlashAttention and FlashInfer kernels rather than reimplementing attention, so "mini" applies to the scheduler and runtime, not to the math.
  • Because it derives directly from the SGLang codebase, the abstractions you learn here map onto the production system — it doubles as a reading guide for SGLang, not just a standalone engine.
Who It's For

Great fit if you're a systems researcher, a student, or an engineer who wants to understand modern inference internals — KV caching, scheduling, parallelism — by reading code that fits in your head, or who needs a hackable base for prototyping serving ideas. Look elsewhere if you need a battle-tested deployment with broad model coverage and a mature ecosystem; for that, run full SGLang or vLLM. It's Linux-only (x86_64/aarch64), with macOS and Windows reached through WSL2 or Docker.

Information

  • Websitegithub.com
  • OrganizationsLMSYS Org
  • Authorssgl-project
  • Published date2025/09/01

More Items

GitHub
AI Infra2026

Indexes mixed-format folders locally into a zero-config, Elasticsearch-compatible search engine offering keyword, semantic, vector and hybrid retrieval. Embeds on ingest, provides per-agent namespaced memory and AST-aware code indexing in a single static binary with no external embedding key.

GitHub

Turns natural-language instructions into end-to-end Android automation that drives real devices and captures Logcat and screenshots. Uses a multimodal “Dynamic‑First, Coordinate‑Fallback” locator and a native MCP server for IDE integration, supporting fast Flash (3–5s/step) and verifiable Pro workflows.

Converts real repositories into verifiable, sandboxed training environments with black-box tests to train coding agents on long-horizon program reproduction. Provides Program-Env for automated environment construction and Program-Agent for a role-isolated development workflow, yielding 1,648 C/C++/Go/Rust tasks and improving benchmark performance.