Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

vLLM vs. SGLang: Choosing the right inference engine for your workload

Comparing PagedAttention, RadixAttention, and benchmark results

October 14, 2026
Cedric Clyburn
Related topics:
Artificial intelligenceAI inference
Related products:
Red Hat AI

    Open models have gone from "worth testing" to powering the majority of AI applications and agents. On Vercel's AI Gateway, open weight models processed almost 80% of production tokens in September (Figure 1), up from less than 10% in December 2025. OpenRouter, a popular gateway for developers using LLMs, shows a similar climb in weekly token usage. As these models handle more traffic, many teams that want to control their data and costs with AI have started asking a natural follow-up question: Why not run these ourselves?

    Open weight models make up the majority of token volume on Vercel's AI Gateway in a September 19, 2026 post from Guillermo Rauch.
    Figure 1: Open weight models make up the majority of token volume on Vercel's AI Gateway in a September 19, 2026 post from Guillermo Rauch.

    In fact, most agents, RAG pipelines, and AI apps already make that easy, because swapping the backend is usually just a new base URL for an OpenAI-compatible API. But what sits behind that URL really matters. The inference engine decides how requests are scheduled, how GPU memory gets used, and whether users get a response almost instantly or end up waiting around. That's why for at-scale production serving, 2 open source engines come up the most: vLLM and SGLang. Which should you pick? Let's look at how each project was designed, what workloads they're best suited for, and how to read independent benchmarks for your use case.

    The problem both engines solve: KV cache

    An LLM request involves 2 stages that are useful to understand before comparing vLLM and SGLang:

    • Prefill: The model processes your whole prompt at once, and computes the attention keys and values for every input token.
    • Decode: The model generates output one token at a time, reusing those keys and values as it goes.

    Those stored keys and values are the KV cache. Keeping it around means the model doesn't redo the same math for every new token, but it grows with every conversation and can use a lot of GPU memory. Different workloads also stress different stages. Reading a long document is heavy on prefill, while code generation (lots of output) leans on decode.

    An inference engine is really a scheduler and memory manager for the KV cache, deciding which requests run together, where cached state lives, and how to keep the GPU busy as requests come and go. vLLM and SGLang each started with a different answer to that problem. If you're running models on a laptop or consumer hardware instead, check out our llama.cpp vs. vLLM guide.

    vLLM: Fixing wasted GPU memory with PagedAttention

    vLLM came out of UC Berkeley in 2023 with a focus on 1 big problem: Most serving systems waste KV cache memory. Because a conversation's cache keeps growing (and you don't know how long the output will be), engines reserved large, contiguous chunks of GPU memory up front. The original vLLM paper found that existing systems wasted 60–80% of that memory, which limited how many requests could fit on a GPU at once.

    vLLM's answer was PagedAttention. This splits the KV cache into small fixed-size blocks that can live anywhere in GPU memory, similar to how an operating system pages virtual memory (Figure 2). Memory gets allocated as a sequence grows, not reserved ahead of time, so the same GPU can serve many more requests at once.

    PagedAttention borrows an idea from operating systems. Just like processes get pages in physical memory, requests get KV blocks in the KV cache, and the blocks don't have to sit next to each other.
    Figure 2: PagedAttention borrows an idea from operating systems. Just like processes get pages in physical memory, requests get KV blocks in the KV cache, and the blocks don't have to sit next to each other.

    This idea worked so well that paged KV cache management is now standard across modern serving engines, SGLang included. From there, vLLM grew into a broad serving ecosystem, aiming to run "any model, on any accelerator, on any cloud," with Red Hat as its largest corporate contributor, along with hundreds of other organizations across industry and academia.

    SGLang: Reusing work across related requests with RadixAttention

    Introduced through LMSYS in January 2024, SGLang stands for Structured Generation Language. That tells you what it was built for: Apps that make many related model calls, like multi-turn chat, extraction workflows, and agents that branch and loop.

    Those types of applications repeat themselves a lot. Think about an agent: Every call sends the same system prompt and the same tool definitions, plus a conversation history that only grows. SGLang's RadixAttention stores computed KV cache in a radix tree, keyed by token prefix. When a new request arrives, the engine walks the tree, reuses everything that matches, and only computes the new part. Branches that haven't been used in a while get evicted first (Figure 3).

    4 common patterns where requests share a prefix: Few-shot learning, self-consistency, multi-turn chat, and tree-of-thought. RadixAttention reuses the shared part instead of recomputing it.
    Figure 3: Common patterns where requests share a prefix: Few-shot learning, self-consistency, multi-turn chat, and tree-of-thought. RadixAttention reuses the shared part instead of recomputing it.

    SGLang pairs this with cache-aware scheduling, which runs requests that share a prefix close together so the cached branch is still around when they need it.

    vLLM vs. SGLang: What's similar

    Both projects have expanded well beyond their original optimizations. They each now offer many of the same capabilities, many of which can improve response latency and throughput (which we'll also take a look at).

    • Continuous batching: Keeps the GPU busy as requests arrive and finish.
    • Prefix caching: Skips recomputing shared prompt instructions.
    • Chunked prefill: Splits long prompt processing into smaller portions that can be scheduled alongside other work.
    • Structured outputs: Constrains generation to JSON or a grammar.
    • Speculative decoding: Proposes and verifies candidate tokens to accelerate workloads.
    • Quantization: Reduces memory requirements and can improve performance using lower-precision representations.
    • Distributed execution: Spreads larger models and workloads across multiple accelerators.

    Model support

    Both engines typically provide Day-0 (day of) support for new models, working with frontier labs and model providers in advance to ensure proper formatting templates and parameters for efficient inference. vLLM has its recipes page (Figure 4), which provides commands for running specific models on your exact hardware, as does SGLang with the SGLang cookbook.

    The vLLM recipes page gives us a ready-to-run docker command, plus hardware options for both NVIDIA and AMD GPUs.
    Figure 4: The vLLM recipes page gives us a ready-to-run docker command, plus hardware options for both NVIDIA and AMD GPUs.

    Options for hardware support

    These days, both vLLM and SGLang support a diverse set of accelerators, including NVIDIA GPU, AMD GPU, Intel GPU, Google TPU, and more. The engines treat NVIDIA and AMD as first-class, but vLLM's support for TPU, Intel GPU, CPU, and Apple is older and is documented for serving models.

    Community and ecosystem

    Both projects have a diverse set of contributors. For example, vLLM and SGLang are in the top 10 of GitHub's 2025 Octoverse report (by contributor growth), demonstrating the scale of activity around the project (Figure 5).

    GitHub's 2025 Octoverse list of the fastest-growing open source projects by contributors, with vLLM at #3 and SGLang at #7.
    Figure 5: GitHub's 2025 Octoverse list of the fastest-growing open source projects by contributors, with vLLM at #3 and SGLang at #7.

    Also in 2025, vLLM and SGLang became part of the PyTorch Foundation ecosystem, with vLLM as a Foundation-Hosted Project (similar to a "Graduated" or mature project), meaning it's passed strict production-use and governance checks. SGLang is an Ecosystem Project (functionally similar to a "Sandbox" status), because it maintains its own independent project governance.

    What independent benchmarks show

    Modal's LLM Engineer's Almanac tested vLLM, SGLang, and TensorRT-LLM (Figure 6) on more than a dozen models and 10 input/output length combinations, all on NVIDIA GPUs with out-of-the-box settings. Their conclusion: vLLM and SGLang perform comparably, so the choice comes down to other factors, such as how quickly each ships the features you need.

    Modal's LLM Engine Advisor plots throughput and time to first token against requests per second for SGLang, vLLM, and TensorRT-LLM. Lower and further right is better!
    Figure 6: Modal's LLM Engine Advisor plots throughput and time to first token against requests per second for SGLang, vLLM, and TensorRT-LLM. Lower and further right is better!

    Here's a sample across 3 workload shapes using Llama 3.1 8B on a single H100. For each, we took the highest request rate where each engine still returned the first token in under 1 second (p95), so "throughput" here means requests per second per replica and TTFT is time to first token:

    Workload (tokens in / out)Closest real use casevLLM throughputSGLang throughputvLLM p95 TTFTSGLang p95 TTFT
    1024 / 128RAG, summarization17.08 req/s16.88 req/s0.52 s0.83 s
    128 / 1024Code generation5.34 req/s6.50 req/s0.82 s0.87 s
    2048 / 2048Long chat1.23 req/s1.25 req/s0.65 s0.74 s

    There's an important detail when reading these results: Modal's test prompts are random chunks of "Pride and Prejudice" by Jane Austen, which means very few requests share a prefix. That's a fair test of independent requests, but it doesn't show the prefix reuse that matters for chat and agents, which is exactly where RadixAttention (and vLLM's prefix caching) make a difference. The results are also from a single replica with default configs, so tuning can change the picture.

    The takeaway here is that the best benchmark is your own traffic. Tools like GuideLLM let you run realistic prompts against either engine and measure throughput and latency on your hardware.

    Conclusion

    vLLM and SGLang started from different answers to the same KV cache problem. vLLM focused on fitting more requests onto a GPU with PagedAttention, and SGLang focused on reusing work across related requests with RadixAttention. Today, both are fast, both are backed by large communities, and both have picked up each other's best ideas. The right choice depends on your workload, your hardware, and the ecosystem you're building in.

    Related Posts

    • Run decision models on vLLM and Red Hat AI using DiffusionGemma

    • Optimize vLLM speculative decoding with FastMTP heads

    • How to check if your model is supported by vLLM in Red Hat AI

    • llama.cpp vs. vLLM: Choosing the right local LLM inference engine

    Recent Posts

    • vLLM vs. SGLang: Choosing the right inference engine for your workload

    • Configure Red Hat OpenShift Dev Spaces for enterprise security

    • Test and deploy bootable containers with bootc virtualization kit (bcvk)

    • Red Hat AI Inference 3.5 MaaS governance on AKS

    • Sharding etcd on hosted control planes and what the numbers actually say

    What’s up next?

    Learning Path Get started with vLLM feature share

    Get started with vLLM

    Learn how to compress, serve, and benchmark LLMs with vLLM.
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI