Red HatCedric ClyburnExplainer
vLLM vs. SGLang: Choosing the right inference engine for your workload
Summary
Open weight models now process nearly 80% of production tokens on Vercel’s AI Gateway, up from under 10% in December 2025, and OpenRouter shows a similar climb. This surge drives teams to consider self-hosting via inference engines like vLLM and SGLang, since swapping backends usually only requires a new base URL for an OpenAI-compatible API. vLLM’s PagedAttention, introduced by UC Berkeley in 2023, splits the KV cache into fixed-size blocks to eliminate wasted contiguous memory reservation and increase GPU throughput. SGLang’s RadixAttention, from LMSYS in January 2024, stores computed KV cache in a radix tree keyed by token prefix for reuse across related requests like multi-turn chat and agents. Independent benchmarks from Modal show comparable performance on random prompts without prefix sharing, indicating that workload type and hardware should guide engine choice.
Context
The post addresses the growing adoption of open weight models in production, which has led teams to explore self-hosting for cost and data control. It compares two prominent open-source inference engines, vLLM and SGLang, to help readers choose based on workload characteristics.
Approach / What changed
The article explains each engine’s core optimization: vLLM’s PagedAttention for memory efficiency and SGLang’s RadixAttention for prefix reuse. It then covers shared capabilities, model and hardware support, community status, and independent benchmark results to inform the comparison.
Takeaways
vLLM’s PagedAttention reduces memory waste by splitting the KV cache into fixed-size blocks allocated on demand, increasing the number of requests a single GPU can serve simultaneously.
SGLang’s RadixAttention caches computed KV cache in a radix tree keyed by token prefix, enabling reuse across related requests like multi-turn chat and agent loops without recomputation.
Independent benchmarks from Modal, which used random prompts without shared prefixes, found vLLM and SGLang perform comparably; real workload testing is recommended.
FAQ
Which engine is better for chat applications?
SGLang's RadixAttention is designed to reuse KV cache for common prefixes like system prompts and conversation history, which matches chat workloads. However, vLLM also offers prefix caching, so benchmarks on your own traffic are the best guide.
What hardware do vLLM and SGLang support?
Both engines support NVIDIA, AMD, Intel GPU, Google TPU, and more, treating NVIDIA and AMD as first-class. vLLM also has older support for CPU and Apple, documented for serving models.
How should I choose between vLLM and SGLang?
The choice depends on workload type, hardware, and ecosystem needs. Use tools like GuideLLM to run realistic prompts on your hardware and measure throughput and latency.
Source and freshness
- Source
- developers.redhat.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.