vLLM vs SGLang throughput calculator
Both vLLM and SGLang saturate GPU Tensor Cores on uncached single-turn generation, but they diverge sharply on shared-prefix agent loops, multi-turn chat, and RAG. SGLang's RadixAttention tree and zero-overhead CPU scheduler reduce TTFT and boost throughput when prefix cache reuse is high; vLLM's PagedAttention + Automatic Prefix Caching (APC) offers broad model support and strong batching stability. Model your exact workload below.
Interactive calculator
| Metric | SGLang (RadixAttention) | vLLM (PagedAttention) | Delta |
|---|
Where SGLang vs vLLM actually differ
- Prefix cache hit efficiency: SGLang's RadixAttention retains a radix tree of KV blocks across requests with LRU eviction and cache-aware scheduling, achieving higher effective hit rates on branching agent trees and multi-turn tool calls than block-hash prefix caching.
- CPU scheduling overhead: On small/fast models (8B–32B) or high concurrency, SGLang's zero-overhead batch scheduler overlaps CPU scheduling with GPU execution, reducing inter-token latency jitter.
- Structured / JSON output: SGLang's compressed FSM (xgrammar / jump-forward decoding) skips deterministic JSON syntax tokens, delivering 1.3×–2.0× higher throughput on strict schema extraction.
- When vLLM wins: Broadest day-0 model coverage, mature LoRA multi-adapter serving, Disaggregated Prefill/Decode integrations, and lower operational friction in existing Kubernetes/Ray stacks.
Frequently asked questions
Is SGLang always faster than vLLM?
No. On uncached single-turn generation with large dense models (like Llama 3.3 70B at 0% prefix reuse), vLLM v1 and SGLang are typically within 3-8% of each other because both are bound by the same cuBLAS/FlashInfer kernels. SGLang pulls ahead significantly on high prefix-reuse agent loops and constrained JSON decoding.
What is the difference between RadixAttention and PagedAttention?
PagedAttention (vLLM) manages KV cache in non-contiguous memory blocks to eliminate fragmentation, with hash-based Automatic Prefix Caching (APC). RadixAttention (SGLang) organizes cached KV blocks in a radix tree and schedules batches to maximize prefix sharing across concurrent requests.
How does shared prefix caching reduce TTFT?
Time to First Token (TTFT) is dominated by prefill compute over the input prompt. Skipping prefill for 75% of a 4,096-token prompt cuts prefill FLOPs by ~4x, dropping TTFT proportionally.
Which engine is better for DeepSeek-V3 / R1 671B?
SGLang has been the reference open-source serving engine for DeepSeek-V3/R1 with native MLA + FP8 + Data-Parallel Attention optimizations, though vLLM also supports DeepSeek-V3 MLA and FP8. Test both on your exact prompt shape.
Does tensor parallelism (TP=4 vs TP=8) help single-user latency?
Yes, TP splits weight reads across more HBM bandwidth so single-stream ITL drops, but NVLink all-reduce adds communication overhead per layer. Use the smallest TP that fits your weights + KV cache for best cost per token.
All calculations run locally in your browser. Published hardware specs, model architectures, and API rates are planning baselines; verify against live profiling and current provider rate cards before committing cluster spend.