§ LLMS.FREERUN LOCALLYVERIFIED 2026

vLLM Install and Serve: OpenAI-Compatible Server Setup

vLLM is a free, Apache 2.0 production serving engine built for Linux with NVIDIA CUDA or AMD ROCm GPUs. Using PagedAttention and continuous batching, it serves Safetensors, FP8, AWQ and GPTQ weights over an OpenAI-compatible API on port 8000.

# install in a Python 3.10+ environment on Linux with CUDA
pip install vllm
vllm serve Qwen/Qwen2.5-7B-Instruct --port 8000
§ 01 · PRODUCTION FLAGSPAGEDATTENTION & MEMORY TUNINGVLLM SERVE

Key Serving Flags and GPU Memory Tuning

Unlike single-user GGUF runners, vLLM pre-allocates 90% of available GPU VRAM at startup for its PagedAttention KV cache so it can batch dozens of concurrent users cleanly. Use these flags to tune startup memory, multi-GPU sharding and quantization:

Essential vllm serve CLI flags for GPU memory tuning, tensor parallelism and quantization
FlagExampleWhen to Use It
--gpu-memory-utilization--gpu-memory-utilization 0.8Fixes startup OOM errors when other processes share the GPU.
--max-model-len--max-model-len 8192Caps KV cache allocation so 128K-context models fit on 16–24 GB GPUs.
--tensor-parallel-size--tensor-parallel-size 2Shards large models (like 70B) across multiple GPUs on one host.
--quantization--quantization awqLoads compressed AWQ, GPTQ or FP8 weights for higher concurrency.
--served-model-name--served-model-name qwen-7bAliases a long Hugging Face repo ID to a short name for API clients.
§ 02 · OPENAI APIPORT 8000 SERVER + HF_HOMESAFETENSORS / AWQ / FP8

OpenAI-Compatible Server on Port 8000

vllm serve exposes chat completions, streaming, structured JSON outputs, tool calling and embeddings at http://localhost:8000/v1. Pass the exact Hugging Face repo ID (for example Qwen/Qwen2.5-7B-Instruct) unless you set --served-model-name.

import os
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="ollama",
)
r = client.chat.completions.create(
    model="Qwen/Qwen2.5-7B-Instruct",
    messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)

Cache management: Weights download into ~/.cache/huggingface/hub (override with HF_HOME). Inspect or prune cached checkpoints with huggingface-cli scan-cache and huggingface-cli delete-cache.

§ 03 · ARCHITECTURE FITWHEN TO PICK VLLM VS OLLAMALINUX GPU SERVERS

When to Choose vLLM Over Ollama or llama.cpp

Choose vLLM when you are serving a shared internal team, running high-concurrency batch evaluations or deploying behind Kubernetes with Prometheus metrics on Linux NVIDIA/AMD GPUs. Continuous batching yields dramatically higher aggregate tokens-per-second once concurrency exceeds 4–8 simultaneous requests.

If you are running on a personal Mac, a Windows laptop without WSL2 or a single-user desktop workflow with 4-bit GGUF files, Ollama, LM Studio or llama.cpp will be far simpler to maintain.

§ FAQCOMMON QUESTIONSANSWERS

vLLM Questions

Why Does vLLM Run Out of GPU Memory on Startup?

vLLM pre-allocates 90% of GPU memory by default for its PagedAttention KV cache. Lower --gpu-memory-utilization (e.g. 0.8) and cap --max-model-len (e.g. 8192) to fit your card.

Does vLLM Work Natively on Windows or macOS?

vLLM targets Linux with NVIDIA CUDA or AMD ROCm GPUs. On Windows, run it inside WSL2 with NVIDIA CUDA drivers; on macOS, use Ollama, LM Studio or llama.cpp natively instead.

Can vLLM Run Offline Without Internet Access?

Yes. Point vllm serve at a local folder containing downloaded Hugging Face weights and set HF_HUB_OFFLINE=1.

Is vLLM Free for Commercial Production Use?

Yes. vLLM is released under the permissive Apache 2.0 license with no commercial seat or throughput fees.