Skip to content
Signalcraft
日本語

← Back to Signalcraft

Separating vLLM Token Limits and Reasoning Settings

Separating vLLM Token Limits and Reasoning Settings

The vLLM “token limit” is not one value.

Separate model context, input and output per request, concurrency, KV cache, and GPU memory.

Reasoning settings are not a switch that adds reasoning ability to every model in vLLM.

The model, chat template, and reasoning parser must support the behavior together.

Separate configuration roles from runtime behavior

Setting Controls Common misconception
--max-model-len Maximum context including input and generation for one sequence It is only an output limit
max_tokens Maximum output allowed for one request The model always generates that amount
--max-num-batched-tokens Tokens handled in one scheduling step It is the context length
--max-num-seqs Concurrent sequences Increasing it always increases speed
--gpu-memory-utilization GPU-memory fraction assigned to vLLM It accounts only for weights

Current vLLM engine arguments state that max-model-len is derived from model configuration when omitted.

A model declaring a long context does not mean that the GPU can run that context concurrently.

Check GPU memory and KV-cache headroom separately.

Express the input and output constraint

One request generally needs:

input tokens + maximum generated tokens <= max-model-len

max_tokens=8192 does not force 8192 generated tokens.

EOS, stop conditions, and tool calls can end generation earlier.

Setting a large maximum can reduce room for concurrent scheduling.

Do not choose daily settings from the model’s advertised maximum.

Collect input and output distributions close to production and add margin above the 95th to 99th percentile.

Inspect GPU-memory components

GPU memory contains model weights, runtime temporary space, and KV cache.

KV cache grows with context length and concurrent sequence count.

These changes therefore interact:

  • Increasing max-model-len
  • Increasing max-num-seqs
  • Changing KV-cache dtype
  • Using a larger model or higher-precision weights

When OOM occurs, do not reduce context length alone.

Separate concurrency, batch tokens, quantization, and other processes on the same GPU.

Treat pushing gpu-memory-utilization to the limit as a last step and leave room for the driver and other processes.

Identify the role of a reasoning parser

A reasoning model may return internal reasoning and a final answer in a model-specific format.

vLLM’s Reasoning Outputs uses a compatible parser to separate them.

A mismatch can mix reasoning into normal content, leave the reasoning field empty, or conflict with the chat template.

The meaning of reasoning_effort also depends on the model and template.

Accepting the setting does not mean that every model processes it the same way.

Check official compatibility information and the model card, then measure reasoning fields and usage tokens in responses.

Increase settings one layer at a time

Use this order for diagnosis:

  1. Check the model card’s context length and recommended template
  2. Send one short request
  3. Inspect raw output without a reasoning parser
  4. Add the compatible parser and inspect the separation
  5. Increase input length toward production conditions
  6. Increase max-num-seqs gradually
  7. Record throughput, time to first token, OOM, and KV-cache usage

Changing everything at once mixes model, template, and memory failures.

Treat a configuration as a measurement starting point

vllm serve MODEL_ID \
  --max-model-len 32768 \
  --max-num-seqs 4 \
  --gpu-memory-utilization 0.90 \
  --reasoning-parser MODEL_SUPPORTED_PARSER

These are not recommended universal values.

They are a starting example to change according to GPU, quantization, model, and input distribution.

max-model-len owns context capacity, batching owns work volume, GPU settings own feasibility, and the reasoning parser owns output interpretation.

Separating these four responsibilities makes configuration changes easier to explain.

References