Installing quvllm-plugin on a vLLM server
For the person who runs the GPU server. quvi (the application) needs nothing from you beyond this; it finds the plugin by asking the model server (step 3).
pip install --no-index --no-deps quvllm_plugin-<version>-py3-none-any.whl--logits_processors <class>quvllm/1 plugin=<version> hidden=yesNo dependencies · Installs offline · Nothing to change in quvi · To undo, remove the flag and restart
1. Install the wheel
The wheel is one file, quvllm_plugin-<version>-py3-none-any.whl, with a SHA256SUMS beside it. It needs no network.
sha256sum -c SHA256SUMS
pip install --no-index --no-deps quvllm_plugin-<version>-py3-none-any.whl # into the Python vLLM runs in
In a container, add it to the vLLM image you already run, so it survives a restart:
FROM vllm/vllm-openai:<the tag you run>
COPY quvllm_plugin-<version>-py3-none-any.whl /tmp/
RUN pip install --no-index --no-deps /tmp/quvllm_plugin-<version>-py3-none-any.whl && rm /tmp/*.whl
2. Add the flag
Add --logits_processors <class> to the arguments you already pass. The class depends on the model runner.
| vLLM · model runner | --logits_processors | What works |
|---|---|---|
| 0.12.0 – 0.30.x, or 0.31.0 – 0.33.x on the V1 runner | quvllm.processor:ValuePenaltyLogitsProcessor | Decoding Rule · Decision Head |
| 0.31.0 – 0.33.x on the V2 runner (the default), 0.34.0 and later | quvllm.processor_v2:ValuePenaltyLogitsProcessorV2 | Decoding Rule |
Speculative decoding must be off: vLLM refuses custom logits processors with it.
3. Check
curl -s http://<vllm>/v1/completions -H 'Content-Type: application/json' -d '{
"model": "<served model name>", "prompt": "ping", "max_tokens": 32, "temperature": 0,
"vllm_xargs": {"quvi_value_penalty": "{\"probe\": true}"}}'
choices[0].text must be quvllm/1 plugin=<version> hidden=<value>:
hidden= | Meaning |
|---|---|
yes | Decoding Rule and Decision Head both work |
nodir | Decoding Rule works; mount the directory below for Decision Head |
v2 | Decoding Rule works; Decision Head needs the V1 model runner (the table in step 2) |
Any other text means the plugin is not in the request path (check the flag, or a gateway that drops vllm_xargs).
For Decision Head (optional)
Decision Head reads the model's hidden state at chosen positions of a request, and scores it with a small head quvi sends. To train that head, it writes hidden states as files into /var/lib/quvllm/capture, only when that directory exists. quvi reads each file back once through GET /quvllm/capture/{id}, and the read deletes it.
- Add one more flag:
--middleware quvllm.capture_route.CaptureRoute - Mount a directory at
/var/lib/quvllm/capture. - On vLLM 0.31–0.33, set
VLLM_USE_V2_MODEL_RUNNER=0.
docker compose:
services:
vllm:
environment:
VLLM_USE_V2_MODEL_RUNNER: "0" # vLLM 0.31–0.33 only
volumes:
- /var/lib/quvllm/capture:/var/lib/quvllm/capture
A capture is from about ten KB to about ten MB and is deleted when quvi reads it; a capture quvi never reads stays until you remove it.
With several vLLM servers behind one gateway, route GET /quvllm/capture/{id} to the server that answered the request it belongs to.
Check: curl -s http://<vllm>/quvllm/capture/%21 must answer {"error": "bad capture id"}. vLLM's own 404 means --middleware is missing.
Undo
Remove the flags (and the mount) and restart vLLM. quvi notices on its next check and goes back to generation for everything; nothing in quvi stops or needs changing.