Ollama made the first part easy: one pull, and the model runs on your laptop behind a local API. Then a teammate wants the endpoint, an internal app starts calling it, and the first token arrives later and later because requests queue up.
Ollama is a local runner, vLLM a production serving engine, and they can serve different stages of a deployment. This comparison covers how they differ, what the benchmarks measured, how to migrate, and what changes under real traffic. Our platform, Tensormesh Platform, runs vLLM for persistent cache reuse to improve performance and reduce cost (more on that later!).
vLLM vs Ollama: the short answer
Ollama is a local model runner: a one-line install, a library of ready-to-pull models, and an HTTP API on your machine, running on CPUs, Apple Silicon, NVIDIA, and AMD. vLLM is an inference engine for serving many concurrent users on GPUs, built on PagedAttention and continuous batching, with multi-GPU and multi-node parallelism. Build with Ollama; serve with vLLM.
| Ollama | vLLM | |
|---|---|---|
| Built for | One developer, local development | Many concurrent users, production workloads |
| Best hardware | Laptops, Macs, CPUs, single GPUs | NVIDIA and AMD data center GPUs |
| Concurrency | 1 parallel request per model (default) | Continuous batching, 256 sequences by default on most GPUs |
| Model format | GGUF library models or imported weights | Hugging Face weights and quantized variants |
| Setup effort | Minutes | pip or container, plus flags |
What is Ollama?
Ollama is an open-source tool for running large language models locally: you ollama pull a model, ollama run it, and call an HTTP API on 127.0.0.1:11434. Custom models come from a Modelfile that names a base model and sets parameters such as num_ctx.
Ollama uses llama.cpp as a supported backend, alongside its own engine paths. In May 2025, it added a GGML-based engine for multimodal models; Ollama 0.30 (June 2026) expanded GGUF compatibility through llama.cpp alongside the MLX engine on Apple Silicon. The backend matters when comparing performance and model support.
The library’s gemma4 example uses GGUF at Q4_K_M, and you can import GGUF or Safetensors weights. It runs on NVIDIA, AMD through ROCm, Apple GPUs through Metal, and Vulkan, with CPU as the fallback. It also supports a subset of the OpenAI API: /v1/chat/completions, /v1/completions, /v1/models, /v1/embeddings, and a non-stateful /v1/responses, plus a subset of the Anthropic Messages API on /v1/messages.
Concurrency is where the single-user design shows. OLLAMA_NUM_PARALLEL defaults to 1 request per model. Extra requests wait in a queue of up to 512, after which the server returns a 503, and OLLAMA_MAX_LOADED_MODELS caps loaded models at three times the GPU count (three on CPU), memory permitting. Default context length now scales with VRAM, from 4k under 24 GiB to 256k at 48 GiB and up, although the FAQ still says 4096.
What is vLLM?
vLLM is an open-source inference server and engine built to keep GPUs busy with many requests at once; we cover how vLLM works under the hood separately. PagedAttention stores the KV cache in fixed-size blocks, borrowing virtual memory and paging from operating systems to reach near-zero cache waste. Continuous batching schedules work at each model iteration: finished requests leave, and new ones join between steps instead of waiting for a whole batch. Automatic prefix caching reuses the KV cache of a shared prompt prefix, and tensor and pipeline parallelism split a model across GPUs and nodes.
vllm serve exposes an OpenAI-compatible API on port 8000 and Prometheus metrics on /metrics. You can scrape that endpoint to monitor production serving alongside the rest of your infrastructure.
vLLM runs on more than data center GPUs. Its GPU paths cover NVIDIA CUDA, AMD ROCm, Intel XPU, and Apple Silicon through vLLM-Metal; CPU backends cover x86, ARM AArch64, Apple Silicon, and IBM Z, with hardware plugins for Google TPUs and others. The macOS CPU build remains experimental and requires compilation from source. vLLM-Metal is a community-maintained plugin using MLX. Those installs are for development; the throughput figures quoted here come from batching on accelerators.
vLLM vs Ollama: side-by-side comparison
Both columns reflect vLLM v0.30.0 (released September 22, 2026) and Ollama v0.35.1, current on October 3, 2026.
| Dimension | Ollama | vLLM |
|---|---|---|
| Built for | Local use, minimal setup | High-throughput serving |
| Engine/backend | llama.cpp for GGUF, plus an MLX engine on Apple silicon | Own engine: PagedAttention, continuous batching |
| Model format | GGUF library models (MLX on Apple silicon); imports GGUF and Safetensors | Hugging Face weights; GGUF only via an experimental plugin |
| Hardware | CPU, Apple Metal, NVIDIA, AMD (ROCm), Vulkan | NVIDIA, AMD, Intel XPU, CPUs; TPU and Apple Silicon via plugins |
| Concurrent requests | Parallel slots per model, default 1; queue of 512 | Continuous batching; max_num_seqs default 256 to 1,024 |
| KV cache memory management | Context per slot (length x parallel) | Paged blocks from a pre-allocated pool; prefix caching on by default |
| Multi-GPU / multi-node | Spreads a model across local GPUs if it won’t fit on one | Tensor, pipeline, data, and expert parallelism |
| API | Native /api plus subsets of OpenAI and Anthropic Messages | OpenAI-compatible, plus Anthropic Messages |
| Observability | ollama ps, logs | Prometheus /metrics |
| Switching models | Loads on demand, unloads after 5 idle minutes | One model per server process |
| Setup effort | Installer or one-line script | pip or container, plus flags |
Concurrency: a request queue with parallel slots vs. continuous batching
Where Ollama queues past its parallel slots, vLLM’s scheduler admits sequences up to max_num_seqs, which in v0.30.0 defaults to 256 for the API server on most GPUs and 1,024 on 70 GiB-plus parts other than the A100. That is a ceiling, not a throughput promise.
Memory: per-slot context allocation vs. paged KV cache blocks
Ollama allocates context for each parallel slot: a 2K context with 4 parallel requests becomes an 8K allocation. vLLM pre-allocates a share of GPU memory, set by --gpu-memory-utilization, and hands KV cache out in blocks as sequences grow. The v0.30.0 default is 0.92, so a 48 GB card looks nearly full before the first request.
Model formats: GGUF vs. Hugging Face weights (and what that means for migration)
Ollama works natively with GGUF, a binary format designed for GGML. vLLM loads Hugging Face repositories directly and supports more than 200 model architectures. Its separate GGUF plugin is highly experimental and not yet optimized, so GGUF support shouldn’t be assumed to behave like its primary weight-loading paths.
vLLM vs Ollama performance: what the benchmarks actually measured
The two benchmarks below compare throughput under concurrent load. Their hardware, model precision, and concurrency settings differ, so keep the setup alongside each reported result.
| Benchmark | Hardware and model | Configuration | Load | Reported result |
|---|---|---|---|---|
| Red Hat Developer (updated July 13, 2026) | 1x A100 40GB; Llama 3.1 8B Instruct, uncompressed on both | vLLM 0.9.1, Ollama 0.9.2 at defaults, then Ollama at OLLAMA_NUM_P ARALLEL=32 | GuideLLM 0.2.1, 1 to 256 concurrent users, 300 s per run | Peak 793 vs 41 output tokens per second; P99 latency 80 ms vs 673 ms at peak throughput |
| Robert McDermott (May 27, 2025) | 2x A6000 48GB with NVLink; Qwen3 14B, | vLLM tensor parallel 2; | 1 to 1,000 concurrent requests | vLLM up to 3.23x more requests per |
| FP16 on Ollama, BF16 on vLLM | Ollama at 32 parallel | second at 128 concurrent; Ollama flat near 22 requests per second from 32 concurrent |
vLLM outperforms Ollama in both tests, but the gap moves with hardware, model, and tuning: roughly 19x between Red Hat’s reported peaks on one A100, about 3x on two A6000s against an Ollama tuned to 32 slots. Neither predicts your deployment.
In Red Hat’s default run, above 16 concurrent users, vLLM’s inter-token latency rose while Ollama’s stayed low, because Ollama was holding requests in its queue (high time to first token) rather than batching them. Tuned to 32 slots, the highest stable value on that A100, Ollama’s inter-token latency turned erratic. Yet every Ollama request in McDermott’s test succeeded, even at high concurrency.
Red Hat’s test used an Ollama default of four parallel requests. That was Ollama 0.9.2, and today’s FAQ says 1, so an out-of-the-box Ollama now queues sooner than the one Red Hat measured. Benchmark your own workload with GuideLLM or our tmesh benchmark CLI (pip install tmesh), which replays multi-user traffic over repeated long contexts against an OpenAI-compatible endpoint.
When to use Ollama, when to use vLLM (and where llama.cpp and SGLang fit)
The Ollama vs vLLM decision comes down to how many people share the hardware at once.
| Situation | Pick | Why |
|---|---|---|
| Solo developer on a laptop or Mac | Ollama | One-line install, Metal, and CPU |
| Offline or air-gapped prototyping | Ollama | Pull once, then run local-only with OLLAMA_NO_CLOUD=1 |
| Two to four people, each with a GPU | Ollama, one instance each | Nothing shared to batch |
| Shared GPU server, 5+ concurrent users | vLLM | Scheduler sized for hundreds of sequences |
| Customer-facing API with a latency target | vLLM | Higher throughput under load in both benchmarks |
| Model that needs several GPUs or nodes | vLLM | Tensor and pipeline parallelism |
| CPU-only box | Ollama or llama.cpp | Quantized GGUF suits CPUs; vLLM also offers basic inference and serving on x86 CPUs |
| Prometheus metrics and Kubernetes deployment | vLLM | /metrics and a Kubernetes guide |
The crossover depends on model size, prompt length, hardware, and latency budget. Rising time to first token with modest GPU utilization can indicate queueing; check queue depth and parallel-slot utilization before deciding to change engines.
Where llama.cpp fits
Choosing between Ollama and llama.cpp is choosing how much packaging you want. llama.cpp is plain C/C++ aimed at inference with minimal setup on a wide range of hardware. Its server sizes parallel slots automatically, keeps continuous batching on by default, serves OpenAI-compatible routes, and adds Prometheus metrics with --metrics. The vLLM vs llama.cpp choice is portability against scale: llama.cpp for CPUs, edge devices, and quantized GGUF on mixed hardware, vLLM for batched GPU serving with Hugging Face weights.
Where SGLang fits
SGLang is another open-source engine built for production serving, and its runtime adds RadixAttention for KV cache reuse across requests that share prefixes. In an SGLang vs vLLM vs Ollama decision, Ollama drops out once sustained concurrent traffic outgrows its parallel slots, and the rest depends on workload shape, which we cover in how vLLM compares with SGLang.
Moving from Ollama to vLLM: what changes
The API call barely changes
Both speak OpenAI-style chat completions, so most code changes two values: the base URL and the model name, from an Ollama tag to a Hugging Face repository ID. Here’s an example with Qwen3-4B-Instruct-2507, an ungated Apache 2.0 model both tools serve:
This client-side example assumes the OpenAI Python package and a running server with the named model available.
from openai import OpenAI
# Local: Ollama requires an api_key value but ignores it
client = OpenAI(base_url="http://localhost:11434/v1/", api_key="ollama")
model = "qwen3:4b-instruct-2507-fp16"
# Production: vLLM's OpenAI-compatible server (v0.30.0)
# client = OpenAI(base_url="http://vllm.internal:8000/v1", api_key="<your --api-key value, if set>")
# model = "Qwen/Qwen3-4B-Instruct-2507"
reply = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Summarize this support ticket."}],
)Two details bite after the swap. vLLM applies the model repository’s generation_config.json sampling defaults unless you launch with --generation-config vllm. Ollama’s OpenAI endpoint can’t set context size. The value in your Modelfile becomes the --max-model-len server flag. Endpoint-by-endpoint gaps are in our guide to vLLM’s OpenAI-compatible server.
The model files change
When you migrate to vLLM, GGUF files give way to Hugging Face weights, in BF16 or a quantized variant vLLM supports. Re-run your evaluations after the switch, because a Q4_K_M GGUF and a BF16 checkpoint of the same model can answer differently.
The operating model changes
Ollama loads a model when a request asks for it and unloads it after five idle minutes. vLLM holds its GPU memory reservation from startup, serves one model per server process, and is restarted or replicated to change models. You deploy vLLM in containers or on Kubernetes, scrape /metrics, and size concurrency for your traffic:
# Laptop
ollama pull qwen3:4b-instruct-2507-fp16
# GPU server: --max-model-len caps the 262K native context so a full-length request's KV cache fits
vllm serve Qwen/Qwen3-4B-Instruct-2507 --max-model-len 32768 \
--gpu-memory-utilization 0.92 --max-num-seqs 256Once users share that server, repeated prompt prefixes can add prefill work unless the cache retains matching KV state.
Why KV cache reuse starts to matter in production
On a laptop, the cache serves one user
One user, short sessions, no fleet to share with. On Apple silicon, Ollama’s MLX engine already reuses its cache across conversations that share a system prompt, and when a prefix does get recomputed, only you wait.
In production, the same context gets recomputed for every user
System prompts, retrieval-augmented generation (RAG) documents, agent tool definitions, and chat history repeat across requests. Every repeat requires prefill work, adds to time to first token, and occupies KV cache memory while the request runs. Forty users asking about one policy document means forty prefills of the same pages unless something keeps the result.
What vLLM gives you out of the box
vLLM’s automatic prefix caching is that something: a request that shares a prefix with an earlier one reuses its KV cache and skips that computation, and it is on by default for models that support it. The benefit stays in prefill: decode still generates each output token, and requests with no shared prefix get no reuse. The cache also shares pre-allocated GPU memory with active requests, and when new blocks are needed, the least recently used cached blocks are evicted. By default, a second replica never sees the first one’s cache. vLLM can offload KV cache to CPU memory or hand it to a connector such as LMCache, but you configure and run that layer yourself.
Measure this before you buy anything. vLLM exports vllm:prefix_cache_hits_total and vllm:prefix_cache_queries_total as token counters, so take the hit rate over a window: sum(rate(vllm:prefix_cache_hits_total[5m])) / sum(rate(vllm:prefix_cache_queries_total[5m])). vllm:kv_cache_usage_perc shows how much of the KV pool running requests hold.
A low hit rate with usage to spare suggests prompts rarely share an exact prefix; a low rate with usage near 100% suggests reusable blocks are evicted before the next request arrives.
Check prompt templates and request routing before you add capacity.
Going past GPU memory
Our platform manages a cache layer for vLLM that extends beyond one GPU’s memory and one replica. It is not a serving engine and does not replace vLLM; it runs beneath it, on Kubernetes with NVIDIA or supported AMD Instinct GPUs through ROCm. It manages three tiers: GPU memory for active use, host memory for the hot set, and filesystem-backed storage for a larger cache. State saved outside a pod can be reused after that pod restarts. Cross-node sharing, which we currently have in Preview in v1.0.0, lets one node retrieve compatible cached work from another instead of recomputing it.

