How Much VRAM Do LLMs Need? Weights, Context, Workload

Vladimir Lomtev•
How Much VRAM Do LLMs Need? Weights, Context, Workload

To run an LLM, you need to account for model weights, the KV cache for active requests, intermediate buffers, and runtime overhead. The downloaded file size provides only part of the picture. A model that runs fine with a short prompt may stop fitting when you use long documents or several simultaneous users.

Prepared by Vladimir Lomtev’s AI Studio on November 14, 2026, for developers and IT teams choosing hardware. This is a memory sizing methodology for text models with illustrative examples, not a hardware benchmark or a guaranteed compatibility table. For multimodal and hybrid architectures, the memory footprint must be calculated separately. Prices and recommendations for specific GPUs are not covered here.

Contents

Why You Shouldn’t Choose a GPU by File Size Alone

The weight file stores trained parameters. During inference, the server also processes input, generates output, stores sequence states, and runs compute operations. Additional overhead varies by backend and format.

A quantized artifact may be stored on disk while some operations are performed at a different precision. There may also be auxiliary scales, metadata, and additional tensors. That’s why the phrase “the model is 5 GB” does not mean a GPU with exactly that much free memory will be enough for any request.

In NVIDIA’s inference optimization guide , weights and KV cache are treated as separate components of LLM memory. For practical procurement, you also need to add the overhead of the chosen engine and headroom for the intended workload profile.

What Memory Usage Is Made Of

Component Depends On How to Check
Weights Number of parameters, format, precision Model artifact and configuration
KV Cache Attention architecture, number of active tokens, cache precision Engine estimates and load testing
Intermediate Data Batch size and compute path Profiling, peak memory
Runtime and Libraries Engine, backend, graphs, distributed execution Startup logs and actual memory usage
Other Processes Desktop, other models, services Accelerator system monitoring

The same GPU can have different amounts of free memory in different systems. This is especially noticeable on a workstation where the accelerator simultaneously serves the display and applications. Check available memory on the target machine before running a test.

How to Estimate Weight Size

A lower-bound arithmetic estimate of useful weight data:

Weight size in bytes ≈ number of parameters × number of bits per parameter / 8

For a hypothetical dense model with exactly 8 billion parameters, the following values result:

Representation Calculation Useful weight data
16 bits 8,000,000,000 × 16 / 8 16 GB
8 bits 8,000,000,000 × 8 / 8 8 GB
4 bits 8,000,000,000 × 4 / 8 4 GB

Here GB is decimal: one billion bytes. One GiB equals 1,073,741,824 bytes. Do not mix the units shown in system tools with hardware specifications. The values in the table are calculated, not measured, and do not include format overhead or runtime memory.

For MoE, the number of activated parameters does not replace the total amount of stored weights. Even if only part of the experts works for a given token, the server must have access to the necessary artifacts. The exact placement method depends on the architecture and the engine.

How KV Cache Grows

For a standard decoder-only architecture with attention, a rough estimate of the uncompressed cache can be written as follows:

KV_bytes ≈ 2 × L × H_kv × D_head × T_active × B_element

Here L is the number of layers, H_kv is the number of KV heads, D_head is the head dimension, T_active is the total number of stored tokens across active sequences, B_element is the number of bytes per cache element. The factor 2 accounts for separate K and V. If several sequences have the same length, you can account for them through the token sum.

Illustrative example: 32 layers, 8 KV heads, head size 128, 8,192 tokens in one sequence, and 2 bytes per element. That gives 1,073,741,824 bytes, or 1 GiB of cache. Four independent sequences of that kind in this simplified model would require 4 GiB. This is a calculation for the specified parameters, not a requirement for any model with a similar name.

The formula is not universal for MLA, sliding-window attention, hybrid layers, and other ways of organizing state. Block reuse and the chosen cache precision also change placement. Refine the estimate based on the architecture and the engine documentation on KV cache.

Context Includes More Than the Current Prompt

The inputs can include the system prompt, conversation history, retrieved documents, tool descriptions, and the current request. Looking only at the last message’s text is not enough. In an agentic application, tool definitions can sometimes take up a significant portion of the context even before user data.

The output also continues the sequence and increases the state used. If acceptance testing was done with short responses, but the production scenario generates long reports, the memory profile will be different. Define the allowed output limit and the truncation handling rule in advance.

Do not set the maximum context just because the model supports it. First determine the size the process actually needs. For knowledge base search, it is often more useful to improve document selection than to pass in all materials at once. The search architecture is covered in the article on RAG for business.

Concurrency and headroom

The number of registered users, the number of network connections, and the number of sequences running at the same time are different metrics. A server can accept a request and leave it in a queue. Memory usage is driven primarily by the state of active work and the strategy used to place it.

For a GPU purchase, it helps to define several profiles: short chat, long document, batch processing, and mixed traffic. Each has its own lengths and acceptable wait time. One “average” configuration often hides a heavy scenario that causes failure.

