Skip to content
←Back to Open Source

OPEN SOURCE DEEP DIVE

Inference EngineServingPagedAttentionKV Cache

vLLM: the open serving stack that grew out of PagedAttention, with 200+ architectures and five parallelism axes

An inference and serving library out of UC Berkeley's Sky Computing Lab with 2000+ contributors: paged KV memory, continuous batching and chunked prefill, CUDA/HIP graphs with torch.compile, quantisation across FP8/MXFP4/NVFP4/GGUF, pluggable attention kernels (FlashInfer, TRTLLM-GEN, FlashMLA), four speculative decoding routes (n-gram, suffix, EAGLE, DFlash), tensor/pipeline/data/expert/context parallelism with P/D disaggregation, and both OpenAI and Anthropic protocols.

vllm-project/vllm93kPythonApache-2.05 min read

Treating VRAM like virtual memory: the serving stack that grew out of PagedAttention

vLLM started in the Sky Computing Lab at UC Berkeley, and its founding paper is Efficient Memory Management for Large Language Model Serving with PagedAttention (SOSP 2023, arXiv:2309.06180). The problem it attacks is concrete: during autoregressive decoding the KV cache size of each request is unknown in advance, so traditional implementations reserve contiguous VRAM for the maximum length. Internal fragmentation, external fragmentation and reservation waste then consume most of the capacity, the number of concurrently resident requests collapses, and throughput collapses with it. PagedAttention borrows paging from the operating system: KV cache is cut into fixed-size blocks, a block table maps logical to physical, and non-contiguous physical blocks can still spell out one request's context. Waste converges to the final partial block.

The point is not "it saved VRAM". The point is that it turned engine scheduling into something that can genuinely be batched: blocks can be shared (prefix caching), swapped out, and migrated between prefill and decode. Nearly everything vLLM does since then grows on that memory model - continuous batching, chunked prefill, prefix caching, P/D disaggregation. Remove the paging layer and each of them has to be redesigned.

Where the throughput comes from: scheduling, graphs and kernels pressed at once

The README lists its performance sources plainly, and they read as three layers:

LayerMechanismWhat it removes
Schedulingcontinuous batching, chunked prefill, prefix caching, disaggregated prefill/decode/encodeGPU idle time and redundant compute: a long prefill no longer blocks the whole decode batch, and requests that hit a prefix skip recomputation entirely
Execution graphpiecewise and full CUDA/HIP graphs, torch.compile for automatic kernel generation and graph-level transformationper-step Python and kernel-launch overhead, which dominates at small batch sizes
Kernelsattention: FlashAttention, FlashInfer, TRTLLM-GEN, FlashMLA, Triton; GEMM/MoE: CUTLASS, TRTLLM-GEN, CuTeDSLwasted memory traffic and arithmetic intensity, with grouped GEMM handled separately for MoE

Pluggable attention kernels deserve their own note. vLLM no longer insists on a single in-house kernel; it wires in FlashInfer, TRTLLM-GEN and FlashMLA and routes by model and hardware. That is an admission that the kernel layer of the inference stack has split into several specialist projects, and that an engine's value now lies in orchestration rather than exclusivity. Speculative decoding likewise offers four routes - n-gram, suffix, EAGLE and DFlash - where the first two cost nothing to train (they guess from context) and the latter two need a draft model or a multi-token prediction head.

Precision and parallelism: making "cheap" a menu

The quantisation list covers essentially every mainstream scheme in play: FP8, MXFP8/MXFP4, NVFP4, INT8, INT4, GPTQ/AWQ, GGUF, compressed-tensors, ModelOpt and TorchAO. GGUF being on that list means llama.cpp's ecosystem of quantised weights can be served directly by a cluster engine - the two previously separate tracks (local inference and datacentre serving) now share a weight format.

Five parallelism axes are exposed: tensor, pipeline, data, expert and context. Expert parallelism is a necessity in the MoE era - models like DeepSeek-V3 carry more experts than any single card can hold, so without EP they cannot be spread across a cluster at all. Context parallelism serves long context by splitting the sequence across cards. Those five knobs plus P/D disaggregation are vLLM's complete answer to rack-scale deployment.

Interfaces and ecosystem: the compatibility layer is wider than the feature layer

The server speaks the OpenAI-compatible API, plus the Anthropic Messages API and gRPC. Supporting two vendor protocols at once is pragmatic: agent frameworks hard-code their clients against one or the other, and each extra protocol an engine speaks removes a layer of migration cost. Structured output runs through xgrammar or guidance, tool calling and reasoning content each get a dedicated parser, and multi-LoRA covers both dense and MoE layers.

