vLLM is a high-throughput inference engine for self-hosting open models. It uses PagedAttention and continuous batching to deliver production-grade throughput on your own GPUs. Use vLLM when you need to self-host for compliance, cost, or latency reasons.
Installation
vLLM requires a CUDA-capable GPU. For Apple Silicon or CPU-only systems, use Ollama instead.
Two Ways to Use vLLM
There are two patterns, depending on whether you want an in-process engine or a separate server.
Option 1: In-Process via Custom Wrapper
Best for single-GPU, single-process deployments. The wrapper hosts the model directly inside your Python process.
Option 2: OpenAI-Compatible Server
Best when you want one shared vLLM server feeding many agents or services.
Start a vLLM server:
Point Swarms at it via the OpenAI-compatible protocol:
The server pattern is the right default for multi-agent systems — one warm vLLM process serves any number of concurrent agents efficiently.
Choosing a Model
vLLM can serve any HuggingFace causal LM. Popular picks:
Batched Inference
vLLM is built for high throughput. The wrapper makes batching one line:
Multi-Agent on One vLLM Server
Once your server is up, every agent in a swarm can share it — no per-agent model loading cost:
Production Defaults
Server flags
Agent defaults
Next Steps