Picture a small team choosing between two workstations. The model they want downloads at a size that fits comfortably on the cheaper card. A quick test works. One person asks a question, an answer comes back, and the decision seems made.
Then real use arrives. Four people ask questions at once. Someone pastes a long policy document. Someone else adds a scanned page. Responses slow down, a request fails, and the logs mention memory.
The model did not change. The question did. The download size gave them a starting estimate for the weights. The team needed to know "can this workload run, at a usable speed, for the people who will use it?"
So the useful question is not how much memory a model needs. It is this: what must we measure before choosing a GPU?
GPU memory is a working budget
It helps to treat GPU memory as a budget with four lines.
Model weights. These are the parameters loaded onto the card. Their size depends on the number of parameters and the precision used to store them. When a model is split across GPUs with tensor parallelism, each GPU holds its share (NVIDIA NIM memory guide).
KV cache. As a model generates text, it keeps the keys and values for tokens it has already processed so it does not have to recompute them. Each active request has its own cache. Longer context and more simultaneous requests mean more cache in use.
Runtime allocations. These include activations during processing, CUDA graphs captured for speed, buffers for communication between GPUs, and reservations for adapters or image inputs.
Headroom. This is space for peaks, fragmentation, other processes on the same machine, and the slightly larger model you may want next year.
A model's file size describes only the first line, and sometimes not even that. Hugging Face notes that most GGUF models loaded through Transformers are converted back to full precision as they load, so they use as much memory as an unquantized model (quantization overview). Whether a compact file stays compact in memory depends on the runtime.
Used memory and reserved memory are different things
This distinction is the one that most often confuses sizing.
Memory used by active requests is the KV cache that live requests actually occupy. It rises as those requests accumulate tokens and is freed when they finish.
Memory reserved by the serving engine is what the engine sets aside when it starts. Engines handle this differently, and defaults change between releases. vLLM, for example, uses gpu_memory_utilization to set the fraction of GPU memory its model executor may use, and sizes the KV cache from it unless kv_cache_memory_bytes is set explicitly (vLLM engine arguments). Check the default in the documentation for the version you run rather than assuming it. Within the reserved space, vLLM's PagedAttention design borrows the idea of paging from operating systems to manage a cache that grows and shrinks with each request, and to reduce the memory lost to fragmentation. Hugging Face Transformers offers a dynamic cache that grows as tokens are processed, and static cache layers whose length is fixed when the cache is created (caching guide).
Two consequences follow.
First, the two kinds of memory need two measurements. A device monitor reports memory allocated on the GPU, and that figure may include an engine's up-front reservation. It does not tell you how much of the cache live requests are actually using. That figure comes from the engine itself, where the engine exposes it. In current vLLM documentation it is the vllm:kv_cache_usage_perc metric; older releases used a different name (vLLM production metrics).
Second, lowering the maximum context length does not automatically shrink the reservation. NVIDIA's NIM documentation says that reducing it limits request size, while the allocated KV cache can stay the same size. Lowering it can still help when the reserved space cannot hold even one full-length request, and NVIDIA suggests exactly that when a model fails to start. Treat maximum context as a cap on each request. Then check the engine's startup log to see what it actually reserved.
Fitting is not serving
A model that loads has passed only the first test. Serving adds two more.
Latency is how long the first token takes and how quickly the rest follow. Throughput is how much work the system completes when several requests overlap.
A card can hold the weights and still leave too little cache for the concurrency you expect. Requests then wait for space, and the experience degrades long before anything crashes. A serious sizing exercise measures memory, latency and throughput together.
What changes the answer
Precision and quantization. Fewer bits mean less memory for weights. Hugging Face is plain about the cost: fewer bits cost some accuracy, and each method trades memory, speed and accuracy differently. Test quality on your own tasks, not only on memory.
Context length. With caching, memory grows linearly with sequence length. A workload that occasionally sends very long inputs is sized by those inputs, not by the average.
Simultaneous users. The cache is shaped by batch size as well as sequence length. vLLM lists the maximum number of concurrent sequences alongside maximum context length as a way to reduce memory (conserving memory). Peak overlap matters more than the number of people who have access.
Image inputs. Multimodal models need memory for image processing. vLLM allows the number of images per prompt to be limited to reduce the memory footprint, or a modality to be disabled so no memory is allocated for it.
Serving software. Defaults differ between engines and between versions of the same engine. vLLM notes that CUDA graphs use extra GPU memory. NVIDIA's NIM passes its memory setting to different engine options depending on the backend. Size against the runtime you will actually operate.
Training and fine-tuning. These need a separate exercise. Hugging Face's description of mixed-precision training with Adam lists two copies of the weights (6 bytes per parameter), optimizer state (8 bytes) and gradients (4 bytes). That comes to about 18 bytes per parameter by my arithmetic, before activations, which vary with batch size and sequence length. The KV cache, meanwhile, is meant for inference only. An inference budget tells you little about a training run.
Three illustrative workloads
1. One person experimenting locally.
- Inputs to collect: the exact model and revision, the precision or quantization format, the runtime, and the longest prompt you actually use.
- What could exhaust memory: weights in a format the runtime expands at load time, or a default context setting far longer than you need, plus other applications sharing the GPU.
- Test before buying: load the model in the intended runtime, run your longest realistic prompt, and record peak memory and tokens per second.
2. A small team serving a text assistant.
- Inputs to collect: peak simultaneous requests, typical and longest prompt and answer lengths, a latency target, and the serving engine and version.
- What could exhaust memory: KV cache demand at peak overlap, an engine reservation set by default rather than by design, and CUDA graph memory.
- Test before buying: replay realistic requests at expected peak concurrency. Record time to first token, queueing, device memory reported, and the engine's own cache usage as separate figures.
3. A document assistant handling long inputs and several users.
- Inputs to collect: the longest real documents in tokens, how many arrive together, whether scanned pages or images are included, and the maximum context you intend to allow.
- What could exhaust memory: several long requests at once, image processing reservations, and a reserved cache that cannot hold even one full-length request.
- Test before buying: run the longest documents concurrently, including images. Observe latency at the edge, and what happens when memory runs short: queueing, rejection or failure.
Workload, memory pressure, measurement
| Workload | Main memory pressure | What to measure |
|---|---|---|
| One person, local experiments | Weights at the chosen precision; default context setting | Peak memory at load and at the longest real prompt; tokens per second |
| Small team, text assistant | KV cache at peak overlap; engine reservation | Time to first token and throughput at peak concurrency; device memory reported and engine cache usage, separately |
| Document assistant, long inputs | Long-context cache across several users; image inputs | Peak memory with longest documents running together; latency at the edge; behaviour when memory runs short |
| Fine-tuning | Weights, gradients, optimizer state, activations | A separate training run at the intended batch size and sequence length |
A reusable checklist
Before choosing a GPU, write down:
- The exact model, revision and precision.
- The runtime or serving engine, and its version.
- The maximum context you will allow, and the longest input you expect.
- Peak simultaneous requests, not total users.
- Whether images, scanned pages or other non-text inputs are included.
- The latency target, including time to first token.
- The throughput needed at peak.
- Whether training or fine-tuning will happen on the same hardware.
- Device memory reported and engine cache usage, recorded separately.
- The headroom you will keep, and why.
The decision
Do not size a GPU from a download size, a parameter count or a minimum memory figure. NVIDIA treats its own fit estimates as guidance rather than a guarantee, and a model can still fail to start on hardware the estimate allowed.
Instead, run a representative workload on the runtime you intend to operate, at the peak you expect. Record peak GPU memory, latency and throughput at that concurrency. Then size the system from those measurements, with headroom you have chosen deliberately.