Local LLM Deployment Costs: How to Calculate VRAM and Quantization Requirements

    Estimate the hardware requirements for running large language models locally by calculating model weights, KV cache usage, and runtime overhead. This guide explains quantization trade-offs, GPU memory bandwidth, hardware options, and the infrastructure and maintenance costs that can affect your deployment budget.

    1. How Much VRAM Does Local LLM Deployment Require?

    The first step in estimating local deployment costs is to calculate GPU memory requirements—not to compare GPU prices. Total VRAM usage has three components:

    • Model weights: Multiply the parameter count by the number of bits per parameter, then divide by eight to obtain the size in bytes.
    • KV cache: During inference, the model stores attention keys and values for context tokens. Its memory requirement is calculated as: 2 × number of layers × number of KV heads × head dimension × context length × concurrent requests × bytes per element.
    • Runtime overhead: The inference framework, activations, sampling buffers, and other components also consume VRAM. Typically, reserve 10–20% of total VRAM for overhead, although requirements vary considerably across frameworks.

    Consider a dense model with 70 billion parameters, or 70B. FP16 and BF16 both use two bytes per parameter, so either format requires approximately 140 GB for weights. At 8-bit precision, the theoretical weight size falls to 70 GB; at 4-bit, to 35 GB; and at 2-bit, to 17.5 GB.

    KV cache usage can be just as important. Suppose the model has 80 layers, eight KV heads, a head dimension of 128, and an FP16 cache. For one request with a 128K-token context, the cache requires:

    1. 2 × 80 × 8 × 128 × 131072 × 2 bytes ≈ 42.9 GB

    That is already larger than the model’s 4-bit weights. Serving two such requests concurrently doubles the cache requirement. Always check the model configuration file for the actual layer count and number of KV heads.

    The memory budget should therefore be:

    1. Total VRAM = model weights + KV cache for concurrent requests + runtime overhead

    As context length and concurrency increase, the KV cache accounts for a larger share of total memory usage.

    2. How Much Memory Does Quantization Save—and What Happens to Quality?

    Quantization reduces the numerical precision used to represent model weights. It makes the model smaller, but it can also reduce output quality.

    Post-training quantization (PTQ) is commonly used for local deployment. It compresses a model without retraining, often using a small calibration dataset. Common options include GPTQ and AWQ, as well as quantized models distributed in the GGUF format used by llama.cpp.

    Quantization-aware training (QAT) simulates low-precision computation during training or fine-tuning. It requires additional training compute and data. It is suitable when training resources are available, quality requirements are demanding, or deployment requires extremely low bit widths.

    Mixed-precision quantization assigns different bit widths to different parts of the model. For example, attention projection layers might remain at 8-bit while feed-forward layers are compressed to 4-bit or lower. The benefits depend on the model and require sensitivity analysis; they should not be assumed.

    The following table applies the same weight-size formula to a 70B model and a one-trillion-parameter model.

    Weight precision 70B weight size 1T weight size Typical use
    FP16/BF16 140 GB 2 TB Quality baseline
    8-bit 70 GB 1 TB Usually limited quality loss; suitable for production evaluation
    4-bit 35 GB 500 GB A common compromise for general-purpose tasks
    2-bit 17.5 GB 250 GB Significant quality risk; requires task-specific evaluation
    1-bit 8.75 GB 125 GB Primarily research-oriented; substantial general-purpose capability loss

    Actual model files are larger than these theoretical estimates. Quantization scales and other metadata add storage overhead, while embeddings, output layers, and other components may remain at higher precision.

    There is no universal measure of quantization-related quality loss. Results depend on the model, quantization method, and task. Compare candidate formats using your own evaluation set—for example:

    • Pass rates for code generation.
    • Accuracy on mathematics problems.
    • Human ratings for business question answering.

    Do not choose solely by bit width. Lower precision saves more VRAM, but it also increases quality risk.

    3. Choosing Hardware: Start with Memory Bandwidth

    LLM inference has two main stages:

    • Prefill: Processing the input is primarily compute-bound.
    • Decode: Generating tokens requires reading model weights at each step and is primarily memory-bandwidth-bound.

    At low concurrency, memory bandwidth often matters more to generation speed than peak compute performance.

    A rough upper bound for a single generation stream is:

    1. Tokens per second ≈ memory bandwidth ÷ weight bytes read per decoding step

    For example, a 70B model with 4-bit weights occupies approximately 35 GB. With 1,000 GB/s of GPU memory bandwidth, the estimated upper bound is about 28 tokens per second.

    This estimate excludes KV cache reads and framework overhead, so actual throughput will be lower. For mixture-of-experts (MoE) models, only the activated expert parameters are read at each step, so the calculation must be adjusted accordingly.

    Hardware configurations broadly fall into three categories.

    Consumer or Workstation Multi-GPU Systems

    These are suitable for technical validation of models around the 70B class or smaller.

    Two 24 GB GPUs provide 48 GB of aggregate VRAM. In capacity terms, that is enough for approximately 35 GB of 4-bit 70B weights, leaving about 13 GB for the KV cache and runtime overhead. This limits the configuration to relatively short contexts and low concurrency.

    Communication between GPUs over PCIe can also reduce performance.

    Professional Single-Server Systems

    Eight accelerators with 80 GB each provide 640 GB of total VRAM. This can accommodate the theoretical 500 GB of 4-bit weights for a 1T-parameter model, leaving approximately 140 GB for the KV cache and runtime overhead.

    Systems at this scale need NVLink or a comparable high-speed interconnect. Otherwise, communication overhead from tensor parallelism can substantially slow inference.

    Multi-Node Clusters

    Serving many users while supporting documents with million-token contexts can exceed a single server’s memory capacity. Such deployments require networking such as InfiniBand or RoCE, along with distributed storage.

    Both node count and network requirements can significantly increase costs.

    Hardware prices vary by accelerator model, condition, purchasing channel, and taxes, and GPU prices can change quickly. A fixed budget figure would therefore be misleading. Instead, obtain itemized quotes for the intended configuration and compare them against your performance targets.

    4. Hidden Costs Beyond the GPUs

    Budgeting only for GPUs is a common reason deployment costs exceed expectations. The following items also need planning.

    CPU and System Memory

    Loading model weights from storage into GPU memory requires CPU and RAM resources. At a read rate of just 0.5 GB/s, loading a 500 GB model takes approximately 17 minutes.

    Faster SSDs and better memory-channel bandwidth can reduce loading time.

    Power and Cooling

    Eight accelerators rated at 700 W each consume more than 5 kW under full load, before accounting for the rest of the server.

    Evaluate power supplies, rack cooling or liquid cooling, and the facility’s available electrical capacity.

    Storage

    Loading weights, keeping quantized copies, and writing logs all generate substantial storage activity.

    Consumer NVMe SSDs may suffer performance degradation under sustained heavy workloads. Enterprise SSDs come with a higher purchase price.

    Software Compatibility and Operations

    Support for low-bit operations varies across hardware. Driver, CUDA, and inference-framework versions must also be compatible.

    If a required format lacks support, deployment may involve modifying kernels or writing extensions. The engineering effort can cost more than expected.

    Before deployment, verify the following:

    • Are enough PCIe lanes available for the multi-GPU configuration?
    • Can the power supply and cooling system handle the expected load?
    • Are the driver, CUDA, and inference-framework versions compatible?
    • Does the chosen quantization format have supported execution kernels?
    • Are model files and configurations backed up, with a rollback plan?

    5. Choosing a Configuration for Your Use Case

    Start with the workload requirements. Define the required context length, concurrency, acceptable generation speed, and minimum quality threshold.

    Use those targets to calculate VRAM requirements, evaluate hardware, and finalize the quantization bit width.

    For personal experimentation, choose a model with fewer than 70 billion parameters.