Local LLM Deployment: How to Estimate VRAM, Quantization, and Cost

    Deploying a large language model on your own infrastructure requires more than enough GPU memory for the weights. This guide explains how to estimate model size, evaluate hardware tiers, account for KV cache and interconnect performance, choose and validate quantized versions, and calculate the cost of self-hosted or cloud-based deployment.

    As open-source language models continue to grow, more developers and organizations want to run them on their own servers. Once a model reaches the hundred-billion-parameter range, deployment becomes a trade-off among VRAM capacity, memory bandwidth, compute performance, and storage throughput.

    This article presents practical estimation methods and then examines hardware tiers, quantization strategies, validation procedures, and cost calculations.

    1. Estimate Model Size First

    A simple formula can be used to estimate the size of model weights:

    Weight size (GB) ≈ Number of parameters (in billions) × Bits per parameter ÷ 8

    Using this formula:

    • A 100-billion-parameter model requires approximately 12.5 GB at 1-bit precision, 50 GB at 4-bit precision, and 100 GB at 8-bit precision.
    • A 1-trillion-parameter model requires approximately 125 GB at 1-bit precision, 500 GB at 4-bit precision, and 1 TB at 8-bit precision.

    These figures cover the weights only. During inference, additional memory is required for the KV cache, activations, inference-framework overhead, and scaling parameters used by quantization. Hardware planning should therefore reserve a substantial amount of headroom beyond the raw weight size.

    For mixture-of-experts (MoE) models, two numbers must be distinguished:

    • Total parameter count determines storage requirements.
    • Active parameter count determines the compute required for each inference step.

    These figures should not be used interchangeably. Doing so can either overestimate or underestimate the required hardware.

    2. Hardware Tiers for Full-Precision Deployment

    Full-precision weights are commonly stored in a 16-bit format such as BF16, with each parameter occupying two bytes. As the model grows, so does the required VRAM.

    The following three configurations are common reference points. They are only valid under specific assumptions about model size, weight precision, parallelism strategy, maximum sequence length, and batch size. Changing any of these conditions can change the conclusion.

    1. Basic Usable Tier: Eight 80 GB GPUs

    Eight 80 GB GPUs provide approximately 640 GB of total VRAM. This tier is suitable for validating functionality and getting the deployment pipeline running.

    If the weight size is close to 640 GB, very little VRAM remains for runtime overhead. In practice, this configuration may support only short contexts and is not suitable for long-document processing or long code generation.

    2. Standard Full-Experience Tier: Eight 140 GB GPUs

    Eight 140 GB GPUs provide approximately 1.1 TB of total VRAM. After loading the weights, sufficient memory remains for the KV cache, allowing longer contexts.

    This tier is more appropriate when the goal is to use the model’s long-context capabilities rather than simply verify that it can run.

    3. Production-Oriented High-Availability Tier: Two Eight-GPU Servers

    Two servers, each equipped with eight 80 GB GPUs, provide 16 GPUs and approximately 1.28 TB of total VRAM.

    This setup requires high-speed interconnects for cross-node communication. Communication bandwidth can directly affect latency and throughput. Storage planning must also account for the original weights, multiple quantized copies, and cache files. Enterprise-grade NVMe SSDs are recommended, with sufficient spare capacity reserved.

    Total VRAM is only one part of the equation. GPU memory bandwidth, GPU-to-GPU and node-to-node interconnect speeds, and storage read/write performance can all affect real-world inference performance.

    3. Dynamic Quantization: Assigning Bits by Layer

    Quantization reduces the number of bits used to represent weights, lowering both VRAM and storage requirements.

    A traditional approach applies the same bit width to every layer. Although simple, this can cause significant quality degradation when sensitive layers lose too much precision. Possible effects include more hallucinations and less stable reasoning.

    Dynamic quantization assigns different precision levels to different layers. The process generally includes three steps:

    1. Sensitivity analysis: Before quantization, evaluate how sensitive each layer is to precision loss.
    2. Mixed-precision allocation: Preserve higher bit widths for layers that are important for reasoning and feature extraction, while assigning lower bit widths to layers with more redundancy.
    3. Format conversion and packaging: Convert the resulting weights into a general-purpose format supported by the inference engine, making it easier to coordinate computation across CPUs and GPUs.

    The objective is to balance model size and output quality rather than simply pursuing the lowest possible bit width.

    The specific framework, version, supported hardware kernels, whether only weights are quantized, the precision used for activations, and the selection rules for 1-bit layers should all be checked against the official documentation for the relevant project. Without verifying these details, a configuration should not be copied directly from another deployment.

    Low-bit quantization can introduce several risks, including increased hallucinations, unstable reasoning chains, and degraded long-context performance. These issues are especially important in high-risk applications such as code generation, legal documents, and healthcare.

    4. How to Choose a Quantized Version

    Choosing a quantized version is fundamentally a trade-off between storage size and output quality. The following guidelines are based on common usage scenarios and do not prescribe a specific precision level.

    1. Personal Exploration

    Prioritize the smallest available version. Output-quality requirements are generally more relaxed in this scenario, and the main goal is to experience the model at a low cost.

    2. Internal Knowledge Bases for Small and Medium-Sized Organizations

    A medium-bit-width version may be appropriate. Evaluate it on your own document-question-answering and retrieval tasks to confirm that response quality meets day-to-day requirements.

    Use a high-fidelity version and retain a human review process. A low-bit version can serve as a lower-cost alternative, but it should not replace a higher-fidelity version without validation.

    Published model-size and accuracy figures are meaningful only when the evaluation dataset, task type, sample size, prompt template, and decoding parameters are clearly specified.

    For large language models, Top-1 accuracy alone does not fully represent capability. A more reliable approach is to compare candidate versions on a business-specific evaluation set, including overall scores, hallucination rates, and long-context performance.

    5. Validating a Quantized Model

    Before putting a quantized model into production, use a structured acceptance process:

    1. Build a business evaluation set: Collect representative questions from real workflows. Cover major tasks such as question answering, summarization, and code generation.
    2. Establish a baseline: Run the original or high-fidelity version with the same prompts and decoding parameters. Use these results as the comparison baseline.
    3. Run regression tests: Evaluate each candidate quantized version on the same dataset and compare scores, hallucination rates, and long-context performance.
    4. Perform manual spot checks: Manually review high-risk samples, paying particular attention to factual and logical errors.
    5. Roll out gradually and prepare rollback: Start with a small traffic segment and define rollback thresholds. For example, if the error rate for a critical task exceeds the baseline by a predefined margin, immediately switch back to the original version.

    6. How to Calculate Deployment Cost

    Deployment cost can be estimated with the following formula:

    Total cost = Number of GPUs × Price per GPU per hour × Usage hours + Storage capacity (TB) × Unit price + Networking, power, data-center, and operations costs

    For self-hosted deployments, hardware prices vary significantly depending on the GPU type, system configuration, and supply cycle. Actual vendor quotations should be used.

    Hardware acquisition costs are typically depreciated over three to five years and allocated to a monthly operating cost. Electricity, cooling, and data-center bandwidth must then be added.

    Cloud deployments are generally billed by the hour or by the month. They are suitable for research and testing, as well as workloads with clear traffic peaks and troughs.

    When comparing GPU instances or container services from major cloud providers, consider:

    • GPU type and VRAM capacity
    • GPU-to-GPU and node-to-node interconnect speeds
    • Storage I/O performance
    • Billing model
    • Data-compliance requirements
    • Future migration costs

    For example, assume one GPU costs 10 currency units per hour and an eight-GPU instance runs for 100 hours per month:

    8 × 10 × 100 = 8,000 currency units

    Storage, networking, and operations costs must be calculated separately. The unit price in this example is only an assumption; actual pricing should be based on the provider’s quotation.

    Conclusion

    Local deployment of a large language model is a systems-engineering project involving compute, storage, networking, and algorithmic optimization.

    Start by estimating the model’s weight size, then define the required quality level for the business use case. Finally, use real evaluation data to select the quantized version. This process makes the relationship between hardware investment and model performance much clearer.