Last verified: 2026-10-14. This page reflects SGLang v0.5.21 (released October 2, 2026). Flag names and defaults can shift between releases — verify against your installed version with
python -m sglang.launch_server --help.RadixAttention
SGLang’s KV cache is not a flat table — it is a radix tree keyed by token sequences. Every prefix any request has ever processed lives in the tree. When a new request arrives, SGLang walks the tree to find the longest matching prefix and reuses its cached KV state instead of recomputing it. Concretely, if 10 requests share a 2,000-token system prompt, the prompt is prefilled once. The remaining 9 requests skip straight to decode. As conversations diverge, each branch gets its own cache node, and shared prefixes at any depth are reused independently. The performance difference is significant for prefix-heavy workloads. At 50 concurrent requests with 80% shared prefix, SGLang delivers 37% lower time-to-first-token (TTFT) compared to vLLM. The advantage grows as prefix overlap increases and shrinks when every request is unique.When SGLang wins
Pick SGLang when your workload has high prefix overlap:- RAG pipelines — the same system prompt and retrieved chunks appear across many queries. RadixAttention caches the prompt + document prefix once and reuses it for every question.
- Multi-turn conversations — each turn extends the previous context. The entire conversation history up to the last turn is a shared prefix.
- Agent loops with tool schemas — agents send the same tool definitions, few-shot examples, and orchestration prompts on every call. SGLang caches those prefixes and only prefills the new tool results.
- Long shared system prompts — any deployment where dozens or hundreds of users share a large system prompt (customer support bots, coding assistants, document Q&A).
- Batch evaluation — running the same prompt template with different variable substitutions. The template prefix is cached; only the filled-in portion is prefilled.
When vLLM wins
Pick vLLM when your workload prioritizes breadth over depth:- Unique prompts per request — if every request has a completely different prompt with no shared prefix, RadixAttention has nothing to reuse. vLLM’s PagedAttention handles independent requests equally well.
- Broad model support — vLLM adds support for new model architectures faster. If you need a model that shipped last week, vLLM likely supports it first.
- Blackwell GPU optimization — vLLM has dedicated optimization paths for NVIDIA Blackwell (B100/B200/GB200) hardware. If you are deploying on Blackwell, vLLM extracts more throughput.
- EAGLE3 speculative decoding — vLLM’s EAGLE integration is more mature. If speculative decoding is your primary latency lever, vLLM is the safer choice today.
- Production hardening — vLLM has a larger deployment base and longer track record in production serving. If stability and community support matter more than prefix caching, vLLM is the default.
Configuration flags
Key SGLang-specific flags forpython -m sglang.launch_server:
Rust-backed prefix caching
Starting in v0.5.21, the RadixAttention cache backend is implemented in Rust and enabled by default. The Rust backend replaces the earlier Python implementation with lower overhead for cache lookups, insertions, and eviction. You do not need a flag to enable it — it is the default path. If you encounter issues, you can fall back to the Python implementation with--disable-cuda-graph and check the SGLang release notes for the exact rollback flag for your version. In practice, the Rust backend is stable and faster.
Decision matrix
Example configurations
RAG pipeline with long retrieved context
Serve a 70B model optimized for RAG, where every request carries the same system prompt and large retrieved document chunks:--mem-fraction-static 0.92 allocates more GPU memory to the KV cache for long retrieved contexts. --chunked-prefill-size 4096 prevents large document prefills from stalling concurrent decode requests. RadixAttention handles the rest — the system prompt and document prefix are cached after the first request.
Multi-turn chat agent with tool schemas
Serve a model for an agent that sends the same tool definitions on every call:High-throughput batch evaluation
Run the same prompt template across thousands of inputs with maximum throughput:Native decisions API
SGLang v0.5.21 added a native decisions API that follows the same pattern as Ollama and LM Studio. This lets clients query which models are available, check model status, and manage deployments through a consistent interface — useful if you build tooling that talks to multiple local backends. Check the SGLang release notes for the exact endpoint paths and request/response format, as the API surface is new and may evolve.Connect SGLang through Tokios
Once SGLang is running, the Tokios connector exposes it to remote clients without opening any inbound ports. The connector dials out tohttps://api.tokios.com and forwards requests to SGLang’s OpenAI-compatible /v1 endpoint on localhost. See SGLang remote access for the full setup walkthrough.
SGLang remote access
Connect SGLang through Tokios for authenticated remote access.
vLLM remote access
Same pattern for vLLM — compare setups side by side.
Speculative decoding
Speed up decode with draft models, n-grams, MTP, and EAGLE.
Benchmark your deployment
Measure TTFT, throughput, and latency across configurations.