Three limits apply. Our platform works with vLLM; it does not cache Ollama or llama.cpp traffic, SGLang support is next rather than available today, and it does not attach to models reached only through a hosted provider’s API. We were founded by the creators of LMCache, the open-source project our platform is built on; its team’s starter guide runs vLLM plus LMCache on a MacBook for development.
Key takeaways
vLLM’s continuous batching admits new requests between model steps, making it an option when concurrent traffic exceeds Ollama’s parallel slots or latency budget. The two benchmarks favor vLLM under their tested loads, but their different setups produce different gains. Measure on your hardware before using a reported multiplier.
After choosing an engine, track how often requests share a prefix and how much of it hits the cache. Reuse skips prefill for the matching tokens.
Contact our team to discuss KV cache reuse for your vLLM deployment. To try it hands-on, the getting-started guide covers prerequisites and installation methods.
Frequently asked questions
Which is better, Ollama, vLLM, or SGLang?
It depends on concurrency. Ollama suits local, single-user work on laptops, Macs, and CPUs. vLLM and SGLang are production LLM serving engines; vLLM documents 200+ model architectures, while SGLang’s RadixAttention targets traffic with heavily shared prefixes.
Is vLLM faster than Ollama?
Under concurrency, yes, in both benchmarks that publish their setup: 793 vs 41 peak output tokens per second on one A100 (Red Hat), up to 3.23x on two A6000s (McDermott). The gap depends on load; McDermott’s largest came at 128 concurrent requests.
Can vLLM run on a Mac or without a GPU?
Yes. vLLM has CPU backends for x86, ARM, Apple silicon, and IBM Z, with basic inference and serving on x86. The macOS build is experimental and compiled from source, Apple GPUs need the community vLLM-Metal plugin, and the benchmarks in this post ran on GPUs.
Is there something better than Ollama?
For local use, Ollama is a sound default, and llama.cpp gives more control with less packaging. For sustained concurrent traffic, vLLM or SGLang fits better. Ollama serves a fixed number of parallel slots per model, 1 by default, and queues the rest.
Which is faster, llama.cpp or Ollama?
It depends on the code path. Ollama runs GGUF models through llama.cpp, so most differences come from configuration: build flags, context length, parallel slots, and quantization. On Apple Silicon, Ollama’s MLX engine is a separate path. Compare them with identical settings.
Is anythingllm better than Ollama?
They do different jobs. AnythingLLM is a full-stack application for chatting with documents and running agents. It needs a model backend, which can be
Ollamaor a vLLM server. Choose the application for its workflow and the backend for how you want to run inference.Can I use the same code for Ollama and vLLM?
Mostly. vLLM and Ollama both expose OpenAI-style
/v1/chat/completions, so the OpenAI client works with a new base URL and model name. Check sampling defaults and any Ollama-only/apicalls first.