Local LLM Deployment: Hardware Configuration and Model Sizing Guide
This guide explains how to plan hardware for local LLM inference by treating VRAM as the primary constraint. It breaks down VRAM usage into model weights, KV cache, and runtime overhead; shows how quantization changes memory requirements; maps GPU memory tiers to practical model sizes; and clarifies the limited role of system RAM and SSDs. It also outlines a standard deployment workflow and common pitfalls so readers can match model size, quantization level, and hardware to real workload needs.
1. Start with the Conclusion: VRAM Determines What You Can Run; Other Hardware Determines How Smoothly It Runs
When running large models locally, VRAM capacity is the first constraint. Model weights must reside fully or mostly in VRAM for inference speed to remain usable. System RAM, storage, and the CPU determine loading speed, system stability, and multitasking capability, but they cannot replace VRAM for holding model weights.
The selection order should therefore be: first define the target model size, then estimate VRAM requirements, and finally pair the GPU with appropriate RAM and storage.
2. Understand the Three Components of VRAM Usage
VRAM usage mainly comes from three parts.
1. Model weights
Weights are the model parameters themselves. Their memory footprint depends on the number of parameters and the number of bits used to store each parameter.
- With 16-bit floating point (FP16), each parameter uses 2 bytes, so 1B parameters require about 2 GB.
- After 4-bit quantization, each parameter uses about 0.5 bytes, so 1B parameters require about 0.5 GB.
2. Context cache (KV cache)
When generating text, the model must retain intermediate states for historical tokens. This is called the KV cache. The longer the context and the more concurrent requests, the larger the cache. Long-document question answering and multi-turn dialogue are most sensitive to this.
3. Runtime overhead
Inference frameworks, computation buffers, and memory fragmentation add anywhere from hundreds of MB to several GB. In practice, it is common to reserve 10% to 20% headroom.
The following code provides a quick VRAM estimate for preliminary hardware screening:
def estimate_vram_gb(params_billion: float,bits_per_weight: float,context_cache_gb: float = 1.0,overhead_ratio: float = 0.2) -> float:"""Estimate VRAM (GB) required for local inference. Results are for preliminary reference only."""weight_gb = params_billion * bits_per_weight / 8return weight_gb * (1 + overhead_ratio) + context_cache_gb# Example: 9B model, 4-bit quantizationprint(round(estimate_vram_gb(9, 4), 1)) # About 6.4 GB# Example: 27B model, 4-bit quantizationprint(round(estimate_vram_gb(27, 4), 1)) # About 17.2 GB
The estimate is only a starting point. Actual usage also depends on the inference framework, batch size, and context length settings. Real measurements should be used for final decisions.
3. Quantization: Trade Acceptable Accuracy Loss for VRAM Savings
Quantization is the main method for reducing VRAM usage. It converts weights from a high-precision representation to a lower-bit-width representation, reducing memory requirements proportionally.
| Storage precision | Bytes per parameter | Approx. weight memory for 9B | Approx. weight memory for 27B |
|---|---|---|---|
| FP16 | 2 | 18 GB | 54 GB |
| 8-bit integer | 1 | 9 GB | 27 GB |
| 4-bit integer (Q4) | 0.5 | 4.5 GB | 13.5 GB |
Quantization below 8 bits may cause some capability loss. The extent depends on model architecture, quantization method, and task type. For precision-sensitive tasks such as code generation and mathematical reasoning, compare results on the target task before deciding on a quantization level.
A common approach is to use 4-bit quantization for larger models so that a larger model can run within limited VRAM. This is often more worthwhile than running a smaller model with the same VRAM budget. However, the fewer parameters a model has and the more aggressive the quantization, the more noticeably output stability may decline. The right trade-off depends on business requirements.
4. Choose Model Size by VRAM Tier
The table below provides reference ranges based on the estimation formula, assuming 4-bit quantization and relatively short contexts.
| VRAM tier | Stable model size range (4-bit quantization) | Typical use |
|---|---|---|
| 8 GB | 4B and below; 9B requires controlled context length | Text classification, simple Q&A, local assistant tools |
| 12 GB | 9B class | Daily conversation, document summarization, lightweight coding assistance |
| 16 GB | 9B to 14B class | More complex writing and analysis, medium-scale coding tasks |
| 24 GB | 27B to 32B class | High-quality reasoning, long-document processing, internal team services |
Note that a mixture-of-experts (MoE) model has a large total parameter count but activates only a subset of experts during each inference pass. Its VRAM usage is still calculated based on total parameters, even though the amount of computation is smaller. Therefore, active parameters alone are not enough to determine whether VRAM is sufficient.
Models beyond the ranges above generally require multiple GPUs, large VRAM capacity, or the memory offloading approaches discussed in the next section.
5. What System RAM and SSDs Actually Do
In recent years, some approaches have attempted to let system RAM or even SSDs participate in inference to alleviate VRAM shortages. These approaches do expand the range of models that can run, but their costs need to be understood clearly.
System RAM as an offloading layer
Placing some network layers in system RAM and using the CPU to compute those layers can allow a model to start when VRAM is insufficient. The cost is frequent data transfer between VRAM and system RAM. System RAM bandwidth is far lower than VRAM bandwidth, so generation speed drops noticeably.
The role of SSDs
SSDs are mainly used to store model files and accelerate loading. If an SSD is used as the primary working area during inference, read and write latency becomes a bottleneck, and generation speed is usually unacceptable. An SSD is better suited as a model repository than as inference memory.
System RAM and SSDs can therefore expand the range of models that can run, but they cannot give a small VRAM budget the performance of a large one. To judge whether a setup is usable, consider three metrics together: whether the model can load, first-token latency, and sustained generation speed.
6. Standard Deployment Workflow
Step 1: Define requirements
Determine the use case, number of concurrent users, average context length, and acceptable response speed. These directly set the hardware lower bound.
Step 2: Choose model and quantization level
Compare output quality across model sizes and quantization levels on a small sample from the target task, then select the smallest model that meets requirements.
Step 3: Estimate resources
Use the estimation method above to calculate weights, cache, and overhead, and reserve headroom for context growth.
Step 4: Choose an inference runtime
Select an inference framework that supports quantized models, provides a local interface, and is easy to monitor. After deployment, enable access controls to prevent unauthorized access to the service.
Step 5: Validate and record
Use a fixed set of test prompts to record first-token latency, generation speed, and peak VRAM usage. Compare the results with estimates and adjust the context limit or concurrency accordingly.
7. Common Misconceptions
Misconception 1: Bigger models are always better. On limited hardware, an excessively quantized or oversized model may be less stable than a reasonably sized model. Task quality and response speed should come first.
Misconception 2: If it loads, it is usable. A model starting successfully does not mean it can handle real tasks at acceptable speed. Loading is only the first step; actual throughput must be tested.
Misconception 3: Look only at model size and ignore context. Long contexts significantly increase cache usage. Many VRAM overflow problems come from setting the context too large, not from the model itself.
Misconception 4: Ignore cooling and power supply. Sustained inference keeps the GPU at full load for long periods. Insufficient chassis cooling or power supply capacity can cause throttling or instability.
8. Summary
The core of local LLM deployment is matching: model size should match VRAM, quantization level should match task accuracy requirements, and RAM and storage configuration should match the inference approach. When selecting hardware, estimate VRAM first, then validate with real tasks, and finally make trade-offs based on speed and stability. Following this process helps achieve reliable local inference within a limited budget.
