vLLM vs llama.cpp comes down to who you are serving. vLLM batches many simultaneous requests on data center GPUs, so it wins on total throughput. llama.cpp runs one quantized GGUF model efficiently on almost any hardware, including CPUs and Macs, so it wins for one person on a laptop or consumer GPU. SGLang is the other big GPU serving engine (Apache 2.0); its RadixAttention reuses the KV cache across requests that share a prefix, such as agent loops and multiturn chat. Teams serving an API on NVIDIA or AMD GPUs should test vLLM and SGLang side by side; individuals should start with llama.cpp or a wrapper like Ollama.

Versions checked November 19, 2026: vLLM v0.34.0 (November 16), SGLang v0.5.23 (November 2), and llama.cpp v1.0.0 (November 13) with rolling builds up to b12549.

vLLM vs llama.cpp vs SGLang vs Ollama at a glance

ItemvLLMSGLangllama.cppOllama
Written inPython and PyTorch, with custom kernelsPython and PyTorch, with custom kernelsC and C++Go, with llama.cpp and MLX engines
LicenseApache 2.0Apache 2.0MITMIT
Latest release (checked November 19, 2026)v0.34.0, November 16v0.5.23, November 2v1.0.0, November 13, plus rolling b buildsv0.40.16, November 9
KV cache ideaPagedAttention (paged blocks)RadixAttention (prefix tree reuse)Slots with prompt cacheInherits llama.cpp
Sweet spotHigh throughput multiuser GPU servingHigh throughput serving, agent workloads, RL rolloutsLocal and edge inference on any hardwareEasy local model server
Typical model formatHugging Face safetensors, plus FP8, AWQ, GPTQ, GGUF and moreHugging Face safetensors and quantized variantsGGUFIts own library, GGUF imports, MLX on Macs
Start commandvllm serve <model>sglang serve <model>llama serve -hf <repo>ollama run <model>
Default port800030000 in the official examples993111434
OpenAI compatible APIYesYesYesYes
CPU only useSupported, but not its focusSupported on some CPUsA core strengthYes

How vLLM works and why it is fast

vLLM is "a fast and easy to use library for LLM inference and serving." Its signature idea is PagedAttention, introduced in the 2023 paper Efficient Memory Management for Large Language Model Serving with PagedAttention. The KV cache, the per request memory that grows with every token, is stored in fixed size blocks, much like an operating system pages memory. The paper reports near zero wasted KV cache memory and two to four times higher throughput than the systems it compared against at the same latency.

vLLM's README adds continuous batching, chunked prefill, prefix caching, speculative decoding, several kinds of parallelism, tool calling and multi LoRA serving. It loads models from the Hugging Face Hub, supports more than 200 architectures, and runs on NVIDIA, AMD and Intel GPUs and on many CPUs, with plugins for TPUs and others.

uv pip install vllm
vllm serve Qwen/Qwen3-8B
# OpenAI-compatible server on http://localhost:8000

What changed in vLLM 0.34.0

The November 16 release changes defaults that matter for anyone comparing it with llama.cpp. The KV cache is now sized from the GPU memory actually free after warmup, and gpu_memory_utilization defaults to 1.0, so the release notes advise removing that setting from most configs (set 0.9 again only to share the GPU). The old Model Runner V1 is gone, the default KV block size moves from 16 to 64, and huggingface_hub 2.0 or newer is required. Wheels and images stay on CUDA 13.0 with PyTorch 2.14.0, and CPU wheels for x86_64, Arm and macOS are published with each release. New models include Mistral Large 4; see our guide to running Mistral Large 4 locally.

Per the vLLM quickstart, one server process hosts one model, so several models means several processes behind a router.

How llama.cpp works and why it is everywhere

llama.cpp is plain C and C++ with no required dependencies. It targets almost every backend: CUDA, HIP for AMD, Metal for Apple Silicon, Vulkan, SYCL for Intel, many CPUs and more. Its strength is running quantized GGUF models, from roughly 1.5-bit to 8 bit, with CPU plus GPU hybrid inference when a model does not fit in VRAM.

Its built in server has parallel slots, continuous batching, function calling, OpenAI compatible routes, a router mode for several models and a web UI.

llama serve -hf ggml-org/gpt-oss-20b-GGUF
# OpenAI-compatible server and web UI on http://127.0.0.1:9931

Where SGLang fits

