Limit images and audio per request in vLLM
serve an api
// what it does
--limit-mm-per-prompt sets the maximum media items of each type a single request may carry, as a JSON map. Raising it lets a prompt include several images or an audio clip; keeping it low bounds the per-request memory vLLM reserves for media tokens. Use an audio-capable size (E2B/E4B/12B) for the audio key.
// shell
$ vllm serve google/gemma-4-E4B-it --limit-mm-per-prompt '{"image":4,"audio":1}'// gotcha
26B and 31B are image-only, so putting "audio": 1 in the map for those models has no effect — audio input works only on E2B, E4B, and 12B.