
Running an open-weight large language model on your own GPU is easy for one user. Serving it to hundreds of users at once is a different problem. Each request holds a growing block of GPU memory while it generates text, requests arrive and finish at different times, and a naive server leaves most of the GPU idle or runs out of memory. vLLM is an open-source inference engine built to solve exactly that: it gets far more requests through the same hardware, and exposes them behind an API your applications already know how to call.
This article explains what vLLM is, how it works, where it fits, when it is the right choice, and how it compares with Ollama, SGLang, TensorRT-LLM and hosted APIs.
What is vLLM?
vLLM is an open-source library and server for running and serving large language models (LLMs). You point it at a model, for example from Hugging Face, and it loads the weights onto one or more GPUs and serves requests through an OpenAI-compatible HTTP API. It is written mainly in Python, built on PyTorch, and released under the Apache 2.0 licence.
vLLM was developed in the Sky Computing Lab at the University of California, Berkeley. Woosuk Kwon and Zhuohan Li announced it publicly on 20 June 2023, together with PagedAttention, the memory-management technique at its core, which was then presented as a research paper at the SOSP conference in October 2023. Before the public release, LMSYS used vLLM to serve its Vicuna model and Chatbot Arena.
The project grew quickly into a community effort with contributors from many companies and universities. In May 2025 it became a hosted project of the PyTorch Foundation, which gives it neutral governance alongside PyTorch itself.
How vLLM works
The KV cache problem. When a model generates text, it stores intermediate results for every token so far, called the key-value (KV) cache. That cache grows with each new token, and nobody knows in advance how long an answer will be. Older servers reserved a large, contiguous block of memory per request for the worst case, and most of it was wasted.
PagedAttention. vLLM borrows the idea of virtual memory from operating systems. It splits the KV cache into small, fixed-size blocks and allocates them only as a request needs them, so blocks do not have to sit next to each other in memory. Waste drops to a minimum, more requests fit on the GPU at once, and requests that share the same prefix, such as a long system prompt, can share the same blocks.
Continuous batching. Instead of waiting for a whole batch of requests to finish, the scheduler re-forms the batch at every generation step: finished requests leave, new ones join straight away. The GPU stays busy, and short requests do not wait behind long ones.
An OpenAI-compatible server. vllm serve starts a server with the same endpoints as the OpenAI API, so existing clients and frameworks such as LangChain can switch to a self-hosted model by changing a base URL.
Key features
- High throughput from PagedAttention, continuous batching, chunked prefill and prefix caching.
- OpenAI-compatible API, with streaming, plus support for the Anthropic Messages API and gRPC.
- Distributed inference with tensor, pipeline, data and expert parallelism across GPUs and nodes.
- Quantisation support for running larger models on less memory.
- Speculative decoding to speed up generation.
- Structured output, so responses follow a JSON schema or grammar.
- Multi-LoRA serving, which serves several fine-tuned variants of one base model on the same GPU.
- Broad hardware support: NVIDIA and AMD GPUs, x86, ARM and PowerPC CPUs, and plugins for Google TPUs, Intel Gaudi and other accelerators.
Where vLLM is used
- Self-hosted LLMs for data sovereignty, where prompts and documents must not leave the company's own servers. We cover the trade-offs in On-premise LLM: when to keep AI on your own servers, and what it takes.
- High-volume products, where per-token API fees grow faster than the cost of running your own GPUs.
- Internal assistants and RAG systems that answer from company documents with an open-weight model.
- Serving fine-tuned models, including many LoRA adapters on one base model.
- Batch jobs such as classifying, extracting or summarising large document sets offline.
- Commercial AI platforms build on it too; Red Hat, for example, offers a supported distribution of vLLM.
When to choose vLLM, and when not to
Choose vLLM when:
- You need to serve an open-weight model to many concurrent users or applications.
- Data must stay on your own infrastructure, for compliance or contractual reasons.
- Traffic is high and steady enough that owning GPU capacity is cheaper and more predictable than paying per token.
- You need latency that a shared cloud API cannot guarantee.
Look elsewhere when:
- One developer wants to try a model on a laptop. Ollama is simpler to install and runs well without a data-centre GPU.
- Volume is low or unpredictable. A hosted API such as OpenAI costs nothing when idle and needs no operations team.
- You need the very best model available, and it is only offered as a closed API.
- Nobody in the team can own GPU servers: drivers, CUDA versions, monitoring and capacity planning.
vLLM is a serving engine, not a full platform. Authentication, rate limiting, logging and routing between models still have to be built around it, usually behind an API gateway, in containers with Docker and often on Kubernetes.
vLLM and its alternatives
| Option | Type | Best fit |
|---|---|---|
| vLLM | Open-source serving engine | Production serving of open models on GPUs |
| SGLang | Open-source serving engine | Similar workloads, strong on structured and agentic calls |
| TensorRT-LLM | NVIDIA's optimised inference library | Maximum performance on NVIDIA hardware |
| Ollama | Local model runtime | Single machines, development, small teams |
| Hosted APIs | Managed models from a provider | Low or variable volume, closed frontier models |
The comparison people ask about most is vLLM vs Ollama. They solve different problems. Ollama makes it easy to run a model on one machine for one user or a few; vLLM is designed to serve many requests at once on server GPUs with the highest throughput. Many teams prototype with Ollama and deploy with vLLM.
For a worked example of a self-hosted deployment, see Gemma 4 in production: cloud vs self-hosted vLLM deployment guide, which looks at running Gemma 4 on vLLM. For the cost side, LLM cost optimization: 7 patterns that cut bills covers when self-hosting starts to pay off.
How we use vLLM at Internative
We deploy vLLM for clients who need to host open-weight LLMs on their own GPUs. The reasons are usually one of three: data sovereignty and compliance, predictable costs at high volume, or latency targets that cloud APIs cannot meet. vLLM fits cleanly into our service stacks built with LangChain and FastAPI, so the rest of the application does not change when the model moves in-house.
If you are weighing a self-hosted model against a cloud API, our AI integration and automation team can help you work out which fits your data, traffic and budget.
Frequently asked questions
What does LLM stand for, and where does vLLM fit?
LLM stands for large language model, a neural network trained on large amounts of text to understand and generate language. vLLM is not a model itself. It is the engine that loads a model's weights onto GPUs and serves its answers to applications quickly and efficiently.
How do I set up vLLM?
On a Linux machine with a supported GPU, install it with pip install vllm and start a server with vllm serve followed by a model name from Hugging Face. The server listens on an OpenAI-compatible endpoint, so any OpenAI client can call it. An official Docker image is also available for container deployments.
How does the vLLM scheduler work?
The scheduler decides, at every generation step, which requests run. It uses continuous batching: finished requests leave the batch and waiting ones join immediately. It allocates KV cache blocks on demand through PagedAttention, splits long prompts into chunks so they do not stall other requests, and, if GPU memory runs short, preempts some requests and resumes them once space is free.
Which LLM is best to run on vLLM?
It depends on the task, the language and the GPU memory you have. vLLM supports most popular open-weight model families, including Llama, Qwen, Mistral, DeepSeek and Gemma. A practical approach is to shortlist two or three models that fit your hardware, then test them on your own data before choosing.
Keep reading
The articles that follow this one.



