Technical level: Intermediate. This article is for developers, ML practitioners, and infrastructure engineers choosing a GPU for a chatbot or text-generation service. You should be familiar with models, tokens, and inference. You do not need to know transformer internals or write code to follow the examples.

What to take away

  • Budget for model weights, cached context, and runtime overhead—not weights alone.
  • Choose a specific checkpoint and precision before estimating memory.
  • Include both input and output tokens, and the requests you expect to serve simultaneously.
  • Treat quantized weight sizes as estimates until you inspect the actual checkpoint.
  • Validate the intended workload before turning a memory estimate into a GPU recommendation.

An eight-billion-parameter model loads on your GPU. You send a short prompt, receive a response, and everything looks ready. Then several users submit long documents at once. The server slows down, queues requests, or runs out of memory.

What changed? The weights are still the same size, but the work surrounding them has grown. A useful GPU estimate starts with the model and ends with the workload you want to serve.

This guide covers language-model inference: running a trained model to generate text. Training and fine-tuning need different budgets. The numerical examples below are calculations from published model files, not GPU benchmark results.

Start with three memory costs

A practical budget is:

GPU memory needed = resident model weights + cached context + peak runtime overhead.

The weights are the learned values that make up the model. Their storage depends on the parameter count and numerical format.

The key-value cache, usually called the KV cache, stores information about tokens the model has already processed. Keeping it lets the model generate subsequent tokens without repeating all the earlier work. Hugging Face explains the cache mechanism.

Runtime overhead covers the other allocations needed to execute the model: intermediate tensors, temporary workspaces, graph allocations, and memory-management overhead. For example, vLLM documents that CUDA graphs consume additional GPU memory. vLLM memory guidance

Leave room beyond the calculated payloads, then measure the actual workload. There is no universal percentage that guarantees every model and inference engine will fit.

Estimate the weights first

The starting arithmetic is simple:

Weight bytes = parameter count × bits per parameter ÷ 8.

FP16 and BF16 are 16-bit formats, so they use two bytes per parameter. Ideal 8-bit storage uses one byte, while ideally packed 4-bit storage uses half a byte. Real quantized models also store information such as quantization scales. Some implementations keep selected components at higher precision. Quantization concepts, bitsandbytes documentation

Here is what the arithmetic gives for several nominal model sizes:

Calculated weight payloads only (GiB)
Parameter count FP16/BF16 weights Ideal 8-bit weights Ideal 4-bit weights
8 billion 14.90 GiB 7.45 GiB 3.73 GiB
14 billion 26.08 GiB 13.04 GiB 6.52 GiB
32 billion 59.60 GiB 29.80 GiB 14.90 GiB
70 billion 130.39 GiB 65.19 GiB 32.60 GiB

Calculated weight payloads only. These exclude quantization metadata, the KV cache, runtime allocations, and operating headroom. They are not minimum GPU recommendations.

The units matter. One GB is one billion bytes; one GiB is 1,073,741,824 bytes. This article uses GiB for memory calculations. Compare them with the usable device memory reported by your runtime, checking its units and accounting for other processes or GPU partitions.

Model names are rounded, too. A checkpoint labeled “8B” need not contain exactly eight billion parameters. For an actual deployment, use the checkpoint's tensor metadata rather than relying only on its name.

Add the context you need to keep

For conventional full-attention language models, the KV cache grows as the model retains more tokens. Longer conversations need more cache. More independently cached conversations need more again. Both the prompt and generated response contribute to the retained context. Hugging Face cache structure

Plan for the complete request: instructions, conversation history, retrieved documents, and the output you allow the model to produce. An 8,192-token input plus a 2,048-token answer is a 10,240-token sequence, not an 8,192-token workload.

Concurrency needs an equally clear definition. Four requests submitted to a queue are not necessarily four sequences resident on the GPU at once. Size for the simultaneous workload your service needs to sustain, then check whether the engine achieves it.

The simplest cache calculation assumes independent sequences. Shared prefixes, sliding-window attention, cache quantization, and offloading can change memory use. Models with different cache architectures need different calculations. Cache strategies

A worked example: the same model, four workloads

Consider Qwen3-8B with BF16 weights and a BF16 cache. Its published checkpoint contains 16,381,470,720 bytes of weight tensors: approximately 15.26 GiB. Its configuration specifies 36 layers, 8 key-value heads, and a head dimension of 128. Pinned weight index, pinned configuration

For this architecture, the ideal cache payload is:

KV bytes = 2 × layers × KV heads × head dimension × bytes per cache element × total cached tokens.

