Kosken Start for Free

vLLM that tunes itself with one button

. By Alberto Ferrer.

vLLM 0.34 has 327 settings. Some help only one kind of model. Some help at 4 users and hurt at 16. Some do not start on a given GPU. Most teams keep the defaults, or copy flags from a post about another GPU and another model.

Kosken AI Ops now has an Optimize button on each vLLM endpoint. You pick a goal, and Kosken tunes the endpoint by itself: it proposes changes, checks them, restarts the endpoint, measures it with the same benchmark, and stops when the gain is small. Then you keep the result or undo it. Every change is proved by a benchmark before you keep it.

What the button does

  1. It measures the endpoint as it is now, or reuses its last benchmark with the same workload.
  2. It proposes changes for the goal: Balanced (the most users within the service level), Throughput or TTFT (the fastest first token). Rules read the model, the GPU and the measures. Kosken AI reads the same facts and adds proposals.
  3. It checks each proposal before it can run. A value that vLLM refuses, or that the model or the GPU does not support, never reaches the endpoint.
  4. It restarts the endpoint with the changes and runs the same benchmark again.
  5. With auto-tune, Kosken AI reads the results and proposes the next round, up to 3 rounds. The run stops when a round gains less than 3%.
  6. It leaves the best round on the endpoint. Keep leaves it there. Undo puts back the settings from before.

The endpoint

We tried it on one of our own endpoints. It serves Qwen/Qwen3.5-2B on vLLM v0.34.0, with MTP speculative decoding, a context of 32,768 tokens, 64 sequences and 80% of the GPU memory. Qwen3.5 is a hybrid model: some layers are attention, some keep a state like Mamba. That changes many rules.

The benchmark before (BM-2) measured three scenarios, chat 1k/1k, ShareGPT and a shared prefix, at 1, 4 and 8 users, against the MLPerf Interactive service level: TTFT p99 up to 450 ms and TPOT p99 up to 40 ms. The endpoint held 4 users.

The GPU tab of the endpoint machine gpu-01: driver 610.88 with CUDA 13.3 on WSL, GPU use, VRAM 11.6 of 12.0 GiB, power, temperature, and the GPU charts.
The same view in the dark theme.
The machine under the endpoint, in its GPU tab. It runs vLLM on WSL2.

The first run went wrong

The first run, OP-1, had the goal TTFT. Its first round gave mixed numbers, and the run still went on to a second round. That round wanted to set --max-num-seqs from 64 to 1.

Two bugs caused it. The TTFT score read the p95, and the benchmark before came from an older agent that did not save the p95. The score before was 0, so any round looked like a gain of 100%. And the TTFT rule took the users that held the first-token limit, which was 1, as the number of slots. With one slot, vLLM serves one request at a time, and the others wait in the queue. vLLM counts the time in the queue in TTFT, so this makes TTFT worse, not better.

We pressed Cancel. Kosken restarted the endpoint with the settings from before the run, and we checked the flags of the container: the same as before. Then we fixed both bugs. The score now reads the p99, which every benchmark has. For TTFT, Kosken keeps --max-num-seqs, and a check refuses any value below the users of the workload.

The second run

OP-2 had the same goal and the same workload, with auto-tune on. It took about 19 minutes.

RoundChangesFromResult
1LoRA off (no adapter was loaded), --max-num-batched-tokens 4096, --performance-mode interactivityRules+13%
2--max-num-batched-tokens 8192, --prefix-match-unit 32, --prefix-cache-retention-interval 256Kosken AIvLLM refused to start: the interval must be a multiple of the block size, 576 on this model
3--gpu-memory-utilization 0.9, --cache-aware-admission-window 8Kosken AI+11%, not better than round 1

Round 2 failed at start, and the run went on from round 1. We added a check for that interval, so the same proposal now shows as not applied, with a valid value. Round 3 did not beat round 1 by 3%, so the run stopped, put round 1 back on the endpoint and waited. We kept it.

The page of run OP-2, kept: the benchmark before BM-2, round 1 with +13%, round 2 failed with the vLLM error about the retention interval, and round 3 with +11%.
The same view in the dark theme.
The steps of a run. A round that vLLM rejects shows the error of vLLM.

Before and after

TTFT p99 of the benchmark before (BM-2) and of round 1 (BM-5), in milliseconds:

Scenario1 user4 users8 users
Chat 1k/1k113 → 187354 → 286 (−19%)1,009 → 866 (−14%)
ShareGPT57 → 42 (−26%)75 → 53 (−29%)242 → 207 (−14%)
Shared prefix419 → 346 (−17%)384 → 351 (−9%)1,318 → 1,187 (−10%)

Eight of nine points are faster. TPOT p99 stayed between 12 and 25 ms. The endpoint still holds 4 users within the service level: at 8 users, the first token of a chat takes 866 ms, and the limit is 450.

One point is slower: chat at 1 user, from 113 to 187 ms. It is not a cold start. The p50 of that level is 182 ms, so all four requests are slower. The run kept round 1 because its score is a mean over all levels. We think --performance-mode interactivity causes it, and we will measure that next. This is why the run page shows every level, and not only the score.

The comparison of BM-5 against BM-2 for Chat 1k/1k and ShareGPT: TTFT p99, TPOT p99 and requests per second at 1, 4 and 8 users, with the change in green or red.
The same view in the dark theme.
The compare after a run, level by level.

What we learned

  • A rule must know what the metric counts. TTFT includes the queue, so fewer slots cannot make it faster.
  • Kosken AI finds settings that no fixed rule has, such as the retention interval of a hybrid model. It also proposes values that vLLM refuses. Each refusal becomes a check, so the next run does not try it.
  • Small samples are noisy. With 4 requests at a level, the p99 is almost the slowest request. Read each level, and use more requests before you trust a difference of 10%.
  • Cancel and Undo must always work. Kosken saves the settings from before when a run starts, and puts them back with one restart.

What comes next

First, we will measure --performance-mode interactivity alone, to see if it causes the slower chat at 1 user. Then we will run the Balanced and Throughput goals on the same endpoint and publish the numbers.

The guides for Benchmarks and Optimize show every step. AI Ops shows in Kosken when the agent finds a GPU on one of your machines.

Tags vLLM, GPU, AI Ops, benchmarks

All posts