Three Popular Ways to Serve Open Models on Your Own GPU

Anyone who runs language models on their own NVIDIA hardware eventually meets the same three names: vLLM, llama.cpp and Ollama. Builders with modest setups, such as two mid-range 16 GB cards, often benchmark all three with the same models and come away surprised by how differently they behave. One engine is fastest for a single chat, another handles many requests at once, and the third is the easiest to install.
This comparison is for people choosing an engine for a home server, a small team box or a development workstation. It explains what each tool is built for, where each one shines and struggles, and which questions decide between them. It deliberately avoids quoting benchmark numbers, because they change with every release, model and driver version.
All three can expose an OpenAI-compatible API, which means your application code can stay the same whichever engine you choose. That makes the decision less permanent than it seems.
Frequently asked questions
What is an inference engine?
It is the software that loads a model's weights onto your hardware, processes prompts, generates tokens and usually offers an HTTP API. The engine decides how memory is managed, how requests are batched and which model formats you can use.
How does Ollama differ from llama.cpp?
Ollama is built on top of llama.cpp's core libraries and adds a model library, simple commands, automatic downloads and a background service. llama.cpp gives more direct control over flags and builds, while Ollama trades some of that control for convenience.
Which engine is better for many users at once?
vLLM is designed for serving many concurrent requests efficiently, using continuous batching and paged memory for the KV cache. llama.cpp's server supports parallel slots too, but vLLM is generally the stronger choice when throughput across many users matters most.
Which formats does each engine use?
llama.cpp and Ollama use the GGUF format with many quantization levels. vLLM works mainly with Hugging Face style checkpoints and GPU-oriented quantization formats. That difference often decides which engine you use for a specific model.
Can these engines use more than one GPU?
Yes. vLLM supports tensor parallelism and pipeline parallelism across GPUs. llama.cpp can split layers or tensors across multiple GPUs and offload part of a model to the CPU. The efficiency of each approach depends on the interconnect and the model.
Which one runs a model that does not fit in VRAM?
llama.cpp and Ollama are the practical choice there, because they can keep some layers on the CPU and system RAM. vLLM is built around keeping the model on GPUs, and its offloading options are more limited and situational.
Do I need Docker for vLLM?
No, but many users run it from the official container image because it bundles matching CUDA libraries. Installing with pip is also possible if your Python and driver versions line up.
Is there a clear winner?
Not for everyone. vLLM tends to win on concurrent throughput, llama.cpp on flexibility and hardware coverage, and Ollama on ease of use. Your workload and patience for configuration decide the winner.
What each project was built for
Understanding the original goal of each project explains most of their differences. vLLM came from research into serving models at scale, so its design centres on keeping many requests flowing through a GPU at once. llama.cpp began as a way to run models efficiently on ordinary hardware, including CPUs and laptops, and grew to support many GPU backends. Ollama set out to make local models as easy to run as a single command.
vLLM: throughput first
Its paged attention approach stores the KV cache in small blocks, similar to virtual memory pages, so many conversations can share GPU memory without waste. Combined with continuous batching, that lets it keep the GPU busy while requests arrive and finish at different times.
llama.cpp: runs almost anywhere
Written in C and C++, it supports CUDA, other GPU APIs and plain CPUs. Its quantization formats let you squeeze models into limited memory, and its server mode exposes a compatible API with many tuning flags.
Ollama: convenience as a feature
Ollama packages models with sensible defaults, handles downloads and runs as a service. For a developer who wants a model running in five minutes, that convenience is the main reason to choose it.
Installation and first run
Ollama is usually the quickest: install it, pull a model, and it is available on a local port. llama.cpp requires either a pre-built binary or a build with CUDA enabled, then downloading a GGUF file and launching the server with the flags you want. vLLM needs a compatible Python environment or its container image, a supported GPU and a model in a format it understands.
Developers who are new to local AI often stall on driver and CUDA mismatches with vLLM, while the same model runs on Ollama right away. That is not a sign that vLLM is worse, only that it expects a more carefully prepared environment.
Keep the API shape constant
Because all three speak the OpenAI format, write your application against /v1/chat/completions and treat the engine as a replaceable backend. Switching later then means changing a base URL and a model name.
# Ollama: pull and run a model, then call its OpenAI-compatible API
ollama pull <model-name>
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "<model-name>", "messages": [{"role": "user", "content": "Hello"}]}'
# llama.cpp: start the server with a GGUF file, all layers on the GPU
./llama-server -m model.gguf -ngl 99 -c 8192 --port 8080
# vLLM: serve a Hugging Face checkpoint
vllm serve <org>/<model> --max-model-len 8192 --port 8000
Single-user speed
For one person chatting with one model, the differences are smaller than marketing suggests. Token generation is mostly limited by memory bandwidth, and all three engines can make good use of it. Results vary by model, quantization and version, so the only reliable answer is a test on your own hardware.
Builders who benchmark the same models across engines commonly find that llama.cpp-based tools are very competitive for single streams, especially with quantized models, while vLLM pulls ahead on prompt processing and when several requests run together.
Quantization levels are not identical
A 4-bit GGUF and a 4-bit GPU-format checkpoint are not the same thing. Their quality and speed differ, so comparing engines with "the same model" in different formats compares formats as much as engines.
Measure both phases
Record prompt processing speed and generation speed separately. An engine that is slower at generation may still feel faster in a coding tool that sends long prompts, which is explained in the article on prefill speed.
Many users and agents
Concurrency is where the engines separate most clearly. Coding agents, multi-user chat front-ends and batch jobs send many requests at once. vLLM's scheduler is built for this, and total throughput across requests can grow substantially as concurrency rises.
llama.cpp's server can run several parallel slots, splitting the context budget between them. It handles a handful of users well. Ollama can also serve parallel requests, with settings to control how many run at once and how many models stay loaded.
Prefix caching for agents
Agents often resend the same long system prompt and tool definitions. Engines with prefix caching reuse the processed prompt, cutting time to first token dramatically. vLLM has this built in, and llama.cpp offers prompt caching per slot.