The factor of two counts keys and values. Using the published configuration and two-byte BF16 elements gives 147,456 bytes, or 144 KiB, per cached token. With grouped-query attention, use the KV-head count here, not the larger query-head count. This is a calculation from the cache tensor layout and checkpoint configuration. Cache tensor dimensions

Qwen3-8B: calculated weights and BF16 cache (GiB)
Simultaneously resident sequences Tokens per sequence, input plus output KV cache Weights + KV cache
1 8,192 1.125 GiB 16.38 GiB
1 32,768 4.500 GiB 19.76 GiB
4 8,192 4.500 GiB 19.76 GiB
4 32,768 18.000 GiB 33.26 GiB

Calculated payloads with no shared prefixes, cache quantization, or offloading. Runtime and allocator overhead are additional.

The last workload exceeds a 24 GiB GPU budget before the engine's other allocations are considered. The first being below 24 GiB does not prove it will run successfully or meet your latency target.

Notice that one long sequence and four shorter sequences have the same cache subtotal here. That does not make their performance identical: the table accounts for storage, not how quickly the GPU can process each workload.

Quantization buys room, with conditions

Lower-precision weights can reduce the largest fixed part of the memory budget. The weights-only table suggests why a quantized checkpoint may make a previously impractical GPU a candidate for testing.

However, “4-bit” is not a complete deployment specification. Identify the exact checkpoint and quantization method, confirm engine and hardware support, and evaluate output quality for your application. Formats can differ in metadata, components kept at higher precision, and execution requirements. Hugging Face quantization guidance

Weight precision and cache precision are separate settings. Smaller weights do not automatically make the cache smaller. Cache quantization can save additional memory, but its performance and quality effects need evaluation too. Cache quantization guidance

Record both choices when comparing configurations. “Model X, 4-bit weights, BF16 cache, 8,192 total tokens, one active sequence” is much more useful than “Model X fits.”

Two traps as models get larger

The first is assuming that fitting the weights leaves enough capacity to serve users. Qwen3-32B's BF16 checkpoint has approximately 61.02 GiB of weight tensors. From its published configuration, four independent 32,768-token sequences add 32 GiB of BF16 cache. That puts the calculated subtotal at 93.02 GiB, before runtime overhead. Pinned weight index, pinned configuration

The second concerns mixture-of-experts models, which activate only a subset of their parameters for each token. Qwen3-30B-A3B's publisher lists about 30.5 billion total parameters and 3.3 billion activated parameters. Its BF16 checkpoint contains approximately 56.87 GiB of weight tensors. If you keep the complete model resident across your GPUs, the active parameter count is not the number to use for weight storage. Publisher model card, pinned weight index

Multiple GPUs can help, but their memory is not automatically one interchangeable pool. The inference engine must support a suitable partitioning strategy, and communication between devices affects performance. Check tensor, pipeline, or expert parallel support for the intended deployment. vLLM parallelism documentation

Validate a workload before choosing a rental

Use the calculations to build a shortlist. Then test the service you intend to run:

  1. Fix the configuration. Record the checkpoint revision, quantization method, cache datatype, engine version, GPU model, and GPU count.
  2. Define the request envelope. Specify typical and maximum input/output lengths and the concurrent sequences you need to sustain. Include a burst of long prompts.
  3. Check capacity after startup. vLLM reports cache token capacity and an estimated maximum concurrency. Compare these with your requirement; startup success alone is insufficient. vLLM capacity logs
  4. Measure prompt processing and generation. Record memory use, time to first token, generation speed, errors, and queuing. Prefill buffers and cached tokens compete for memory, so a short-prompt test misses part of the workload. Hugging Face batching guidance
  5. Compare configurations that meet your target. A lower hourly price is useful when the configuration also delivers the capacity, latency, and reliability your application needs.

Some engines allocate a cache pool ahead of time. High allocated memory after startup therefore does not necessarily mean active requests have consumed that entire cache. Inspect the engine's capacity and usage metrics alongside process memory. vLLM cache settings

Your final requirement should describe a workload: a particular model and precision, a maximum sequence length, a target concurrency, and acceptable response times. Use that specification to narrow the GPU directory and compare rental offers. Keep the assumptions attached to the recommendation so someone else can reproduce it.

Method and sources: Researched September 24, 2026. Numerical examples were calculated from the pinned publisher configurations and weight indexes linked above. No GPU inference benchmarks were performed for this article. Prepared with AI-assisted research and writing; the hero illustration is AI-generated. Read Noach Ark's methodology for how observations and estimates should be interpreted.