Back to Inference Glossary
Inference Glossary

SGLang

An open-source LLM serving engine that uses RadixAttention to share KV cache across requests with overlapping prefixes — especially strong for agentic and tool-use workloads.

SGLang is an open-source structured generation language and serving engine for large language models. Its **RadixAttention** organizes KV-cache reuse across requests that share prefixes. Paged allocation and prefix reuse address different parts of cache management and can be used together.

The core observation behind RadixAttention is that many workloads send requests with substantial overlap — the same system prompt, few-shot examples, or tool definitions. SGLang organizes cached prefixes in a radix tree and matches incoming requests against them. Reusing a matching prefix's KV state reduces prompt processing; the model still generates the new response.

Prefix reuse is useful in agentic workflows with shared tool prompts, evaluations with repeated instructions, and applications that reuse the same context. Its benefit depends on how often prefixes actually match and how much of that state remains cached.

When comparing SGLang, vLLM, and a custom engine such as Ion, include the application's real prompt-sharing pattern and cache policy. Measure completed-request throughput, latency, and response quality under the same conditions.