← All articles
Guide · 2026-11-09

Advancing Open-Source Model Self-Hosting: From Local Testing to vLLM Production, Key Concurrency and VRAM Tuning Parameters

Published 2026-11-09
Advancing Open-Source Model Self-Hosting: From Local Testing to vLLM Production, Key Concurrency and VRAM Tuning Parameters
Use Ollama for local testing and vLLM for production serving: on the same Linux machine with a GPU, install vLLM with uv and launch an OpenAI-compatible API with a single vllm serve command; tune concurrency and VRAM using --max-num-seqs and --gpu-memory-utilization.

1. Bottom Line First: Ollama for Testing, vLLM for Production

To put the conclusion first: if you only want to test models by yourself, Ollama is enough; if you want a model online 24/7, handling multiple concurrent requests, and callable by other programs, use vLLM. vLLM's core strength is high-throughput serving: PagedAttention manages VRAM and continuous batching merges requests, allowing a single GPU to handle much higher concurrency than single-machine interactive inference.

The division of labor is based on use case: Ollama is a desktop tool that lets you chat in the command line right after installation; vLLM is a serving framework that launches an OpenAI-compatible HTTP API so other applications can call it using the OpenAI format. Get the model running with Ollama first, then hand it over to vLLM for external serving.

2. What You Need to Prepare

Prepare three things: a Linux machine with an NVIDIA GPU (the official quickstart assumes Linux + Python 3.11–3.14); uv installed (the officially recommended Python environment manager); and a model to serve—start with a small model like Qwen2.5-1.5B-Instruct for practice.

Also verify whether your GPU has enough VRAM: a small 1.5B model runs on just a few GB of VRAM, while an 8B model requires about 16GB for BF16 weights plus KV cache. If model downloads are slow in mainland China, set VLLM_USE_MODELSCOPE=True to pull models from ModelScope.

3. Step-by-Step Instructions

First, create the environment and install vLLM: run uv venv --python 3.12 --seed to create and activate a new environment, then run uv pip install vllm --torch-backend=auto; next, run vllm download-kernels to pre-install operator kernels.

Next, start the service. Run a single command: vllm serve Qwen/Qwen2.5-1.5B-Instruct, which starts by default at http://localhost:8000 and provides an OpenAI-compatible API. Verify it first: if curl http://localhost:8000/v1/models lists the model, the service is up; then call the chat endpoint once to confirm the response is normal.

Then tune parameters as needed. Tune concurrency with --max-num-seqs: the maximum number of sequences processed per iteration—check this first if concurrency does not scale; tune VRAM with --gpu-memory-utilization: the VRAM fraction between 0 and 1, defaulting to 1.0 (for expandable KV cache) or 0.92 if omitted. If authentication is needed, add --api-key or set the VLLM_API_KEY environment variable.

4. Common Pitfalls and Solutions

Out-of-memory error on startup: verify the workflow with a smaller model first, then calculate the total budget for model weights plus KV cache for larger models; if VRAM is tight, lower --gpu-memory-utilization or switch to a quantized model. Long wait during startup: this is usually due to compiling operator kernels on the fly—run vllm download-kernels beforehand to pre-install them; if it is still slow, check whether the model is being downloaded for the first time.

API calls return 404: verify the host and port are http://localhost:8000, then check that the path is /v1/chat/completions; the model name must match the name used in the serve command. Requests queue up under high concurrency: check --max-num-seqs, and once a single instance reaches its limit, add more instances and distribute requests across them.

5. Important Notes

Three reminders. First, vLLM binds the service to localhost by default—do not expose the port externally if it is only for personal use; if sharing with others, add --api-key authentication first and consider a reverse proxy. Second, while Ollama runs on demand, vLLM is a long-running service that must be restarted after a machine reboot, so a process supervisor is recommended in production. Third, rely on the actual file size listed on the model download page; VRAM budgets are only for estimating beforehand whether the model will fit.

The steps in this article were verified against official pages on 2026-11-09; if platform rules change, refer to the official documentation.

Sources

  1. Quickstart
  2. Engine Arguments
  3. vllm-project/vllm

This article is compiled from the public sources above and does not reproduce the originals in full; see the official sources for details.

Sign in to Lumo

Sign in with a one-time code sent to your email — no password. Your saved tools will sync across your devices.

The code is only used to sign you in. We store just your email and saved list (privacy policy, in Chinese).

—

Signed in. Your saved tools sync across all your devices.

0saved
View saved tools

Send feedback

Found a mistake, missing something, or have a suggestion? Tell us.