SGLang is the other major open source serving engine, released under Apache 2.0 and aimed at agentic workloads, RL rollouts and large scale serving. The name stands for Structured Generation Language; LMSYS introduced it in January 2024 for apps that make many related model calls. RL post training frameworks such as verl, slime and AReaL use it to generate rollouts (our GRPO vs PPO guide explains why rollout speed matters there). On Macs it runs through Metal and MLX, and SGLang Diffusion serves image models such as FLUX 3 Klein.

How RadixAttention works

Every request has two stages. Prefill computes attention keys and values for the whole prompt; decode then generates tokens one at a time and reuses those stored values, the KV cache. Agents and chat apps repeat themselves: every call resends the same system prompt and tool definitions plus a history that only grows. SGLang's original paper answered that with RadixAttention.

As Red Hat Developer describes it (October 14, 2026), SGLang stores computed KV cache in a radix tree keyed by token prefix. A new request walks the tree, reuses everything that matches and computes only the new part, and branches that have not been used recently are evicted first. Cache aware scheduling runs requests that share a prefix close together, so the cached branch is still in memory when they need it. Today both engines also offer prefix caching, continuous batching, chunked prefill and speculative decoding.

How to run SGLang (Docker or uv)

The SGLang quickstart targets Linux with an NVIDIA GPU and a CUDA 13 compatible driver. With Docker and the NVIDIA Container Toolkit set up:

docker pull lmsysorg/sglang:latest
docker run --rm --gpus all --ipc=host -p 30000:30000 \
  lmsysorg/sglang:latest \
  sglang serve Qwen/Qwen3-0.6B --host 0.0.0.0 --port 30000

Without Docker, uv pip install --prerelease=allow sglang in a Python 3.12 environment, then run the same sglang serve command. Wait for "The server is fired up and ready to roll!", then send an OpenAI style request to http://localhost:30000/v1/chat/completions. For model specific flags, the SGLang cookbook gives a launch command per model and GPU; our Qwen 3.6 guide, for example, uses SGLang's --reasoning-parser qwen3.

What is new in SGLang v0.5.23

The v0.5.23 release notes (November 2, 2026) add opt in Paged Experts, which runs mixture of experts models larger than GPU memory on one consumer GPU (the project says up to 30x faster than CPU offload), plus a low latency decode mode for DeepSeek-V4.1-Flash, LoRA on FP8 and NVFP4 MoE models, TPU7x support and a CUDA 13 Docker image.

These are the project's own numbers on its own hardware, so measure on yours. For a newer engine in the same space, see our DeepInfer explainer, and for one specific box, our SGLang vs vLLM on DGX Spark guide.

SGLang vs vLLM benchmarks: what they show and miss

The Red Hat article samples Modal's LLM Engineer's Almanac, which tested both engines with default settings on NVIDIA GPUs. For Llama 3.1 8B on one H100, it took the highest request rate at which each engine still returned the first token in under one second at p95:

Workload (tokens in / out)vLLMSGLang
1024 / 128 (RAG, summaries)17.08 req/s16.88 req/s
128 / 1024 (code generation)5.34 req/s6.50 req/s
2048 / 2048 (long chat)1.23 req/s1.25 req/s

Modal's conclusion, as Red Hat reports it, is that the two perform comparably out of the box. The catch: the test prompts are random chunks of Pride and Prejudice, so very few requests share a prefix. It does not measure the prefix reuse where RadixAttention earns its keep. Red Hat is also vLLM's largest corporate contributor, so read its framing with that in mind. Run your own traffic on your own GPUs with a load tool such as GuideLLM before you choose.

Where Ollama fits

Ollama is a convenience layer for a developer laptop or a small internal box, not a high throughput multi GPU engine. Ollama vs llama.cpp vs LM Studio covers the local side; Ollama vs vLLM covers when to move to a server.

vLLM vs llama.cpp performance: throughput vs latency

Most "which is faster" arguments mix up two different measurements.

  • Single user speed is how quickly one person sees tokens appear. On one consumer GPU with a quantized model, llama.cpp is very competitive, and it can run models that would not fit in vLLM's default 16 bit format at all.
  • Aggregate throughput is the total tokens per second across many users. Here, vLLM and SGLang's batching and KV cache management let one GPU serve far more requests at once.

So a one prompt test on a gaming PC tells you little about serving 50 users on an H100.