More than 200 model architectures are supported, listed by family: decoder-only LLMs (Llama, Qwen, Gemma), MoE LLMs (Mixtral, DeepSeek-V3, Qwen-MoE, GPT-OSS), hybrid attention and state-space models (Mamba, Qwen3.5), multimodal models (LLaVA, Qwen-VL, Pixtral), embedding and retrieval models (E5-Mistral, GTE, ColBERT), and reward and classification models (Qwen-Math). Reward models are not an afterthought - they are the scorer inside the RL post-training loop, which places vLLM as a layer shared by training and inference rather than inference alone.

Hardware reach is equally list-like: NVIDIA, AMD and Intel GPUs plus x86/ARM/PowerPC CPUs are first-class, with plugins for Google TPUs, Intel Gaudi, IBM Spyre, Huawei Ascend, Rebellions NPU, Apple Silicon and MetaX GPUs. Over 2000 contributors from dozens of academic institutions and companies.

Where it sits in the LLM stack

By this site's llm test - "swap it out and either the model's intelligence or its cost per token changes" - vLLM is squarely the second term, and it is the default baseline every other open serving stack gets compared against. Its difference from SGLang is mostly one of emphasis: SGLang leads with RadixAttention prefix reuse and large-scale expert parallelism, while vLLM's strength is architecture coverage, the hardware plugin ecosystem, and its generality as an RL rollout backend. Each keeps re-implementing the other's ideas, and neither has pulled away.

One caveat: "state-of-the-art serving throughput" in the README is the project's own claim with no unified comparison conditions attached. Cross-engine throughput numbers depend heavily on model, parallel configuration, batch size and the input/output length distribution. We label it a project claim; real selection should run benchmarkserving on your own traffic.

Related Projects

ggml-org/llama.cppMIT

llama.cpp: seventeen backends and 1.5-to-8-bit quantisation, taking LLM inference anywhere a compiler exists

An MIT-licensed, dependency-free plain C/C++ inference implementation built on ggml. Seventeen backends span CUDA, Metal, HIP, Vulkan, SYCL, WebGPU, CANN, Hexagon, MUSA, zDNN and ZenDNN; integer quantisation runs 1.5 to 8 bits; CPU+GPU hybrid inference makes models larger than VRAM runnable at all; and GGUF, its output format, is a de facto standard that even vLLM consumes. Two lines - llama cli or llama serve - start an OpenAI-compatible server.

Inference EngineGGUF
C++130k24k841
sgl-project/sglangApache-2.0

SGLang: the serving framework that made prefix reuse a radix tree, and a rollout backend for frontier RL post-training

A high-performance serving framework hosted by LMSYS: RadixAttention prefix caching, a zero-overhead CPU scheduler, prefill-decode disaggregation, DFlash and Spec V2 speculative decoding, compressed finite state machines for structured output, and large-scale expert parallelism (96 H100 GPUs; 3.8x prefill and 4.8x decode on GB200 NVL72 part II). Its day-0 ledger covers Kimi K3, DeepSeek-V4, GLM5.2 NVFP4, Nemotron 3 and MiniMax M2, and AReaL, Miles, slime, Tunix and verl all use it as an RL rollout backend.

Inference EngineRadixAttention
Python37k9.2k184
NVIDIA/TensorRT-LLMNOASSERTION

TensorRT-LLM: NVIDIA's specialised-kernel and rack-scale engine, with agentic serving as a first-class topic

NVIDIA's inference optimisation library for LLMs and visual generation models, fully open source since 2025-03-22. Its 28 tech blogs form an auditable engineering ledger: Skip Softmax and sparse attention for long context, the three-part expert parallelism series with one-sided AlltoAll over NVLink, DWDP for NVL72, guided decoding cooperating with speculative decoding, inference-time compute, and evaluating agentic serving with trace replay and job-level metrics. Claims include Llama 4 Maverick above 1,000 TPS per user and 40,000+ tok/s on B200; Bing and NAVER Place run it in production.

Inference EngineCUDA
Python15k2.8k123
Neroued/ninferApache-2.0

NInfer: A From-Scratch C++/CUDA Inference Engine for a Single RTX 5090

A from-scratch C++/CUDA inference engine for five explicitly registered Qwen checkpoints on one NVIDIA GeForce RTX 5090. Startup-frozen residency picks MTP or DFlash speculative decoding, Vision, and one of five KV storage formats; a shared Device KV pool plus pinned Host State/KV checkpoints reuse exact prompt prefixes across 240k-token contexts. Measured aggregate decode reaches 1,146.9 tok/s at concurrency 8 and 15,544.3 tok/s on a 7,680-token prefill.

LLM InferenceCUDA
C++1.4k26113

As an Amazon Associate, we earn from qualifying purchases.