Headroom should be chosen based on actual peaks and the required resilience, not a universal percentage. You need to account for runtime updates, service buffers, and changes in real traffic. A configuration that is too tight may work in a demo and fail under normal request variability.

When quantization helps

Weight quantization reduces the memory they occupy. If the weights themselves do not fit, this is one possible solution. However, when the problem is a long context, the main additional cost may come from the KV cache, and then compressing only the weights does not remove the whole cause.

Check format and compute kernel support separately. GGUF, AWQ, GPTQ, and FP8 refer to different levels of artifact and compute description. They cannot be treated as interchangeable toggles for one mode. The practical quantization guide shows a specific GGUF preparation workflow.

When you change precision, recheck quality. Memory is a technical constraint, but the final artifact must still preserve answer usefulness for your task. Exact fields, numbers, and cases where the model should return no value are especially important.

CPU offload and multiple GPUs

Placing part of the computation or weights in RAM makes it possible to explore configurations that do not fit fully in VRAM. But access to system memory and data transfer have their own cost. A successful start with offload does not yet mean acceptable latency.

Multiple GPUs let you distribute the model, but memory cannot always be treated as a simple shared pool. Replicated data and additional buffers may remain on individual devices. The balance depends on the chosen type of parallelism and the architecture. The vLLM scaling guide helps you choose a validation setup.

If the model fits on one device, additional replicas can address overall request volume differently than splitting a single copy. The decision should be based on load and SLOs, not just the total VRAM listed in the server spec.

How to verify the estimate before buying

  1. Lock in the exact model artifact, format, tokenizer, and engine version.
  2. Calculate a lower bound for the weights and an architectural estimate for state.
  3. Define the real input, output, and active concurrency limits.
  4. Run this configuration temporarily on suitable available or rented hardware.
  5. Record memory after startup, on the first request, and during mixed load.
  6. Test heavy allowed requests, repeated calls, and recovery after errors.
  7. Compare measured memory with latency, quality, and the number of failures.

In the protocol, separately note the memory pool reserved in advance and the state actually used. High occupied memory does not always mean the same proximity to failure: some servers reserve resources intentionally. Interpretation should come from the metrics and logs of the specific runtime.

Hardware card template

Copy the structure and fill in the actual values:

Task and quality criterion:
Model, revision, format:
Engine and version:
GPU, driver, free VRAM:
RAM and free disk space:
Input and output token limits:
Allowed active concurrency:
Memory after startup and peak memory:
Latency and error rate under load:
Decision and conditions for retesting:

The card is also useful when negotiating with a vendor: instead of asking whether “70B will run,” you get a specific configuration and acceptance scenario. The vendor can confirm the test conditions, and the team can reproduce the result.

The mechanisms behind server settings are covered in the guide to inference engines and acceleration. Before choosing hardware, it is useful to go through a comparison of self-hosted inference and API.

Frequently asked questions

Is 24 GB of VRAM enough for a 32B model?

Without the weight format, architecture, context, and concurrency, it is impossible to answer. First estimate the weights and state, then test the specific artifact under the required load.

Why does the model start, but fail on a long document?

The likely group of causes is growth in sequence state or intermediate memory. Compare a short and a long request with all other conditions unchanged and review the error message.

Does more RAM replace video memory?

RAM can be used in certain placement schemes, but it is not an equivalent substitute for VRAM in access speed. You need to check offload support and the resulting latency.

Do I need to buy a card with the maximum memory capacity?

Not necessarily. First choose the model and operating mode, then choose hardware that can pass acceptance testing with the needed headroom. Excess capacity that is not used also counts toward the cost of ownership.

How Vladimir Lomtev’s AI studio helps choose a configuration

Vladimir Lomtev’s AI studio can connect data preparation with testing and LLM deployment: define the workload, validate a suitable artifact, and integrate the chosen runtime into the process. The result of the selection should be measurable acceptance conditions, not a promise of compatibility based on a single parameter.

The first step is to define the process, the size of its documents, data constraints, and the answer criterion. Discuss the project.

How to choose the required amount of VRAM

Start with the weights, then add the state of real sequences and the engine overhead. Test the heavy scenario and mixed load on the configuration you plan to use. When buying, focus on a reproducible result for memory, latency, and quality; the file size is only an initial estimate.

Request an audit

Share your contact details and we will follow up.

← All articles

Comments (0)

Loading comments…

Leave a comment
No registration required

Book a strategy call
for agentic operations

Tell us which workflow you want to improve. We will map feasibility, risks, and the fastest MVP path.

By submitting, you agree to our privacy policy

Contacts

Global Operations

Serving U.S. clients remotely
with private cloud and on-prem options

Strategy calls by request

We respond after reviewing your workflow context.

info@agentsunrise.pro

For partnership inquiries

Have a proposal?

Write to us in messengers

© 2026 AgentSunrise