How this guide is made. Wandering Giants publishes this guide and sells GPU compute. Other providers are judged on the same criteria, with prices taken from each provider’s own public pricing page (checked November 2026). Prices change often, so check before you buy. Last reviewed 25 November 2026.
Use vLLM to serve an LLM to many users or applications: continuous batching and PagedAttention give it far higher throughput under load. Use Ollama for one person on one machine: one command, GGUF models, modest GPUs. Use TGI mainly if you already run it; Hugging Face has put it in maintenance mode.
- vLLM
- Apache 2.0; continuous batching, PagedAttention, prefix caching, tensor parallelism
- Ollama
- MIT; one-command install, GGUF models, built on llama.cpp-derived engines
- TGI
- Apache 2.0; Rust router, continuous batching; in maintenance mode
- All three
- Expose an OpenAI-compatible chat completions endpoint
- Default ports
- vLLM 8000, Ollama 11434, TGI 80 inside its container
- Best for many concurrent users
- vLLM (or SGLang)
- Best for a laptop or single user
- Ollama (or llama.cpp)
vLLM, Ollama and Hugging Face TGI all take an open model and put an API in front of it, but they were built for different jobs. Picking the wrong one is the commonest reason a self-hosted LLM feels slow under load or painful to set up. This guide compares them on what actually differs: how they handle many users, which models and formats they run, how hard they are to operate, and where each project is heading.
Performance statements here are explained from how each engine works or labelled as estimates; we have not benchmarked them. For background on batching and the KV cache, see the complete guide to LLM inference.
Which should you use? The short answer
Choose by how many concurrent users or processes will call the model.
| Your situation | Use | Why |
|---|---|---|
| One person chatting or testing prompts | Ollama | One install, one pull, works on modest GPUs with 4-bit GGUF |
| An app, team or agent fleet calling one model | vLLM | Continuous batching and paged KV cache keep throughput high under load |
| Already running TGI in production | TGI, while you plan a move | Stable, but in maintenance mode |
| Maximum throughput for RAG or agents with shared prefixes | vLLM or SGLang | Prefix caching; benchmark both |
| CPU-only, Apple Silicon or partial GPU offload | Ollama or llama.cpp | GGUF runs across CPU and GPU |
What is vLLM?
vLLM is an open-source, Apache 2.0 inference and serving engine that started at UC Berkeley. It is now the most widely used engine for serving open models to many users. Its PagedAttention design, described in the vLLM paper, manages the KV cache in fixed-size blocks like virtual memory, so little VRAM is wasted and many sequences fit at once.
- Strengths: continuous batching, PagedAttention, automatic prefix caching, chunked prefill, tensor, pipeline and expert parallelism, speculative decoding, LoRA adapter serving, structured output, tool-call parsers, Prometheus metrics, and broad support for new Hugging Face architectures. Quantised formats include FP8, INT8, AWQ, GPTQ and others, with experimental GGUF support.
- Weaknesses: a heavy Python and CUDA dependency stack. Many flags matter for memory and latency tuning. Startup is slower (loading, profiling, CUDA graph capture), and it is built for servers rather than laptops.
- Hardware: NVIDIA first, plus AMD ROCm, Google TPU, Intel and CPU back ends of varying maturity.
Reference: the vLLM documentation.
What is Ollama?
Ollama is an MIT-licensed tool that makes running an LLM on one machine as easy as ollama run llama3.1. It packages quantised models, mostly GGUF, into a library you pull by name. It manages loading and unloading automatically and serves a native API plus an OpenAI-compatible /v1 endpoint on port 11434. Its engine grew out of llama.cpp, and newer releases include Ollama's own engine for some model families.
- Strengths: the simplest setup of any option, sensible defaults, a curated model library, GGUF quantisation from 2 to 8 bits, CPU and GPU offload, and support for NVIDIA, AMD and Apple Silicon. It runs models of any size class on whatever hardware you have.
- Weaknesses: limited concurrency.
OLLAMA_NUM_PARALLELsets parallel requests per model, and each slot reserves its own context. There is no tensor-parallel scheduling to match vLLM's, fewer tuning controls, and new architectures depend on Ollama or llama.cpp adding them. - Hardware: NVIDIA, AMD, Apple Silicon and CPU.
Reference: ollama.com and its GitHub repository.
What is TGI?
Text Generation Inference (TGI) is Hugging Face's serving engine. It has a Rust router and a Python model server, and it powered Hugging Face's own inference products. It introduced continuous batching to many teams and has a mature feature set. In late 2025 Hugging Face put it into maintenance mode: bug fixes and small changes are accepted, but major development has stopped and the README points to vLLM and SGLang.
- Strengths: a production-hardened router, continuous batching, a Messages API compatible with OpenAI's, tensor parallelism, AWQ, GPTQ and FP8 support, OpenTelemetry tracing and Prometheus metrics, and Docker images for NVIDIA, AMD, Intel Gaudi and AWS Inferentia.
- Weaknesses: maintenance mode means slower support for new model architectures and features. Docker-first, with flags that differ from vLLM's.
- Hardware: NVIDIA, AMD, Gaudi, Inferentia.
Reference: the TGI repository.
How do vLLM, Ollama and TGI compare feature by feature?
| vLLM | Ollama | TGI | |
|---|---|---|---|
| Licence | Apache 2.0 | MIT | Apache 2.0 |
| Primary use | Multi-user serving | Single-machine, single-user | Multi-user serving |
| Continuous batching | Yes | Limited (parallel slots) | Yes |
| Paged KV cache | Yes (PagedAttention) | No | Yes |
| Prefix caching | Yes, on by default in recent releases | Within a slot | Yes |
| Tensor parallelism | Yes | Splits layers across GPUs | Yes |
| Main model format | Hugging Face safetensors | GGUF | Hugging Face safetensors |
| Quantisation | FP8, INT8, AWQ, GPTQ, more | GGUF Q2–Q8, some FP formats | FP8, AWQ, GPTQ, bitsandbytes |
| OpenAI-compatible API | Yes (/v1) | Yes (/v1) | Yes (Messages API) |
| Tool calling | Yes, per-model parsers | Yes, for supported models | Yes |
| LoRA adapters | Yes, many per base model | Via Modelfile | Yes |
| Metrics | Prometheus /metrics | Basic | Prometheus, OpenTelemetry |
| Default port | 8000 | 11434 | 80 in container |
| Project status (Nov 2026) | Very active | Very active | Maintenance mode |
How do they behave with many users?
Concurrency is the deciding difference. An engine that batches well spreads one read of the weights across many users, and decode is memory-bandwidth-bound, so throughput rises nearly in proportion to batch size until KV cache memory runs out.
vLLM schedules every running sequence into each decode step, admits new requests at any step and allocates KV blocks on demand, so memory goes to tokens that exist rather than reserved maximums. Concurrency is limited by --max-num-seqs and by KV memory. When the cache fills, it pre-empts and requeues sequences rather than crashing.
Ollama loads a model with a fixed number of parallel slots (OLLAMA_NUM_PARALLEL). Each slot reserves context memory up front, so 4 slots at an 8k context reserve the KV cache for 32k tokens. Requests beyond the slot count queue. That suits a handful of users but not an API with spiky traffic from many clients.
TGI uses continuous batching with token budgets (--max-batch-prefill-tokens, --max-batch-total-tokens) and a paged KV cache, so it behaves like vLLM in kind under load.
Here is the memory side for Llama 3.1 8B on a 24 GB RTX 4090, KV at 0.13 MB per token (FP16):
| Engine and setup | Weights | KV available (approx.) | 8k-token conversations at once |
|---|---|---|---|
| Ollama, Q4_K_M, 4 slots × 8k | ~4.9 GB | 4.3 GB reserved for slots | 4, fixed (more queue) |
| vLLM, BF16 | 16 GB | ~4 GB pooled | ~3–4 full, more if shorter |
| vLLM, FP8 weights + FP8 KV | 8 GB | ~11 GB pooled at 0.066 MB/token | ~20 full, more if shorter |
These are estimates from the memory arithmetic, not measurements. The point is that pooled, paged memory serves real traffic (mostly short conversations, a few long) far more efficiently than fixed slots. The tokens per second guide shows how batch size turns into throughput and cost.
How fast is each for a single user?
For one user, speed depends mainly on the bytes read per token, so precision matters more than the engine. With the bandwidth rule (tokens/s ≈ 0.6–0.75 × bandwidth ÷ GB per token), Llama 3.1 8B on an RTX 4090 (1,008 GB/s) estimates as follows:
| Engine and precision | GB per token | Single-stream tok/s (est.) |
|---|---|---|
| Ollama, Q4_K_M | ~4.9 | 123–154 (ceiling; small-model overheads apply) |
| vLLM, FP8 | ~8 | 76–95 |
| vLLM or TGI, BF16 | ~16 | 38–47 |
So "Ollama felt faster than vLLM" on a laptop test usually means "4-bit was faster than 16-bit". Compare engines at the same precision, and under the concurrency you actually expect. If quantisation is new to you, see quantisation explained.
How do you set up each one?
The same model on each engine, followed by one client that talks to all three. Llama models are gated, so export HF_TOKEN after accepting the licence on Hugging Face.
vLLM (pip or Docker):
pip install -U vllm
vllm serve meta-llama/Llama-3.1-8B-Instruct --max-model-len 16384 \
--gpu-memory-utilization 0.90 --port 8000
# or with Docker
docker run --gpus all --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
-e HF_TOKEN="$HF_TOKEN" \
vllm/vllm-openai:latest \
--model meta-llama/Llama-3.1-8B-Instruct --max-model-len 16384Ollama:
curl -fsSL https://ollama.com/install.sh | sh
OLLAMA_NUM_PARALLEL=4 OLLAMA_CONTEXT_LENGTH=8192 ollama serve > ~/ollama.log 2>&1 &
ollama pull llama3.1:8bTGI (Docker):
docker run --gpus all --shm-size 1g -p 8080:80 \
-v "$PWD/tgi-data:/data" \
-e HF_TOKEN="$HF_TOKEN" \
ghcr.io/huggingface/text-generation-inference:latest \
--model-id meta-llama/Llama-3.1-8B-Instruct \
--max-input-tokens 8192 --max-total-tokens 16384One client, three servers:
from openai import OpenAI
servers = {
"vllm": ("http://localhost:8000/v1", "meta-llama/Llama-3.1-8B-Instruct"),
"ollama": ("http://localhost:11434/v1", "llama3.1:8b"),
"tgi": ("http://localhost:8080/v1", "tgi"),
}
for name, (base_url, model) in servers.items():
client = OpenAI(base_url=base_url, api_key="not-needed-locally")
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Name three uses of a KV cache."}],
max_tokens=120,
)
print(f"--- {name}\n{r.choices[0].message.content}")For a real comparison under load, point vllm bench serve --backend openai-chat --base-url ... --endpoint /v1/chat/completions at each server with the same prompts and concurrency. It works against any OpenAI-compatible endpoint. To turn the winner into a secure, shareable endpoint, follow building your own open-source LLM API.
What about SGLang, llama.cpp and TensorRT-LLM?
Three more engines are worth knowing about, each for a specific reason.
- SGLang is a high-performance serving engine with RadixAttention prefix caching, a fast scheduler and strong structured-output support. For agent and RAG workloads with heavily shared prefixes, benchmark it against vLLM.
- llama.cpp (
llama-server) is the lightweight C/C++ engine behind GGUF. It is ideal for CPUs, Apple Silicon, partial GPU offload and embedding in other software. - TensorRT-LLM is NVIDIA's compiled-engine approach. It can extract top performance on NVIDIA hardware at the cost of build steps per model and GPU. It is often used through NVIDIA's Triton or Dynamo.
How should you choose?
Match the engine to the reader you are:
- Solo developer exploring models: Ollama. Move to vLLM when someone else needs to use it.
- Startup shipping an AI feature: vLLM behind your own gateway, FP8 weights, one model per GPU, and scale by adding GPUs. See GPU infrastructure for AI SaaS.
- Platform team with an existing TGI estate: keep it running, and test vLLM or SGLang on the same models for the next upgrade.
- Researcher evaluating many models: vLLM for its model coverage and batch inference via its offline
LLMclass. - Privacy-first internal assistant: vLLM on a dedicated GPU, bound to a private network or tunnel.
For a practical walkthrough with vLLM and Ollama, see running Llama on a cloud GPU.
When renting from Wandering Giants Compute fits
Wandering Giants Compute makes the engine choice optional. API mode serves your chosen one-click model with vLLM behind an OpenAI-compatible endpoint and your own key, so you get the multi-user engine without installing it. Root gives you the whole machine to run Ollama, TGI, SGLang or llama.cpp yourself. Here is where each engine fits on our cards:
| GPU | Our price | Ollama (one user) | vLLM (shared endpoint) |
|---|---|---|---|
| RTX 4090 (24 GB) | $1.59/hr | Up to ~32B at 4-bit, short context | 8B–14B in FP8 for a small team |
| L40S (48 GB) | $1.89/hr | 70B at 4-bit, short context | Qwen3 32B AWQ or 30B-A3B FP8 |
| H100 (80 GB) | $4.99/hr | 70B at 4-bit with long context | 70B FP8 for a few users, 32B FP8 for many |
| H200 (141 GB) | $9.09/hr | Overkill for one user | 70B FP8 for a team, long contexts |
Billing is by the minute from prepaid credit, so you can try all three engines on one card for an hour. The machine stops itself when credit runs out.
Frequently asked questions
Is vLLM faster than Ollama?
For many concurrent requests, yes, usually by a wide margin, because vLLM's continuous batching and paged KV cache keep the GPU busy across hundreds of sequences. For a single user, speed depends mostly on model precision and bandwidth; a 4-bit Ollama model can stream faster than the same model in BF16 on vLLM.
Can Ollama handle multiple users?
Yes, within limits. OLLAMA_NUM_PARALLEL sets how many requests each loaded model processes at once, and each parallel slot needs its own context memory. It suits a few users; for dozens or hundreds of concurrent users, use vLLM or SGLang.
Is TGI still maintained?
Hugging Face announced in late 2025 that text-generation-inference is in maintenance mode, accepting fixes but not major new features, and pointed users to engines such as vLLM and SGLang. Existing deployments keep working; check the repository README for current status before starting a new one.
Do vLLM, Ollama and TGI all support the OpenAI API?
Yes. vLLM serves /v1/chat/completions and /v1/completions, Ollama serves an OpenAI-compatible /v1 endpoint alongside its native API, and TGI's Messages API is OpenAI-compatible. Client code can switch between them by changing the base URL and model name.
Which serving framework supports the most models?
vLLM supports most popular open architectures directly from Hugging Face checkpoints, typically within days of release. Ollama supports models published in its library or as GGUF files. TGI covers the major architectures but receives fewer new ones now that it is in maintenance mode.
What about SGLang and llama.cpp?
SGLang is a high-throughput alternative to vLLM with strong prefix caching and structured output, worth benchmarking for agent and RAG workloads. llama.cpp is the engine family behind GGUF; its llama-server is a lightweight option for single users, CPUs and mixed CPU and GPU setups.
Rent the GPU for this, by the minute.
Get a vLLM-served model behind an OpenAI-compatible API in minutes, or take root on any GPU and run Ollama, TGI or SGLang yourself.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is LLM Inference? A Complete Technical Guide
- TutorialHow to Build Your Own Open-Source LLM API
- TutorialHow to Run Llama on a Cloud GPU: Step-by-Step Guide
- GuideWhat Is Tokens Per Second? Understanding LLM Inference Performance
- GuideQuantization Explained: Running Large AI Models on Smaller GPUs
- ComparisonBest GPU Infrastructure for AI SaaS Startups
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.