Memory handling and large models
If your model barely fits, the engines behave differently. vLLM pre-allocates a share of GPU memory for the KV cache, controlled by a utilisation setting, and fails to start if the model and minimum cache do not fit. llama.cpp lets you choose how many layers go on the GPU and keeps the rest on the CPU, trading speed for the ability to run at all.
For people with one consumer card who want to try a model slightly too big for it, that flexibility makes llama.cpp or Ollama the practical starting point. The article on KV cache offloading explains another way to stretch memory.
Context length is a memory decision
Setting a very long maximum context in any engine reserves memory for it. If you rarely need long contexts, a smaller setting leaves room for a larger model or more concurrent users.
Multi-GPU splits
With two cards, vLLM's tensor parallelism splits each layer across both GPUs, which works best with fast interconnects. llama.cpp's layer split is more tolerant of slower links but does not always use both cards at full speed.
Model support and update pace
New model architectures usually arrive in each engine at different times. Sometimes vLLM supports a new release on day one because the model's authors contributed the code; sometimes llama.cpp's community adds it quickly with GGUF conversions. Ollama follows llama.cpp and adds models to its library.
Performance also changes between versions. It is common for an engine update or a new container image to improve speed on a specific model noticeably, so pin versions in production and re-test after upgrades.
Pin and record versions
Write down the engine version, driver, CUDA version and model file hash for any setup you rely on. When performance changes, you will know what changed.

Choosing by situation
Most decisions come down to a few situations. Match yours and start there; you can always switch later.
Community forks add another layer. Some builders run patched versions of an engine that add support for a specific model, a new quantization or a faster kernel before the main project merges it. Forks can deliver impressive gains on a particular setup, but they may lag behind on security fixes and general improvements. If you depend on one, keep a note of why you chose it and check periodically whether the main release has caught up, so you can return to the better-maintained path.
Mixing engines is normal
Plenty of people run Ollama on a laptop for quick tests and vLLM on a server for shared use. With a common API format, the same scripts work against both.
- First steps on one GPU, want results today: Ollama.
- Model slightly too large for VRAM, or a mix of CPU and GPU: llama.cpp.
- Fine control over quantization and sampling flags on modest hardware: llama.cpp.
- Several users, coding agents or batch jobs on capable GPUs: vLLM.
- Multi-GPU server with fast interconnects and standard checkpoints: vLLM.
Where a hosted endpoint fits in
Not every task needs your own engine. When you want to test prompts before your hardware is ready, or need a second backend while your server is busy, a hosted OpenAI-compatible API can stand in. The keyless API on this site serves an independent open-weight model, free-ai, with no account required.
To be clear about what it is: APIFreeNVIDIA is not affiliated with NVIDIA, and free-ai is neither an NVIDIA model nor served through NVIDIA's platforms. It has fixed limits per IP, including one request per second and two parallel requests, so it suits tests and light use rather than replacing a multi-user vLLM server. See the guide on switching between local and hosted backends for a simple pattern.
When your own engine clearly wins
Private data that must not leave your network, high concurrency, custom models or fine-tunes, and guaranteed availability all favour running your own engine. A free shared endpoint offers none of those guarantees.

Send a prompt from the chat box on the home page: no key, no account and no card, just a quick look at how free-ai answers.