Unit 1 of 13
What is vLLM?
What you’ll learn
- Describe what vLLM does for a model and what it leaves to the model, the hardware, and the rest of your platform.
- Trace one request through the API server, the engine core’s scheduler and KV cache manager, and the GPU worker, and say which process runs each part.
- Explain, with numbers, how iteration-level scheduling and paged KV memory beat a plain batched generate loop.
- Start a server, send a first request, and confirm from the logs, the health check, the model list, and the finish reason that it really worked.
- Choose between the offline LLM class and the online server for a given job.
What vLLM is, and what it is not
Suppose your team fine-tuned a model and now 200 people want to use it through an internal chat tool. The model works in a notebook, one prompt at a time. The question is how to serve it so that many requests share one GPU without long waits or out-of-memory crashes. That is the job vLLM does.
vLLM is an inference engine. It loads a model’s weights and tokenizer, accepts many requests at once, decides which tokens to compute at each step, manages the memory that holds each request’s KV cache, runs the model on the GPU, and returns text. You met the KV cache in the KV cache lesson: the keys and values every request stores for every token it holds.
The model decides what the answer is. vLLM decides how the work is executed and shared: in what order, in which batch, and in which memory. The same weights give the same kind of answers in vLLM as in Hugging Face Transformers; what changes is how many requests one GPU can serve and how fast each one gets its tokens.
| vLLM does | vLLM does not |
|---|---|
| Batch requests from many users on every forward pass | Train or fine-tune the model |
| Allocate and free KV cache memory in 16-token blocks | Make a model fit on a GPU that is too small for its weights |
| Serve an OpenAI-compatible HTTP API and a Python API | Route traffic across a fleet, or handle users, quotas, and billing |
| Apply sampling settings, stop rules, and chat templates | Improve answer quality beyond what the weights can do |
By the end of this lesson you will be able to draw the path a request takes through vLLM, explain the two problems its design solves, start a server, and prove that your first request worked. Everything later in the course builds on this picture.
What a plain generate loop gets wrong
The simplest way to serve a model is a loop around a Hugging Face model.generate() call: collect eight prompts, pad them to the same length, generate until every row is done, then take the next eight. You saw this static batching in the batching lesson. It works, and it wastes the GPU in two ways.
The first waste is time. Requests finish at different points: one answer takes 20 tokens, another 480. In a static batch, a finished row keeps its seat until the longest row is done, and new requests cannot join until the whole batch ends. The GPU runs every step at full cost while part of the batch does nothing useful.
The second waste is memory. A request’s cache grows one token at a time, and nobody knows in advance where it will stop. The safe but costly answer is to reserve room for the longest possible request (a static cache does exactly this), or to pad every row to the longest one in its batch. The arithmetic for Llama 3.1 8B shows how much that costs.
Reserving maximum length for Llama 3.1 8B in BF16 (illustrative 52 GB cache budget)
- KV cache per token, from the KV cache lesson
128 KiB - Reserved per request at the full 131,072-token context
131,072 × 128 KiB = 16 GiB - Requests that fit in 52 GB when each reserves 16 GiB
52 GB / 17.2 GB ≈ 3 - Requests that fit if each holds only its real 2,048 tokens
52 GB / (2,048 × 131,072 B) ≈ 193
ResultReserving the maximum fits 3 requests; allocating as tokens arrive fits about 193
vLLM attacks both problems. Its scheduler works one step at a time (iteration-level scheduling, often called continuous batching): after every forward pass, finished requests leave and waiting ones join. Its KV cache manager hands out memory in fixed blocks of 16 tokens as a request grows (paged KV memory, the idea behind PagedAttention), so a request holds only what it has used, rounded up to one block.
Follow one request through vLLM
vLLM splits the work into separate processes so that slow Python work, such as tokenizing text, does not stall the GPU. The figure below shows the parts a chat request passes through when you run vllm serve. Colors mark the process each part lives in.
- The API server prepares the request
It checks the JSON, applies the model’s chat template to the messages, and tokenizes the result. A request for an unknown model or with an invalid parameter is rejected here, before the GPU sees it.
- The scheduler admits it
The engine core runs a busy loop. At every step, the scheduler decides which requests run and how many tokens each processes: a whole prompt chunk for a new request, one token for a request that is already decoding.
- The KV cache manager finds room
Before a request’s tokens run, the KV cache manager assigns enough free 16-token blocks to hold their keys and values. If none are free, the request waits in the queue.
- The GPU worker runs the step
The model runner packs every scheduled token from every request into one forward pass, then samples one new token per running request using that request’s own settings.
- The output processor answers
Back in the API server process, new token IDs become text. The processor checks stop strings and either streams the new text or waits and returns the full answer with a finish reason.
Requests share the forward pass, but nothing else. Each keeps its own token history, sampling settings, stop rules, and list of KV blocks. That is why one user asking for temperature: 0 and another asking for temperature: 1.2 can sit in the same batch.
| Process | What it runs | How many |
|---|---|---|
| API server | HTTP endpoints, tokenization, detokenization, streaming | 1 by default |
| Engine core | Scheduler, KV cache manager, the step loop | 1 per data-parallel rank |
| GPU worker | Model weights, forward passes, GPU memory | 1 per GPU; on a single GPU it runs inside the engine core process |
Go deeperWhere each stop check happens
Token-level checks run in the engine core, in the scheduler’s check_stop function: the end-of-sequence token, stop_token_ids, max_tokens, and the model’s maximum length. Stop strings are different, because a string such as "\n\n" only exists after detokenization. The output processor in the frontend process finds them, marks the request finished with reason stop, and sends an abort to the engine core so it stops scheduling that request.
With one GPU, vLLM 0.28.0 picks the in-process uni executor, so the model runner lives inside the engine core process and vllm serve uses two processes. With --tensor-parallel-size 4, the multiprocess executor starts one worker per GPU: 1 API server, 1 engine core, and 4 workers, six processes in total.
Two ways in: the LLM class and vllm serve
vLLM has two front doors to the same engine core. The offline LLM class puts the frontend inside your own Python process: you pass a list of prompts, it returns a list of results, and the engine exits when your script ends. vllm serve wraps the engine in a long-running HTTP server with OpenAI-compatible endpoints such as /v1/chat/completions.
| Question | LLM class (offline) | vllm serve (online) |
|---|---|---|
| Who sends the work? | One script that has all prompts up front | Many clients, at unpredictable times |
| How long does the engine live? | As long as the script | Until you stop the server |
| Typical jobs | Evaluations, dataset labeling, synthetic data | Chat apps, agents, internal APIs |
| How results arrive | A Python list, in input order | JSON responses or server-sent event (SSE) streams |
| Next lesson | Offline inference with the Python API | Online API protocols |
Starting an engine is expensive. vLLM loads the weights, runs a profiling pass to measure how much memory is left for the KV cache, allocates that cache, and usually compiles the model and captures CUDA graphs. For a small model this takes tens of seconds; for a 70B model it can take minutes. A server pays that cost once and then reuses the loaded weights for every request, and one shared scheduler and KV cache pool can batch requests from all clients together.
Send a first request and prove it worked
The code example below this lesson starts Qwen/Qwen3-0.6B and sends one chat request. You need a Linux machine with an NVIDIA GPU and vLLM 0.28.0 installed; the runbook below shows the install. Run the server in one terminal and the client commands in another.
A reply alone proves less than it seems. Check four things in order, because each one proves something different:
- The engine started
Read the startup log.
Model loading took ... GiB memorymeans the weights fit.Available KV cache memory: ... GiBandGPU KV cache size: ... tokens, Maximum concurrency for 4,096 tokens per request: ...xshow how much cache the profiler left.Starting vLLM server on http://...:8000means the HTTP server is about to accept requests. - The server is alive
GET /healthreturns status 200 while the engine core is running and 503 if it has died. Poll it rather than sleeping for a fixed time after launch. - The model name is right
GET /v1/modelslists the name clients must send in themodelfield. By default it is the Hugging Face ID you launched with. - The answer ended the way you expected
In the chat response, check
choices[0].finish_reason.stopmeans the model ended its answer or hit a stop rule;lengthmeans it ran out of tokens. Then compareusage.prompt_tokensandusage.completion_tokenswith what you expected.
# In a second terminal, while vllm serve is running
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8000/health
curl -s http://localhost:8000/v1/models | python3 -m json.tool | grep '"id"'The first command should print 200 and the second a line with "id": "Qwen/Qwen3-0.6B". A connection error means the server is still loading or bound to another address; look for the Starting vLLM server on line in the log first.
Now check the log numbers against your own estimate. Qwen3-0.6B has 28 layers, 8 KV heads, and a head size of 128, and it stores its 751,632,384 parameters in BF16. The runbook launches it with gpu-memory-utilization: 0.85, a setting chosen to leave room for other processes; vLLM 0.28.0’s default is 0.92.
What the KV cache log line should roughly say for Qwen3-0.6B on an 80 GB H100
- KV cache per token
2 × 28 layers × 8 KV heads × 128 × 2 bytes = 114,688 B (112 KiB) - Weights
751,632,384 × 2 bytes ≈ 1.5 GB - Memory the engine may use at 0.85
80 GB × 0.85 = 68 GB - Left for the cache after weights and about 4 GB of working memory
68 − 1.5 − 4 ≈ 62.5 GB - Tokens that fit
62,500,000,000 / 114,688 ≈ 545,000 - Concurrency at 4,096 tokens per request
545,000 / 4,096 ≈ 133
ResultExpect a GPU KV cache size in the hundreds of thousands of tokens and a concurrency figure above 100x
Your exact numbers will differ, because the real working memory depends on CUDA graphs and the GPU’s usable capacity. What matters is the order of magnitude. If the log reports a few thousand tokens, something else holds GPU memory, or the utilization setting is far lower than you think.
Try it: measure the waste without a GPU
This script replays 64 requests with random prompt and output lengths through two schedules: static batches of 8, and 8 slots that refill as soon as a request finishes. It also counts KV cache tokens three ways. You need Python 3.9 or later and NumPy. The workload is illustrative, and the script ignores prefill time to keep the comparison clear.
import numpy as np
rng = np.random.default_rng(0)
n, slots, block = 64, 8, 16
prompt = rng.integers(50, 1000, n) # prompt tokens per request
output = rng.integers(10, 500, n) # tokens each request will generate
# Static batches: 8 requests start together and the batch runs until the
# longest one finishes. Every row is padded to the longest prompt and output.
steps_static, reserved_static = 0, 0
for i in range(0, n, slots):
p, o = prompt[i:i + slots], output[i:i + slots]
steps_static += o.max()
reserved_static += len(p) * (p.max() + o.max())
# Iteration-level scheduling: a finished request leaves after its last token
# and the next waiting request takes its slot at the next step.
free_at = np.zeros(slots, dtype=int)
for o in output:
slot = free_at.argmin()
free_at[slot] += o
steps_continuous = free_at.max()
useful = output.sum()
actual = (prompt + output).sum()
paged = (np.ceil((prompt + output) / block) * block).sum()
print(f"decode steps, static batches: {steps_static:,}")
print(f"decode steps, refilled each step: {steps_continuous:,}")
print(f"slot use, static: {useful / (slots * steps_static):.0%}")
print(f"slot use, continuous: {useful / (slots * steps_continuous):.0%}")
print(f"KV tokens held, padded rows: {reserved_static:,}")
print(f"KV tokens held, 16-token blocks: {int(paged):,}")
print(f"KV tokens actually used: {actual:,}")decode steps, static batches: 3,515
decode steps, refilled each step: 2,318
slot use, static: 59%
slot use, continuous: 90%
KV tokens held, padded rows: 85,224
KV tokens held, 16-token blocks: 51,248
KV tokens actually used: 50,820Read the output in two pairs. Refilling slots finishes the same 64 requests in 2,318 decode steps instead of 3,515, and the slots do useful work 90% of the time instead of 59%. For memory, padded rows hold 85,224 token slots at their peak, while 16-token blocks hold 51,248, which is less than 1% above the 50,820 tokens really used.
If a result looks wrong, check the obvious first: the refilled schedule can never need more steps than the static one, and the block count can never be below the tokens used. Once you have a GPU, the runbook below repeats the real version of this lesson: start the server, verify it, and stream a reply.
Common mistakes
| Symptom | Likely cause | Fix |
|---|---|---|
The model ... does not exist error, but the server is healthy | The request’s model field does not match the served name. | Copy the id from GET /v1/models, or set --served-model-name on purpose. |
| curl to port 8000 is refused for the first minute | The engine is still loading, profiling, and warming up. | Poll GET /health until it returns 200 instead of sleeping a fixed time. |
| Out of memory at startup, before any request | Another process holds GPU memory, or the weights plus working memory exceed the budget. | Check nvidia-smi, then lower --max-model-len or pick a smaller or quantized checkpoint. |
| Answers change between identical requests | The model’s generation_config.json supplied a nonzero temperature. | Send temperature explicitly, or launch with --generation-config vllm to use vLLM’s own defaults. |
| Chat replies look like raw text continuation | The model has no chat template, or you called the completions endpoint. | Use an instruct model with a template, or pass --chat-template. |
| Anyone on the network can call the server | It listens on 0.0.0.0 by default and has no API key. | Bind to 127.0.0.1 during development and put authentication in front before exposing it. |
Which vLLM feature answers which problem
vLLM has many switches. Most of them exist to fix one specific bottleneck, so turn them on only after you have measured that bottleneck on a working baseline. This map shows where the rest of the course picks each one up.
| What you measure | Feature | Lesson |
|---|---|---|
| Requests queue while the GPU has spare compute | Iteration-level scheduling and its token budget | Continuous batching |
| KV cache full, preemptions rising | Paged KV blocks, smaller --max-model-len, FP8 cache | PagedAttention, Memory and quantization |
| Many prompts share a long system prompt | Automatic prefix caching | Reuse and speculation |
| Decode is slow for single users | Speculative decoding, CUDA graphs | Reuse and speculation, Compilation and CUDA graphs |
| Clients need valid JSON or tool calls | Structured outputs and tool parsers | Structured outputs and tools |
| The model does not fit on one GPU | Tensor, pipeline, and expert parallelism | Parallelism |
The order matters as much as the features. Get one request right, record a baseline for time to first token (TTFT) and throughput, then raise concurrency until the first limit shows up in the metrics. The benchmarking lesson turns that into a repeatable procedure.
Go deeperWhat the pinned release and model revision protect
vLLM moves fast: defaults, metric names, and even flag spellings change between releases. This course pins 0.28.0, and version 0.28.0 is also where facts such as the 0.92 default for --gpu-memory-utilization come from. When you compare two runs, record the vLLM version, the model’s Hugging Face revision, the launch command, and the GPU driver, or you cannot tell a configuration change from a software change.
The same applies to the model. A repository’s generation_config.json or chat template can change without the weights changing, and both alter what the server returns. Pass --revision with a commit hash in production so a rebuild cannot silently pick up a different template.
Cheat sheet
- vLLM is an inference engine: the model decides the answer, vLLM decides batching, memory, and scheduling.
- The path: API server (tokenize) → scheduler (pick tokens) → KV cache manager (16-token blocks) → GPU worker (forward pass) → output processor (detokenize, stop strings).
- Iteration-level scheduling refills batch slots after every step; paged KV memory holds only the tokens a request has used.
- Use the
LLMclass for one script with all its prompts; usevllm servewhen many clients share the model. - Prove a first request in four steps: startup log,
GET /healthreturns 200,GET /v1/modelsshows the name,finish_reasonis what you expected. - The KV cache log line reports capacity in tokens and in maximum-length requests, not a concurrency promise.
--gpu-memory-utilizationdefaults to 0.92 in 0.28.0; lower it on purpose when other processes share the GPU.- Set
temperatureexplicitly: the model’sgeneration_config.jsonsupplies defaults otherwise.
Walkthrough
Launch a server and prove the first request
Code example Optional · Serve and call a small model
vllm serve Qwen/Qwen3-0.6B --dtype auto
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"Qwen/Qwen3-0.6B","messages":[{"role":"user","content":"Explain KV cache in one sentence."}],"temperature":0}'Quick reference
APIs and configuration
| API or setting | What it does | Input | Output | Limitations |
|---|---|---|---|---|
vllm serve | Start an OpenAI-compatible server for one model | Model ID or path plus flags, or a YAML file passed with --config | A listening HTTP server and a startup log with memory and KV cache figures | Flags on the command line override the YAML file; startup success says nothing about behavior under load. |
GET /health | Check that the engine core is alive | No body; works without the API key | Status 200 when healthy, 503 when the engine core has died | Connections are refused until the server finishes starting, so treat connection errors as not ready yet. |
GET /v1/models | List the model names clients must send | No body; needs the API key when one is set | A JSON list whose id fields are the served names | The name is the launch ID unless --served-model-name changes it; any other value in a request is rejected. |
Optional deployment reference
Serve Qwen3-0.6B and verify the first request
Install vLLM 0.28.0, start a small model from a saved YAML file, and call it from the OpenAI Python client. By the end you will know the served model name, the KV cache capacity the engine chose, and how to tell a server that is ready from one that is still loading. Qwen3-0.6B needs no license approval and fits on any recent data center GPU.
Before you start
- A Linux machine with an NVIDIA GPU, a working driver, and nvidia-smi on the path
- Python 3.10 to 3.13, uv, and about 5 GB of free disk space for the environment and the model
- Access to huggingface.co, or the model already in your local Hugging Face cache
- Two terminals on the same machine: one for the server, one for clients
Create the environment and check the GPU
Install into a fresh virtual environment so the pinned version cannot collide with other projects. The torch-backend option lets uv pick the PyTorch build that matches your CUDA driver. The last two commands prove that Python sees vLLM and the GPU before you download any model.
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install 'vllm==0.28.0' --torch-backend=auto
python -c "import torch, vllm; print('vLLM', vllm.__version__); print('accelerator', torch.cuda.get_device_name(0))"
nvidia-smiThe Python line prints vLLM 0.28.0 and then accelerator followed by your GPU’s name, such as an H100. nvidia-smi should list no other process using a large share of GPU memory. An import error or a message that no CUDA device is available means the driver or PyTorch build is wrong; fix that before going on.
Launch from a saved YAML file
Save the seven lines from model to gpu-memory-utilization as vllm.yaml, then run the last line. YAML keys use the long flag names without dashes in front. The file binds the server to 127.0.0.1 so nothing outside this machine can reach it, caps the context at 4,096 tokens, and chooses 0.85 of GPU memory instead of the 0.92 default to leave headroom.
# vllm.yaml
model: Qwen/Qwen3-0.6B
host: 127.0.0.1
port: 8000
dtype: auto
max-model-len: 4096
gpu-memory-utilization: 0.85
# Command-line values override YAML values.
vllm serve --config vllm.yamlThe log opens with a banner naming version 0.28.0 and the model, then a non-default args line that should list your YAML values. Next come Model loading took ... GiB memory, Available KV cache memory: ... GiB, and GPU KV cache size: ... tokens, Maximum concurrency for 4,096 tokens per request: ...x. The server is ready after Starting vLLM server on http://127.0.0.1:8000 appears and curl -s -o /dev/null -w ‘%{http_code}’ http://127.0.0.1:8000/health prints 200. Leave this terminal running.
Discover the model name and stream a reply
Run this in the second terminal; it is a shell snippet that installs the OpenAI client and runs a short Python program. The program asks the server which model it serves instead of hard-coding the name, then streams a reply at temperature 0 with a 96-token limit.
uv pip install openai
python - <<'PY'
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="EMPTY")
model = client.models.list().data[0].id
print("serving:", model)
stream = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Explain KV cache in two sentences."}],
temperature=0,
max_tokens=96,
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="", flush=True)
print()
PYThe first line reads serving: Qwen/Qwen3-0.6B. Text then appears in many small pieces rather than all at once. Qwen3 usually starts with a <think> section, and with only 96 tokens the stream may stop mid-thought: that is a length finish, not a bug. The server log shows a POST /v1/chat/completions line with status 200.
Settings explained
| Setting | What it controls | Operational guidance |
|---|---|---|
model | The Hugging Face ID or local path to load, and the default name clients must send | Add revision with a commit hash in production so a repository update cannot change the weights or chat template under you. |
host | The address the server listens on; 0.0.0.0 when unset | Use 127.0.0.1 while testing. Expose the port only behind a gateway that handles authentication. |
max-model-len | The largest prompt plus output, in tokens, that one request may use | Set it to what your traffic needs. A smaller value lets the startup check pass on smaller GPUs and makes each request’s worst case cheaper. |
gpu-memory-utilization | The share of GPU memory the engine may use for weights, working memory, and KV cache; 0.92 by default in 0.28.0 | Lower it when other processes share the GPU; raise it only after checking that nothing else needs the memory. |
dtype | The precision of weights and activations | Leave it on auto, which keeps BF16 checkpoints in BF16 and runs FP32 checkpoints in FP16. |
generation-config | Where default sampling values come from; auto reads the model’s generation_config.json | Set it to vllm when you want vLLM’s neutral defaults, or send every sampling value explicitly. |
Validation checklist
- GET /health returns 200 and GET /v1/models lists Qwen/Qwen3-0.6B as the only model
- The startup log shows a GPU KV cache size in the hundreds of thousands of tokens, not a few thousand
- A request at temperature 0 returns the same text twice in a row, and its finish_reason is stop or length as expected
- A streamed request arrives in several chunks and ends without an error
Optional exercise
Show what a successful first request does and does not prove
- Start the server from vllm.yaml and save the full startup log to a file.
- Send the same non-streamed chat request twice at temperature 0 and compare the text, the finish_reason, and the usage token counts.
- Send the request again with max_tokens set to 8 and confirm the finish_reason changes to length.
- Write one sentence each on what the health check, the model list, and the finish reason prove, and one on what none of them prove about latency under load.
- What to save
- The YAML file, the output of the version check, the startup log with the KV cache size line, both JSON responses, and your four sentences.
- Test a failure
- Send a request whose model field is qwen3 instead of the served name. Record the HTTP status and error message, then repeat with the correct name to confirm the server was never affected.
- Cleanup
- Stop the server with Ctrl+C and check with nvidia-smi that no vLLM process still holds GPU memory. Keep the environment and vllm.yaml for the next lessons.
How to use it
When and how to use it
Run vllm serve when several clients, services, or people need the same model over HTTP. The server loads the model once and lets every request share one scheduler and one KV cache pool. For a script that owns all of its prompts, the offline LLM class in the next lesson is simpler.
OpenAI-compatible endpoints
Chat completions, completions, embeddings, and model listing, so existing OpenAI clients work by changing the base URL.
Launch configuration
Model, revision, precision, context limit, memory share, and listen address, set once per server from flags or a YAML file.
Per-request controls
Temperature, token limits, stop rules, and structured output settings travel with each request, so no reload is needed.
Operational endpoints
Health, version, tokenization, and Prometheus metrics for readiness checks, debugging, and dashboards.
System workflow
- 1
Check that the model’s architecture is supported and that its weights fit well within one GPU’s memory.
- 2
Launch with the smallest explicit configuration and save it as a YAML file.
- 3
Poll the health endpoint until it returns 200, then read the served name from the model list.
- 4
Send one request at temperature 0 and one streamed request, and check each finish reason.
- 5
Record the startup numbers, versions, and first-token latency as the baseline for every later change.
Start the model server
vllm serve Qwen/Qwen3-0.6B \
--dtype auto \
--max-model-len 4096One API server process and one engine core process start. The log reports the weight memory, the KV cache size in tokens, and finally the address the server listens on.
Troubleshooting
If something goes wrong
| What you observe | Evidence to collect | Next experiment |
|---|---|---|
| The server is healthy, but every request fails with a model does not exist error. | Compare the model field in the request with the id values from GET /v1/models, and check the launch command for --served-model-name. | Send the same request with the advertised name. Add an alias with --served-model-name only when clients need a stable name that differs from the repository ID. |
| Startup fails with an out-of-memory error before any traffic arrives. | Run nvidia-smi to see what else holds memory, then read the log for Model loading took ... GiB memory and any error about not enough GPU memory. Note max-model-len, dtype, and the utilization setting. | Free the GPU or change one variable at a time: lower max-model-len, lower gpu-memory-utilization if another process needs room, or choose a quantized or smaller checkpoint. Relaunch after each change. |
| Non-streamed calls work, but streamed text arrives in one late burst. | Timestamp each chunk on the client and compare with a direct curl --no-buffer call to the server. Check any proxy between them for response buffering. | If direct calls stream smoothly, turn off buffering in the proxy or client library; the engine is not the cause. |
| Connections to port 8000 are refused for a minute after launch. | Read the log for the stage it has reached: weight loading, the KV cache size line, or graph capture. Check that the host and port match what the client uses. | Wait for Starting vLLM server on in the log, and make scripts poll GET /health until it returns 200 instead of sleeping for a fixed time. |
| Identical requests return different text. | Check whether the requests set temperature, and look for a startup warning that default sampling parameters were overridden by the model’s generation_config.json. | Send temperature 0 explicitly for comparisons, or relaunch with --generation-config vllm so the server’s defaults no longer come from the model repository. |
Knowledge check