Local LLM Deployment: How to Choose VRAM, RAM, and SSD
A practical guide to sizing VRAM, RAM, and storage for running large language models locally. It explains what each resource layer controls — VRAM sets the ceiling on model capability, RAM absorbs KV cache and context overflow, and storage governs load and model-switching speed — then shows how to estimate memory requirements, avoid context overflow and OOM kills, build a load-time estimation model, and design hot/cold storage tiering. Reference configurations, a step-by-step sizing procedure, and answers to common questions about insufficient VRAM, context overflow, and slow model switching are included.
How do you choose VRAM, RAM, and SSD for local LLM deployment? What do you do when VRAM runs out? How do you avoid context overflow? How can slow model switching be improved? These questions look scattered, but they all point to the same hardware priority order: VRAM > RAM > NVMe SSD > hard disk drive. VRAM determines the ceiling on model capability, RAM determines context length and system headroom, and storage determines load and switching speed. Understanding how these three layers divide the work is what keeps you from “buying a huge disk that still can’t run anything” or “getting a model to load only to watch it stall repeatedly.”
1. Find the bottleneck first: what VRAM, RAM, and storage each handle
When running an LLM locally, many people start by comparing GPU models and parameter counts, and overlook how VRAM, RAM, and storage work together. In practice, the experience is shaped jointly by the capacity and speed of all three:
- VRAM determines the ceiling on model capability. During inference, model weights are normally resident in VRAM. If VRAM is insufficient and the inference framework supports it, some weights or the KV cache can be offloaded to RAM or disk, but speed drops significantly.
- RAM determines context length and buffer headroom. When the KV cache or weights cannot fit entirely in VRAM, RAM typically absorbs the overflow and caching. When RAM is insufficient, the system doesn’t necessarily just slow down — it may kill the process.
- Storage determines load and switching speed. Storage does not participate in per-token computation, but the wait during model startup, switching, and cold starts depends largely on the storage medium.
The overall priority can be summarized as: VRAM > RAM > NVMe SSD > hard disk drive. This also roughly matches unit cost from high to low: VRAM and RAM are usually the most expensive, SSDs come next, and hard drives are cheapest but weakest in speed.
2. The first constraint: VRAM capacity sets the model ceiling
The first step in choosing VRAM is not bandwidth or compute throughput, but whether the capacity is enough. During inference, VRAM mainly holds three things:
- Model weights: roughly the parameter count multiplied by the bytes per parameter. 16-bit precision takes about 2 bytes per parameter, 8-bit about 1 byte, and 4-bit about 0.5 bytes. The actual file also includes quantization metadata, alignment, and configuration overhead.
- KV cache: used to hold historical context; its size depends on context length, number of layers, number of KV heads, and so on.
- Framework runtime overhead: including the inference framework’s own buffers, thread scheduling, communication, and temporary tensors.
A rough formula works for estimation:
VRAM requirement ≈ weight size + KV cache size + runtime overhead
where weight size is approximately:
weight size ≈ parameter count × bytes per parameter
For example, a 7-billion-parameter model takes roughly 14GB at 16-bit precision and about 3.5GB after 4-bit quantization, but that is only the theoretical weight footprint. Actually running it also requires accounting for the KV cache and framework overhead.
In one test setup, the hardware was 16GB of VRAM and 48GB of RAM, plus a roughly 26GB high-speed persistent cache drive, running a 4-bit quantized mixture-of-experts model with a small total parameter count but only partial activation per token. The result: once the context approached ten thousand tokens, continuing to increase it created a risk of resource overflow. This shows that when VRAM is insufficient, even a model whose “total” size isn’t particularly large can see VRAM pressure escalate quickly as context grows.
If your current GPU doesn’t have enough VRAM, adding more cards is theoretically viable. But for a typical PC, multi-GPU setups are constrained by motherboard slots, PSU capacity, chassis cooling, and PCIe lanes. Without multiple full-length PCIe ×16 slots, expansion isn’t easy. Getting tens or even hundreds of GB of VRAM usually means looking at professional servers or cloud GPU instances.
3. The second constraint: context length and the RAM multiplier effect
Many people assume that as long as the model weights fit in VRAM, it will run stably. In fact, context length is often far more “greedy” about resources. The KV cache can be approximated as:
KV cache bytes ≈ 2 × layers × KV heads × head dimension × context length × batch size × bytes per element
The factor of 2 corresponds to Key and Value respectively. Double the context and the KV cache doubles too. If context keeps growing, the KV cache can exceed VRAM capacity.
Whether this then spills over to CPU-side computation depends on the inference framework and its configuration. Some frameworks support KV cache offload, which must be explicitly enabled; once enabled, performance may degrade noticeably, because the cost of moving data between VRAM, RAM, and compute units is higher.
More importantly, when RAM runs out the system does not necessarily “degrade gracefully.” When both RAM and swap space are exhausted, the OOM killer or process termination can be triggered. The exact behavior depends on the operating system, swap configuration, how the inference framework handles errors, and whether intermediate results were saved. If the inference run has already produced a long piece of generated text, logs, or data that hasn’t been written to disk, save it before adjusting configuration to avoid regenerating it.
So if you want to run long contexts stably, RAM capacity has to keep up. VRAM decides “can the weights fit,” while RAM decides “can the context hold up” and “does the system have buffer headroom.”
4. The third constraint: loading and switching, where storage speed decides the daily experience
4.1 Test environment and sample data
To compare how storage affects model loading, you can define a reproducible test environment: an 8-core/16-thread CPU, a motherboard that supports both PCIe 4.0 x4 and SATA III 6Gbps, an open-source inference tool that supports quantized models, memory mapping, and offload configuration, and a model of roughly 26GB in 4-bit quantized weights, including weight files, the tokenizer, and configuration files. Measurement can use system timing tools or framework logs, repeated three times and averaged, recording both cold-start and hot-cache states.
In an early test, a storage device with a read speed of about 200MB/s took nearly 130 seconds to load a 26GB model. Worth noting: modern high-end enterprise SSDs typically have sequential reads far above 200MB/s; around 200MB/s is closer to a hard disk drive, an older interface, or a device limited by its interface, network, or medium. The point of that test is this: when read bandwidth is around 200MB/s, load time is essentially determined by storage bandwidth.
By comparison, NVMe SSDs can reach several GB/s of sequential read. The same 26GB model typically loads in a few seconds to a dozen seconds on PCIe 4.0 x4 NVMe, tens of seconds on a SATA III SSD, and possibly minutes on a 7200 RPM hard drive.
| Tier | Typical sequential read | Theoretical load time for a 26GB model |
|---|---|---|
| RAM | Tens of GB/s | Under 1 second |
| NVMe SSD (PCIe 4.0 x4) | ~7GB/s | ~4 seconds |
| SATA III SSD | ~550MB/s | ~50 seconds |
| Hard drive (7200 RPM) | ~150–250MB/s | ~2–3 minutes |
The figures are typical magnitudes; real speeds depend on the controller, interface bandwidth, filesystem, fragmentation, cooling, and model format.
4.2 Slow loading affects switching, not just startup
Inference is not a one-off task. Keeping a model resident in VRAM and RAM means a large amount of resources is occupied for a long time. Once you open a browser, run development tools, or need to load a different model, the system may swap out data that is temporarily unused. When you ask your next question, if the page cache has already been evicted, the model may have to be read from disk again.
In real use, very few people run only one model. Code completion, document Q&A, image generation, and speech recognition often depend on different models, each anywhere from a few GB to tens of GB. Even with very large VRAM and RAM, you cannot keep all models resident indefinitely, so switching is almost unavoidable. Model versions iterate fast and quantization formats are numerous, so having several models and configurations in one directory is normal.
5. Building an estimation model for load time
Before making a purchase, you can estimate load time with a simple formula:
load time ≈ total model size ÷ effective disk read bandwidth
Here, the total model size is more than just the weight files:
total model size = weight files + quantization shards + tokenizer + configuration files
Real-world experience also involves several corrections:
- Page cache hits: if the model was just loaded and RAM is plentiful, the OS may keep the files in page cache, making the next load noticeably faster. If RAM is tight and the cache is reclaimed, it degrades into a cold start.
- Filesystem cache and fragmentation: hard drives and SSDs with long write histories may be affected by fragmentation, bad blocks, and TRIM state, so effective read bandwidth can fall below the rated value.
- PCIe transfer to VRAM: even after the disk read finishes, weights still need to be copied into VRAM or mapped. This overhead is usually small, but it adds up on low-bandwidth interfaces or platforms with weaker CPUs.
- Dequantization overhead: some inference paths perform format conversion or dequantization at load time, adding a small amount of CPU work that is usually smaller than the storage bottleneck.
- Model format and loading strategy: frameworks differ in how they implement memory mapping, sharded reads, and preload strategies, so first loads and subsequent loads can differ substantially.
You can use the following code for a rough estimate:
def estimate_load_time(model_size_gb: float,read_speed_gbps: float,cache_hit_ratio: float = 0.0,overhead_seconds: float = 0.5,) -> float:"""Estimate model load time in seconds.:param model_size_gb: Total model size in GB:param read_speed_gbps: Effective disk read speed in GB/s:param cache_hit_ratio: Page cache hit ratio, between 0 and 1:param overhead_seconds: Fixed overhead such as copying to VRAM and dequantization"""base_time = model_size_gb / read_speed_gbpscached_time = base_time * (1 - cache_hit_ratio)return cached_time + overhead_secondsdevices = [("HDD", 0.20),("SATA III SSD", 0.55),("NVMe SSD", 7.0),]for name, speed in devices:print(f"{name}: {estimate_load_time(26, speed):.1f} s")
With a high page cache hit ratio, a second load may complete almost instantly, but the first cold start is still limited by storage bandwidth.
6. Why “SSD beats HDD”: four perspectives
Daily experience. Hard drives load models in minutes; SSDs load them in seconds. Waiting several minutes every time you switch models badly interrupts your workflow, while an SSD brings switching cost into an acceptable range.
Whole-system responsiveness. If the same machine is also used for office work, development, and browsing, a hard drive slows down not only model loading but also application launch, file I/O, and system updates on the system drive. Slow model loading is often just one part of a generally sluggish machine.
Cost structure. VRAM and RAM typically cost more per GB than storage. When memory prices fluctuate, per-unit cost can be several times that of an SSD of the same capacity, and VRAM tied to a GPU costs more still. By comparison, swapping a hard drive for an SSD adds a limited amount to the budget while improving loading, switching, and system responsiveness across many high-frequency scenarios.
Data safety. Model files are read repeatedly, and many are public weights accumulated by the community over a long time. Hard drives have mechanical parts, which carry relatively higher risk under vibration, impact, or long-term powered operation. Solid-state storage has no mechanical structure, and combined with capacity redundancy, periodic checksums, and off-site backups, it is better suited to preserving these hard-won model assets.
7. Selection and configuration recommendations
Before you start buying, take a look at the quick-reference table below. These configurations are general examples and still need to be adjusted for your target model, context length, and inference framework.
| Scenario | Minimum | Recommended | Acceptance criteria | Common mistakes |
|---|---|---|---|---|
| Lightweight models (e.g. 7B/8B class, 4-bit) | 16GB VRAM, 32GB RAM, 1TB SATA III or NVMe SSD | 24GB VRAM, 64GB RAM, 1TB+ NVMe SSD | Models within 26GB cold-load in under 30 seconds, faster with a warm cache; target context runs without frequent termination | Hard drive only; ignoring KV cache and framework overhead |
| Medium models (e.g. 14B/32B class, quantized) | 24GB VRAM, 64GB RAM, 2TB NVMe SSD | 48GB VRAM, 128GB RAM, 4TB NVMe SSD | Long contexts run stably; switching between models does not frequently trigger reloads | VRAM exactly equal to weight size; long contexts enabled without enough RAM |
| Multiple models / development experiments | 24GB VRAM, 64GB RAM, 2TB NVMe SSD | 48GB+ VRAM, 128GB RAM, 4TB+ NVMe SSD plus a large archival drive | Primary models load hot; older models archived; switching time stays predictable | Putting every model on the system drive; no hot/cold tiering |
On top of that, you can put things in place with these steps.
Step 1: size VRAM from the target model. Estimate with “weight size + KV cache + runtime overhead.” If VRAM falls short, consider a model with fewer parameters and fewer active parameters, a more aggressive quantization scheme, or an inference configuration that supports KV cache offload.
Step 2: size RAM for the gap beyond VRAM. If the weights cannot all fit in VRAM, the excess plus the long-context KV cache may occupy RAM. To support fully loading a 32GB model, you need at least 32GB of RAM; adding the OS, browser, development tools, and page cache, starting from 64GB is advisable.
Step 3: prioritize NVMe SSD for storage. At minimum, install a large-capacity NVMe SSD for your primary and frequently used models. Size it as “number of common models × size per model × 2” to leave room for version updates, quantization formats, and temporary caches. If you use SATA, choose a SATA III 6Gbps SSD, and prefer NVMe where possible.
Step 4: set up hot/cold tiering. Keep frequently used models on NVMe SSD, and archive older versions and large models you don’t use for now onto a higher-capacity hard drive. This balances speed against cost.
Step 5: avoid putting disk offload in the compute path. If your inference framework supports offloading some layers to RAM, prefer RAM over disk. Disk is only a last-resort extension of capacity — once it enters the per-token compute path, the speed gap is amplified.
Step 6: use elastic cloud resources when necessary. When local VRAM and RAM genuinely cannot carry the target model, evaluate a mainstream cloud GPU service. Look at GPU model, VRAM spec, billing model, object storage bandwidth, and availability. Actual prices, specifications, and service availability are subject to the official documentation or terms of service.
8. Common questions and summary
What if VRAM is insufficient? Try a smaller model, more aggressive quantization, a shorter context, or — when the framework supports it — offloading weights and KV cache. Note that offloading to RAM or disk comes with a speed penalty.
What if the context overflows? First check VRAM, RAM, and framework configuration. Reducing context length, enabling KV cache optimizations, adding RAM, or choosing an inference framework with better long-context management are all viable directions.
What if switching models is slow? Prioritize NVMe SSD, ensure enough RAM, and keep the page cache warm for frequently used models. Build hot/cold tiering for low-frequency models instead of crowding everything onto slow disks.
Overall, the core of local LLM deployment is allocating budget and attention in the order VRAM > RAM > SSD > hard drive. VRAM and RAM decide whether it runs at all; storage decides how smooth it feels day to day. Estimate VRAM and RAM needs first, then prioritize a sufficiently large and reasonably modern NVMe SSD, and set up hot/cold tiering — that’s how local LLMs end up both runnable and pleasant to use.