Hardware and model format considerations

  • Memory headroom. vLLM claims the GPU's free memory for its KV cache by default (all of it after warmup since v0.34.0); llama.cpp allocates what the model and context need.
  • Quantization. vLLM supports FP8, MXFP4, NVFP4, INT8, INT4, GPTQ, AWQ, GGUF and more, but its fastest paths are the GPU native formats. llama.cpp's sweet spot is GGUF k-quants and i-quants; see our GGUF quantization guide.
  • Apple Silicon. llama.cpp and MLX based tools are the natural fit on a Mac. vLLM and SGLang list Apple Silicon support, but the Mac is not their main target.
  • Model support. vLLM and SGLang usually support new architectures quickly, since they build on Transformers style model definitions in PyTorch. llama.cpp implements each architecture in C++, often within days for popular models.

Pros and cons

vLLM

  • Pros: top tier multiuser throughput; broad GPU and quantization support; multi LoRA serving; OpenAI and Anthropic compatible APIs; Apache 2.0.
  • Cons: heavy PyTorch and CUDA install; aimed at GPUs; one model per process; overkill for one user.

SGLang

  • Pros: RadixAttention prefix reuse suits agents and multiturn chat; level with vLLM in independent default tests; popular for RL rollouts.
  • Cons: similar heavy dependencies to vLLM; fast moving, so pin versions.

llama.cpp

  • Pros: runs nearly anywhere; tiny footprint; excellent quantization; hybrid CPU and GPU offload; capable server with batching and router mode; MIT license.
  • Cons: lower peak throughput than vLLM or SGLang on large GPU servers; GGUF conversion needed; fewer distributed serving features.

Which should you choose?

  1. Personal use on a laptop, desktop or Mac: llama.cpp, or Ollama or LM Studio on top of it.
  2. A small team sharing one consumer GPU: llama.cpp's server with several parallel slots is often enough and much simpler to run.
  3. A product or internal API on data center GPUs: vLLM, and benchmark SGLang against it.
  4. Agent heavy traffic with long shared prompts, or RL training rollouts: give SGLang a serious look.
  5. Serving many fine tuned LoRA adapters on one base model: vLLM's multi LoRA support.

Our guide to run gpt-oss locally serves one model with Ollama, llama.cpp and vLLM; gpt-oss or Qwen models make good test subjects. Before buying hardware for either engine, size the memory with our VRAM guide.

FAQ

vLLM vs llama.cpp on a DGX Spark: which is better?

Both run on it. vLLM has an NVIDIA playbook container built for the Spark's ARM64 CPU and CUDA 13, with recipes for linking two or more Sparks, so it fits serving several users. llama.cpp publishes CUDA 13.5 builds for ARM64 Linux and suits one person running quantized GGUF models. Our SGLang vs vLLM on DGX Spark guide covers the serving side.

What is SGLang used for?

Serving open weight language, vision and diffusion models behind an OpenAI compatible API on GPU servers: high traffic APIs, agent workloads that reuse long prompts, and reinforcement learning rollouts. It is free under Apache 2.0 and listens on port 30000 in the official examples.

Is SGLang faster than vLLM?

Not by default on independent requests. In Modal's tests of Llama 3.1 8B on an H100, the two were within 2% on summaries and long chat, and SGLang served about 22% more requests per second on code generation. SGLang tends to pull ahead when many requests share a long prefix, which those tests did not measure. Run your own model, prompt lengths and concurrency on your own GPUs before you choose.

SGLang vs Ollama: which should I use?

Use Ollama on a single machine where easy setup matters: ollama run downloads and starts a quantized model in one step. Use SGLang to serve many users on GPU servers, where batching and prefix caching raise total throughput.

Does SGLang run on AMD GPUs, a DGX Spark or a Mac?

Yes. Its README lists AMD Instinct MI300X, MI325X, MI350X and MI355X, NVIDIA hardware from RTX 30 series cards to B300, including DGX Spark and Jetson Orin, plus Google TPU v6e and v7 (through SGLang-TorchTPU and SGL-JAX), Intel, Huawei Ascend, Moore Threads and Apple Silicon Macs through Metal and MLX. NVIDIA GPUs remain the main target, so check the cookbook for your model and hardware pair.

Is vLLM faster than llama.cpp?

For many concurrent users on data center GPUs, yes: batching and PagedAttention give vLLM much higher total throughput. For one user on consumer hardware with a quantized model, llama.cpp is often just as fast or faster, and it runs on hardware vLLM does not target. Test with your own traffic, as the throughput section above explains.