Kiran Tallapragada

Phi-4: GPU memory and which GPUs fit it

Hugging Face: microsoft/phi-4

Phi-4 needs about 27.3 GiB for its weights. In vLLM 0.34 at 16K context (16K is its native maximum) it starts on one A100-40 (40 GiB), with room for 2.8 requests at full context (45,624 KV tokens). Change the context, users or GPU in the calculator.

The model

Which GPUs fit it at 16K context

The fewest GPUs of each type that vLLM 0.34 will start on at 16K (16K is its native maximum), with 8 request slots: enough memory for at least one full-length request. “Requests at 16K” is how many full-length requests fit in memory at once on that setup; to serve 8 users at full length you may need more GPUs, which the calculator’s comparison table shows.

GPU GPUs to start KV tokens Requests at 16K Longest single request
L4 (22 GiB) 2 50,845 3.1 16,384
A10G (22 GiB) 2 50,783 3.1 16,384
RTX4090 (24 GiB) 2 66,512 4.1 16,384
A100-40 (40 GiB) 1 45,624 2.8 16,384
L40S (45 GiB) 1 71,777 4.4 16,384
RTX6000-Ada (48 GiB) 1 87,505 5.3 16,384
A100-80 (80 GiB) 1 255,339 15.6 16,384
H100 (80 GiB) 1 253,491 15.5 16,384
H200 (140 GiB) 1 572,016 34.9 16,384
B200 (179 GiB) 1 774,707 47.3 16,384

GPUs needed by context length

GPU 8K 32K 128K
L4 2 beyond native window beyond native window
A10G 2 beyond native window beyond native window
RTX4090 2 beyond native window beyond native window
A100-40 1 beyond native window beyond native window
L40S 1 beyond native window beyond native window
RTX6000-Ada 1 beyond native window beyond native window
A100-80 1 beyond native window beyond native window
H100 1 beyond native window beyond native window
H200 1 beyond native window beyond native window
B200 1 beyond native window beyond native window

Suggested start on one A100-40, 16K context, 8 request slots (check it on your hardware):

vllm serve microsoft/phi-4 \
  --max-model-len 16384 \
  --max-num-seqs 8

How these numbers were made

With gpu-fit 1.3.0, an open-source tool that reads the model’s architecture and mirrors how vLLM budgets GPU memory. Weights come from the checkpoint’s file sizes, KV per token from the model config, and runtime overhead is calibrated on measured vLLM runs. These are planning estimates: confirm on your own hardware before you spend money. pip install gpu-fit and run gpu-fit microsoft/phi-4 --context 16384 --max-num-seqs 8 --gpu A100-40 to get the same numbers in your terminal.

Other models

Qwen3 4B · Qwen3 8B · Qwen3 8B FP8 · Qwen3 14B · Qwen3 32B · Qwen3 32B FP8 · Qwen3 32B AWQ · QwQ 32B · Qwen3 30B-A3B · Qwen3 30B-A3B FP8 · Qwen3 Coder 30B-A3B · Qwen3-Next 80B-A3B · Qwen3 235B-A22B · Qwen2.5 72B Instruct · Qwen2.5-VL 7B Instruct · Qwen3.8 27B FP8 · Qwen3.6 35B-A3B FP8 · DeepSeek R1 Distill Qwen 32B · DeepSeek V3 · DeepSeek R1 (0528) · Mistral Small 3.2 24B · Devstral Small (2507) · Mistral Nemo 12B · Phi-4 mini · gpt-oss-20b · gpt-oss-120b · Llama 3.2 3B Instruct · Llama 3.1 8B Instruct · Llama 3.3 70B Instruct · Gemma 3 4B · Gemma 3 12B · Gemma 3 27B