Dev tools
vLLM vs Ollama vs llama.cpp: Which Should You Use?
vLLM vs Ollama vs llama.cpp: vLLM serves many users fast on GPUs, Ollama is the easiest local option, llama.cpp runs anywhere. Speed, setup and picks.
The short answer to vLLM vs Ollama: use Ollama when you want to run a model on your own computer with almost no setup, and use vLLM when you need to serve a model to many users at once on data-centre or workstation GPUs. llama.cpp, the engine Ollama grew out of, sits in between: it's a lightweight, portable runtime that runs on almost any hardware, including CPUs and Macs, and gives power users more control. For one person chatting with a model, all three feel similar; under load from many users, vLLM is in a different league.
This guide compares vLLM vs Ollama vs llama.cpp at a glance, explains how each works, covers vLLM vs Ollama performance with real benchmark results, vLLM vs llama.cpp and Ollama vs llama.cpp, model formats, hardware, a worked capacity example, vLLM vs SGLang, and clear picks for different situations.
vLLM vs Ollama vs llama.cpp at a Glance
| Ollama | llama.cpp | vLLM | |
|---|---|---|---|
| Best for | Local use, prototyping, desktop apps | Portable, efficient local inference; edge devices | Serving many users in production |
| Setup | Install app, ollama run a model | Download or build binaries, pick a GGUF file | Python install on Linux with a supported GPU |
| Hardware | Mac, Windows, Linux; CPU or GPU | Almost anything: CPU, Nvidia, AMD, Apple, Vulkan GPUs | Mainly data-centre and workstation GPUs (Nvidia, AMD and others) |
| Model format | GGUF (from Ollama's library or imported) | GGUF | Hugging Face formats (safetensors), GPTQ, AWQ, FP8 and others |
| Many users at once | Limited parallelism | Some parallel slots | Built for it: continuous batching, PagedAttention |
| API | Local REST API plus OpenAI-compatible endpoints | llama-server with OpenAI-compatible API | OpenAI-compatible server |
| Partial CPU offload | Yes | Yes | Limited; designed to fit models in GPU memory |
| Learning curve | Lowest | Medium | Highest |
What Is Ollama?
Ollama is a free tool that makes running open models locally almost as easy as installing an app. You install it on macOS, Windows or Linux, then run a model with one command:
ollama run qwen3:8bOllama downloads the model from its library, picks sensible settings for your hardware, and gives you a chat in the terminal. It also runs a local server (port 11434 by default) with its own API and OpenAI-compatible endpoints, so other apps and code can use the model. It uses quantised GGUF models from the llama.cpp ecosystem, and can split a model between GPU and system memory when it doesn't fit on the GPU.
Strengths: simplicity, a curated model library, good desktop integration. Weaknesses: less control over low-level settings, and it isn't designed to serve large numbers of simultaneous users. Our guide to Ollama vs LM Studio compares it with the other popular desktop option.
What Is llama.cpp?
llama.cpp is an open-source C/C++ project for running language models efficiently on ordinary hardware. It introduced the GGUF file format and the quantisation methods (such as Q4_K_M) that most local tools now use. It runs on CPUs and on a wide range of GPUs through backends for Nvidia CUDA, Apple Metal, AMD, Vulkan and others.
You use it through command-line programs: llama-cli for chatting and llama-server for an OpenAI-compatible HTTP server:
llama-server -m ./models/qwen3-8b-Q4_K_M.gguf --port 8080Strengths: runs almost anywhere, small footprint, fine-grained control over threads, context size, GPU layers and sampling, and it often gets support for new models and hardware first. Weaknesses: more manual setup than Ollama, and less throughput than vLLM under heavy concurrent load.
What Is vLLM?
vLLM is an open-source inference and serving engine that started at UC Berkeley. Its key idea, PagedAttention, manages the memory used for each conversation's context (the KV cache) in small blocks, like an operating system manages memory pages. Combined with continuous batching, which adds new requests to the batch as others finish, it lets one GPU serve many users at once with high throughput.
Per the vLLM docs, you install it with pip (the docs recommend uv pip install vllm --torch-backend=auto for Nvidia GPUs) on Linux and start an OpenAI-compatible server with:
vllm serve Qwen/Qwen3-8BThe server listens on port 8000 by default. vLLM supports Nvidia, AMD, Intel GPUs, Google TPUs and other accelerators, tensor and pipeline parallelism across several GPUs, prefix caching, speculative decoding and many quantisation formats.
Strengths: throughput, scaling across GPUs, production features. Weaknesses: needs a capable GPU with enough memory for the whole model plus cache, heavier setup, slower start-up, and it's not the tool for a laptop.
vLLM vs Ollama Performance
vLLM vs Ollama performance depends on what you measure:
- One user, one request at a time: speed is mostly limited by how fast the GPU can read the model's weights from memory. All three engines are reasonably close here, and llama.cpp is often very efficient for a single user on consumer hardware.
- Many users at once: vLLM's batching lets it process many requests together, so total throughput grows as more users arrive. Ollama and llama.cpp can run a few requests in parallel, but their throughput grows much less.
Benchmarks back this up. In a Red Hat test, vLLM reached a peak of 793 tokens per second against Ollama's 41 under concurrent load on the same hardware. In a separate Red Hat comparison with llama.cpp, vLLM's throughput rose with the number of concurrent users while llama.cpp's stayed roughly flat. Exact numbers depend heavily on the model, quantisation, GPU and settings, so treat any single benchmark as an example, not a law.
Other performance differences:
- Time to first token: vLLM's prefix caching and batching help under load; for a single user, Ollama and llama.cpp respond quickly once the model is loaded.
- Start-up time: Ollama and llama.cpp load a GGUF file quickly; vLLM takes longer to start because it prepares the GPU memory and compiles optimisations.
- Memory: quantised GGUF models in Ollama and llama.cpp often use less memory than the formats vLLM typically serves, which matters on consumer GPUs. Our guide to LLM quantization explains the trade-offs.
vLLM vs llama.cpp
vLLM vs llama.cpp is really a comparison of serving versus running:
- Choose llama.cpp for local inference on mixed hardware: CPUs, Apple Silicon, AMD or Intel GPUs through Vulkan, small devices, or when the model doesn't fully fit in GPU memory and you want to offload some layers to system RAM.
- Choose vLLM when you have GPUs that hold the model and you need to serve many requests efficiently, with features like multi-GPU parallelism and production monitoring.
Model files aren't interchangeable in practice: llama.cpp uses GGUF; vLLM is built around Hugging Face formats and GPU quantisation formats, with only limited GGUF support.
Ollama vs llama.cpp
Ollama vs llama.cpp is a common question because they're related. Ollama grew out of the llama.cpp ecosystem and uses the same GGUF model format and ggml libraries, but adds:
- One-command model downloads from its library.
- Automatic hardware detection and settings.
- A background service and desktop app.
- A simple API and model management (
ollama pull,ollama list, Modelfiles).
What llama.cpp gives you instead: more control, the newest features first, and sometimes better raw speed, because you can tune every setting. Some benchmarks have found native llama.cpp faster than Ollama under concurrent load. A simple rule: start with Ollama; switch to llama.cpp when you hit a setting Ollama doesn't expose or need every bit of performance.
Same Model, Three Ways
A practical comparison of serving one 8B model to an app that speaks the OpenAI API:
| Step | Ollama | llama.cpp | vLLM |
|---|---|---|---|
| Install | Download the installer | Download a release or build from source | Python environment, uv pip install vllm |
| Get the model | ollama pull qwen3:8b | Download a GGUF file (or let llama-server fetch one from Hugging Face) | Downloads from Hugging Face on first vllm serve |
| Start the server | Runs as a background service | llama-server -m model.gguf --port 8080 | vllm serve Qwen/Qwen3-8B |
| OpenAI-style base URL | http://localhost:11434/v1 | http://localhost:8080/v1 | http://localhost:8000/v1 |
| Typical memory for an 8B model | About 5–6 GB at 4-bit | About 5–6 GB at 4-bit | About 16 GB at 16-bit, plus KV cache |
Because all three offer OpenAI-compatible endpoints, you can often develop against Ollama on a laptop and switch the base URL to a vLLM server in production with little code change.
A Worked Capacity Example
Suppose an internal assistant serves 50 employees, with up to 15 using it at the same moment, each answer around 400 tokens.
- Ollama or llama.cpp on one consumer GPU: each request might generate at a good single-user speed, but with 15 people waiting, requests queue or share limited parallel slots. Some users wait many seconds for the first word.
- vLLM on the same GPU (if the model and cache fit): it batches the 15 requests together. Each user's tokens arrive slightly slower than a lone user's would, but total throughput is far higher, so everyone gets answers promptly.
The lesson: for one to a few users, the simpler tools are fine. Once concurrency matters, a serving engine pays off.
Key Settings to Tune
Each engine has a few settings that matter most:
| Engine | Setting | What it does |
|---|---|---|
| Ollama | OLLAMA_NUM_PARALLEL | How many requests one loaded model handles at once |
| Ollama | OLLAMA_CONTEXT_LENGTH | Default context window; larger uses more memory |
| Ollama | OLLAMA_KEEP_ALIVE | How long a model stays loaded after the last request |
| Ollama | OLLAMA_MAX_LOADED_MODELS | How many models can stay in memory at once |
| llama.cpp | -ngl / --n-gpu-layers | How many layers go on the GPU (the rest run on the CPU) |
| llama.cpp | -c / --ctx-size | Context size |
| llama.cpp | -np / --parallel | Number of parallel request slots in llama-server |
| vLLM | --max-model-len | Maximum context length; lowering it frees memory for more users |
| vLLM | --gpu-memory-utilization | Share of GPU memory vLLM may use (0.9 by default) |
| vLLM | --tensor-parallel-size | Split a model across several GPUs |
A common mistake with all three is setting a huge context window "just in case". The KV cache for long contexts eats memory that could serve more users or a bigger model.
Running in Docker
All three have official container images, which simplifies servers:
- Ollama: the
ollama/ollamaimage, with a volume for downloaded models and GPU access enabled. - llama.cpp: server images published by the ggml-org project, such as
ghcr.io/ggml-org/llama.cpp:server, with CUDA and other variants. - vLLM: the
vllm/vllm-openaiimage starts an OpenAI-compatible server; pass the model name and settings as arguments.
On Nvidia GPUs, containers need the Nvidia Container Toolkit so they can see the GPU.
On Unified-Memory Machines
Small boxes with large shared memory, such as Nvidia's DGX Spark and mini PCs with AMD's Ryzen AI Max+ 395, are popular for local AI. On these, llama.cpp-based tools (including Ollama and LM Studio) are the common choice for one person running large quantised models, because they handle GGUF files and partial offloading well. vLLM can run on supported hardware such as the DGX Spark when you need to serve several users, but memory bandwidth limits both: these machines run large models, not fast ones.
Production Concerns Beyond Speed
If you're serving real users, compare more than tokens per second:
- Metrics and monitoring: vLLM exposes Prometheus-style metrics for queue length, latency and cache usage. With Ollama and llama.cpp you'll rely more on your own logging.
- Scaling: vLLM and SGLang support multi-GPU and multi-node setups; Ollama and llama.cpp scale mainly by running more instances behind a load balancer.
- Security: none of them should be exposed directly to the internet without authentication. Put them behind a gateway or reverse proxy with API keys and rate limits.
- Updates: all three move fast. Pin versions in production and test upgrades, since new releases can change defaults or performance.
Hardware and Model Format Differences
- GPU memory: vLLM wants the whole model plus a KV cache in GPU memory. A 16-bit 8B model needs about 16 GB before cache. Ollama and llama.cpp can use 4-bit GGUF files and offload layers to system RAM. Our guide to VRAM for AI shows how to estimate memory.
- Macs: Ollama and llama.cpp are well supported on Apple Silicon. vLLM's docs describe a Metal-based option for Macs, but it's not the main target.
- AMD and Intel GPUs: llama.cpp supports them through several backends; vLLM supports AMD (ROCm) and Intel GPUs too, mainly on Linux.
- Formats: GGUF for Ollama and llama.cpp; safetensors and GPU-oriented quantisations (AWQ, GPTQ, FP8) for vLLM.
vLLM vs SGLang and Other Serving Engines
vLLM isn't the only production engine:
- SGLang is a fast serving framework from the LMSYS team, with RadixAttention for reusing shared prompt prefixes and strong performance on structured output and multi-turn workloads. vLLM vs SGLang benchmarks go back and forth by model and version; both are excellent, so test with your own workload.
- TensorRT-LLM is Nvidia's optimised engine, with top performance on Nvidia GPUs at the cost of more complex setup.
- Hugging Face Text Generation Inference (TGI) is another server option with a long history in production.
- LM Studio is a desktop app, like Ollama, that runs GGUF models through llama.cpp and MLX models on Macs.
Which Should You Use?
| Situation | Pick |
|---|---|
| Trying open models on your laptop or desktop | Ollama |
| Building a desktop app or local prototype | Ollama, or llama.cpp for more control |
| Running on CPU, Mac, mixed GPUs or small devices | llama.cpp |
| Model doesn't fit in GPU memory | llama.cpp or Ollama with offloading |
| Internal tool for a small team | Ollama or llama-server can be enough; move to vLLM if waits grow |
| Production API with many concurrent users | vLLM (or SGLang) |
| Multi-GPU serving of large models | vLLM, SGLang or TensorRT-LLM |
FAQ
What is the difference between vLLM and Ollama?
Ollama is an easy tool for running models locally on a computer, using quantised GGUF models. vLLM is a high-throughput serving engine for GPUs, built to handle many users at once in production. Ollama is simpler; vLLM scales better.
Is vLLM faster than Ollama?
For many users at once, yes, often by a large margin, because vLLM batches requests efficiently. For a single user on one machine, the difference is much smaller, and Ollama or llama.cpp may use less memory.
Is Ollama the same as llama.cpp?
No, but they're related. Ollama grew out of the llama.cpp ecosystem and uses the same GGUF format and ggml libraries, but adds model management, automatic settings and a simple app and API on top.
Can vLLM run on a Mac or CPU?
vLLM is built mainly for GPUs on Linux. Its docs describe a Metal-based route for Apple Silicon and some CPU support, but for Macs and CPU-only machines, llama.cpp, Ollama or LM Studio are usually the better choice.
Should I use vLLM or Ollama for production?
For production with real concurrent traffic, vLLM (or a similar serving engine such as SGLang) is the usual choice. Ollama is great for development, demos and small internal tools with a few users.