On-Premises LLM Deployment: A Practical Guide to GPU Memory, Storage, and Quantization

    Moving large language model inference onto your own hardware usually comes down to three practical constraints: GPU memory (VRAM), storage, and compute. This guide explains why teams choose on-premises inference, how model parameter counts map to hardware tiers, and how to estimate what a single inference run will actually consume — weights, KV cache, and framework overhead. It includes a ready-to-use Python estimator, a comparison of the trade-offs between FP16/BF16, 8-bit, and 4-bit quantization, storage and model-loading considerations, and deployment strategies for single-GPU, multi-GPU, and CPU-offloaded setups. It closes with a decision framework for picking a precision level and parallelism strategy that matches your real workload.

    1. Why Teams Are Moving LLM Inference On-Premises

    Running a large language model on your own hardware is typically driven by one or more of the following:

    • Data compliance and privacy: sensitive data never leaves the internal network, and inference runs entirely on-premises.
    • Cost control: for stable, high-volume workloads, a self-hosted inference cluster often costs less over time than pay-as-you-go usage.
    • Low and predictable latency: no round trip over the public internet, so time-to-first-token and throughput are easier to predict.
    • Offline availability: the model still works in disconnected or poor-connectivity environments.
    • Deep customization: you control the inference framework, quantization strategy, batching and scheduling, and post-processing logic.

    But there is a long gap between “it runs” and “it runs well,” and three thresholds stand in the way: GPU memory, storage, and compute. Understanding where those thresholds come from is the prerequisite for any hardware decision.

    2. Parameter Count and Hardware Thresholds

    Resource requirements start with the number of parameters. Models are commonly grouped into three tiers:

    • Small: roughly 1B–14B. A single consumer-grade GPU is usually enough, which suits edge and single-machine deployments.
    • Medium: roughly 30B–70B. Typically needs one high-end accelerator or several GPUs, and this is the mainstream range for private deployments.
    • Large: hundreds of billions of parameters (100B+). A single GPU’s memory is usually not enough, so multi-GPU parallelism and, in some cases, memory offloading are required.

    Parameter count is only the starting point, though. What actually determines whether a model will run is the precision its weights are stored in, how long a context you enable, and how much overhead the inference framework adds.

    3. What Consumes GPU Memory, and How to Estimate It

    The memory an inference run occupies breaks down into three parts: weights, KV cache, and framework plus activation overhead.

    3.1 Weight Memory

    Weight memory is the most straightforward component: parameter count multiplied by bytes per parameter.

    • FP16/BF16 (no quantization): 2 bytes per parameter.
    • INT8 (8-bit): 1 byte per parameter.
    • INT4 (4-bit): 0.5 bytes per parameter.

    For a model of roughly 110B parameters:

    • Unquantized: 110 × 10⁹ × 2 ≈ 220 GB
    • 8-bit: 110 × 10⁹ × 1 ≈ 110 GB
    • 4-bit: 110 × 10⁹ × 0.5 ≈ 55 GB

    Precision alone takes weight memory from 220 GB down to 55 GB — close to a 4× difference.

    3.2 KV Cache

    Autoregressive generation caches the Key/Value tensors for previous tokens. This grows linearly with context length:

    1. KV memory = 2 × batch × seq_len × num_layers × num_kv_heads × head_dim × bytes_per_element

    The leading factor of 2 accounts for the separate K and V caches. In architectures such as grouped-query attention (GQA), the number of KV heads is far smaller than the number of attention heads, which substantially shrinks the cache. In long-context scenarios (32K, 128K and beyond), the KV cache can approach or even exceed the weights themselves — the main reason memory gets tight during long-text inference.

    3.3 Framework and Activation Overhead

    The inference framework’s own memory pool, temporary buffers for operators, and intermediate tensors for sampling and decoding all take additional space. In practice, teams commonly reserve 10%–20% of the weight size as headroom.

    3.4 A Ready-to-Use Estimator

    1. def estimate_inference_memory(
    2. num_params_b: float, # Parameter count, in billions (B)
    3. bytes_per_param: float, # FP16=2, INT8=1, INT4=0.5
    4. num_layers: int,
    5. num_kv_heads: int,
    6. head_dim: int,
    7. seq_len: int,
    8. batch_size: int = 1,
    9. kv_bytes: int = 2, # Bytes per element in the KV cache
    10. ):
    11. # 1) Weight memory (GB)
    12. weights_gb = num_params_b * 1e9 * bytes_per_param / (1024 ** 3)
    13. # 2) KV cache memory (GB)
    14. kv_gb = (2 * batch_size * seq_len * num_layers
    15. * num_kv_heads * head_dim * kv_bytes) / (1024 ** 3)
    16. # 3) Framework/activation overhead, empirically 15% of weights
    17. overhead_gb = weights_gb * 0.15
    18. total_gb = weights_gb + kv_gb + overhead_gb
    19. return {
    20. "weights": round(weights_gb, 2),
    21. "kv_cache": round(kv_gb, 2),
    22. "overhead": round(overhead_gb, 2),
    23. "total": round(total_gb, 2),
    24. }

    The value of this calculation is that you can establish a lower bound on memory requirements for different precisions and context lengths before buying hardware or committing to a quantization scheme — instead of finding out the hard way that a model won’t fit.

    4. Quantization: Balancing Precision Against Resources

    Quantization represents weights in fewer bits, which compresses memory, improves throughput, and lowers the deployment bar. The three common options involve different trade-offs:

    • No quantization (FP16/BF16): highest precision and numerical stability, suited to workloads that are extremely sensitive to generation quality — but with the largest memory footprint and the highest hardware bar.
    • 8-bit: roughly half the memory of unquantized, usually with very little quality loss. A safe choice when quality comes first but resources are limited.
    • 4-bit: memory drops to about a quarter, giving 100B+ models a chance to run on fewer or smaller accelerators. At such low bit widths, watch for accumulating numerical error; long-text and complex reasoning tasks may see slight quality degradation.

    Practical recommendations:

    1. Prioritize weight quality. Weight quantization is generally more mature and robust than activation quantization, so quantizing weights to a lower bit width is often the most cost-effective starting point.
    2. Evaluate on your own tasks, not just public leaderboards. The same quantization scheme can behave very differently across tasks, so always compare before and after using real business samples.
    3. Keep calibration data representative. Post-training quantization (PTQ) is sensitive to calibration samples, so the calibration set should reflect your actual input distribution.
    4. Check how well the framework supports each format. Operator coverage and performance optimizations for 8-bit and 4-bit vary considerably between inference frameworks.

    5. Planning Storage

    Beyond runtime GPU memory, disk and system memory also have to hold the model weight files:

    • Weight files are the same size as the weight portion of GPU memory (about 2 bytes per parameter unquantized, 1 byte at 8-bit, 0.5 bytes at 4-bit) — and you need room for multiple versions and multiple quantization formats as well.
    • When loading a model, if GPU memory is insufficient and system memory is used as a staging area, physical RAM must be large enough to hold the weights, with additional headroom for the operating system itself.
    • For workloads that switch models frequently or host multiple tenants, consider keeping weights in durable storage such as object storage, and let the container platform pull and cache them on demand. This reduces pressure on local disks.

    6. Deployment Strategies by Hardware Setup

    Single-GPU Deployment

    Suitable for small to medium models. Start with the weight memory formula to confirm the model fits, then leave headroom for the KV cache and framework overhead. For medium models, a single high-end accelerator paired with 8-bit or 4-bit quantization is usually the simplest workable combination.

    Multi-GPU Parallelism

    When a 100B+ model does not fit on one GPU, tensor parallelism can split the weights across several cards, and pipeline parallelism can distribute the memory load. Memory estimation then follows “total memory = sum of all GPUs,” and inter-GPU bandwidth matters: it directly affects decode throughput.

    CPU/Memory Offloading

    When accelerator memory is insufficient, part of the weights can live in system memory or on disk, with the inference framework scheduling them as needed. This gets large models running, but at a noticeable latency cost. It fits offline batch processing and latency-tolerant scenarios, not high-concurrency online serving.

    Elasticity and Operations

    In private environments, container platforms provide environment isolation and elastic scaling. Pairing them with monitoring and alerting on memory usage, throughput, and latency makes capacity planning and incident diagnosis much easier.

    7. A Selection Decision Framework

    Overall, the decision chain looks like this:

    1. Define how much generation quality your task requires, which sets the lowest acceptable quantization precision.
    2. Use the estimation formulas to compute weight memory at the target precision, then add the KV cache and overhead to get total memory requirements.
    3. Compare against available hardware: use a single GPU if it fits; otherwise consider multi-GPU parallelism or CPU offloading.
    4. Validate the quantized model against real business samples, and step back to a higher precision if necessary.
    5. After launch, keep monitoring memory and throughput, and adjust context length, batch size, or quantization scheme as needed.

    8. Conclusion

    On-premises LLM deployment is fundamentally an engineering trade-off between quality, GPU memory, storage, and latency. Once you grasp the basic relationship “parameters × precision = weight footprint” and add estimates for the KV cache and framework overhead, you know where you stand on resources before you buy or deploy anything. Used sensibly, 8-bit and 4-bit quantization can bring 100B-class models within reach of many teams. Every decision, from quantization precision to parallelism strategy, should serve your actual business goals rather than a blind pursuit of parameter count or the lowest possible resource consumption.