Serving an LLM with vLLM means choosing settings: how many requests share the GPU (--max-num-seqs), the number format (quantization, dtype), how much memory to reserve, whether to cache repeated prompts, and more. They interact, and the best combination depends on your model, your prompts and your GPU. Most people try three or four combinations, pick one that works, and move on.
InferPlan is an open-source Python library that does this search for you. In simple words: you tell it how much traffic you have and how fast it must respond, and it tells you the cheapest vllm serve setup that fits.
What it does
- Measures. It starts a vLLM server for a few settings on your own NVIDIA GPU, sends real streaming requests, and records time-to-first-token, time-per-output-token, end-to-end latency, throughput and cost.
- Checks that your machine stayed stable. GPUs can drift (heat, power, background load). Before, during and after every sweep it re-measures one fixed reference setting. If the reference moves, the sweep is thrown away.
- Learns. From the measurements it fits a small model of decode step time (
step = c0 + c1 × batch^α), first-token time, and queueing delay.inferplan fitshows its own error by holding out each run in turn. - Decides. You give it your request rate, prompt and output lengths, and p99 latency limit. It estimates the settings it did not run, and prints the cheapest command, the GPU count, the cost per 1000 requests and a command to verify the prediction by measurement.
It wraps vllm serve and does not modify vLLM.
Install and use
You need an NVIDIA GPU, nvidia-smi and Python 3.10 or newer (on Windows, use WSL2).
pip install inferplan[serve] # includes vLLM inferplan sweep --sweep knee --reference-every 4 # measure (~15 minutes) inferplan fit # learn, and show its error inferplan plan --rate 20 --p99-ms 2000 # decide Why the reference control matters
On my laptop GPU, one fixed setting measured 4730, 3083 and 801 tokens/s within 25 hours. Each reading repeated within 0.2%, so every individual result looked trustworthy. Nothing in the configuration had changed; the machine had drifted. Without a control that returns to a known setting, you would credit that difference to whichever knob you were turning.
Status
It is an alpha release. I tested it with vLLM 0.34 on several NVIDIA GPUs (including 2-GPU tensor parallel) and Qwen2.5-0.5B, Qwen3-4B, Qwen2.5-7B and AWQ 7B. The controlled sweeps use small models; larger-model results are single sessions.
Feedback needed
- Does the decode-time model fit your GPUs and models?
- Which flags should the sweeps cover next?
- Where do its predictions disagree with what you see in production?
GitHub: https://github.com/MuslimAqeel311/inferplan (MIT license)
Archive: https://doi.org/10.5281/zenodo.24770350