A 7B Q4 model on one 24 GB GPU

A developer serves a 7B four-bit model with 32 layers and full multi-head attention. The initial workstation test uses one 4,096-token sequence and FP16 KV.

Jump to results

Inputs

Model and context
B
%
GPU and runtime

Enter bandwidth independently of the memory preset. Capacity and bandwidth specifications use decimal GB.

GB/s
%
%

Results

Runs in your browser
Required memory
6.982GB
Minimum GPU count
1GPUs Aggregate memory lower bound
Decode bandwidth ceiling
147.46tok/s Ideal aggregate across the batch

Compare measured decode speed with this bandwidth ceiling. Verify the model fits each rank individually.

GPU memory footprint
GPU memory footprint6.982 GB required on 1 devices. 2.147 GB of KV cache.Used VRAM6.982 GBWeightsKV cacheWorkspaceFree1 × 20.4 GB usable4,096 tokens / sequence
Detailed results
Model weights4.2 GB
Active KV cache2.147 GB
Activation and scratch reserve0.635 GB
Usable memory per GPU20.4 GB
Usable memory across GPUs20.4 GB
KV per cached token524.288 kB
Ceiling per sequence147.46 tok/s

What to try

Weights and cache leave ample modeled device room at batch one. Increase simultaneous sequences to see when the full multi-head cache becomes the binding allocation.

How the estimate works

KV bytes = 2 × layers × hidden width × KV-head ratio × bytes × tokens × sequences

The model assumes dense decoder-only attention. FP16 uses two bytes per parameter, FP8 and INT8 use one, and Q4_K_M uses a rough 0.60 bytes to include mixed precision and quantization metadata. Use the actual model file size to check this assumption.

Keys and values grow with the live context and batch. GQA reduces the cached width by the ratio of KV heads to query heads. Workspace is an adjustable percentage of weights plus KV, with a separate allowance for unavailable GPU memory.

The GPU count is a memory lower bound. The decode ceiling assumes perfect sharding and one sweep of weights and active KV per batch step at full bandwidth. Kernel overhead, compute, prefill, cache sharing, allocator fragmentation, and interconnect can lower measured output.

Frequently asked questions

How much cache does one 4K sequence use on this 7B model?

The given layers and hidden width use 512 KiB per token with FP16 keys and values, or 2 GiB for a 4,096-token sequence.

Why does Q4_K_M use more than half a byte per parameter?

Mixed quantization, scaling data, and some higher-precision tensors add overhead. The calculator uses 0.60 bytes as a planning estimate.

Open LLM inference & GPU VRAM calculator