vLLM model length

Set vLLM max model length from the KV Cache budget

In vLLM, maximum model length is not just a model capability: it is a capacity reservation for prompt and output tokens across active requests.

Decision 01

Start from the useful request envelope

Define the longest prompt-plus-output path your endpoint needs to complete. Set the model-length target from that workload envelope, not from the model card maximum by default.

Decision 02

Make the reservation visible

After loaded weights and runtime headroom, the remaining GPU memory becomes the KV Cache budget. At a fixed model length, that budget determines how many full-length requests can coexist.

Decision 03

Test the boundary in the serving planner

Enter the proposed model length and target request count together. If cache pressure is tight, lower one of those two requirements before changing the GPU target or tensor-parallel shape.

Continue planning

Related decisions

Plan max model length