Local LLM Deployment: GPU Memory Requirements and Hardware Selection

    Learn how quantization, model size, context length, and hardware architecture affect memory requirements for local large language model deployment. This guide outlines practical memory estimates for models from 2B to 30B parameters, recommends configurations across GPU tiers, and explains when unified memory or cloud infrastructure may be appropriate.

    Open-source large language models are advancing rapidly, with improvements in reasoning, context understanding, and code generation. For developers and organizations running these models locally, one practical question remains: how much GPU memory is required?

    Published memory figures often describe the theoretical storage requirements of unquantized BF16 weights. In practice, developers frequently use INT8, INT4, or lower-precision quantization to fit models onto consumer GPUs or standard enterprise hardware. As a result, BF16 figures are only a starting point for estimating memory requirements in a quantized deployment.

    This guide explains how quantization changes memory consumption and how to select hardware across common deployment tiers.

    1. How Quantization Affects GPU Memory

    Before choosing a GPU, distinguish model weight storage from total inference memory.

    At BF16 precision, each parameter requires approximately 2 bytes. A model with 10 billion parameters therefore has roughly 20 GB of raw weights.

    With INT4 quantization, each parameter requires approximately 0.5 bytes, reducing the theoretical weight storage requirement to one-quarter of the BF16 size. This reduction applies to the weights, however—not the entire inference workload.

    During inference, memory must also accommodate:

    • The key-value cache, commonly called the KV cache
    • Inference framework and runtime overhead
    • Temporary tensors used during computation

    Longer contexts require larger caches. Consequently, estimating GPU memory from weight size alone is insufficient: a usable deployment must leave room for dynamic inference overhead.

    2. Quantized Memory Estimates by Model Size

    For the model categories discussed here, the following ranges provide practical planning estimates rather than guaranteed memory requirements. Actual usage depends on the model architecture, quantization implementation, context length, and runtime configuration.

    Very Small Models: Approximately 2B Parameters

    • Estimated quantized inference memory: Around 2–4 GB
    • Suggested hardware: Lightweight systems with approximately 4 GB of GPU memory, or suitable integrated-GPU devices
    • Best suited to: Validating inference pipelines, testing API compatibility, and handling low-complexity text-processing tasks

    These models are useful when the primary goal is to verify that a local deployment works rather than maximize output quality.

    Small Models: Approximately 4B Parameters

    • Estimated quantized inference memory: Around 4–6 GB
    • Suggested hardware: A discrete GPU with 6 GB of memory, or a unified-memory device starting at 16 GB
    • Best suited to: Initial local experimentation and prototype development

    This category offers a practical balance between inference quality and accessibility on mainstream consumer hardware.

    Sparse Mixture-of-Experts Models: Approximately 20B+ Total Parameters, with Around 4B Active

    • Estimated quantized inference memory: Around 12–16 GB
    • Suggested hardware: A 16 GB GPU provides more comfortable headroom
    • Best suited to: Developers seeking stronger local inference capabilities without deploying a substantially heavier model

    Mixture-of-experts architectures activate only a subset of their parameters for computation, helping control compute requirements while supporting stronger output quality. The smaller active parameter count should not be treated as the model’s total weight-storage requirement.

    Large Models: Approximately 30B Parameters

    • Estimated quantized inference memory: Around 20–24 GB
    • Suggested hardware: A GPU with at least 24 GB of memory
    • Best suited to: Professional users and development teams with demanding requirements for generation quality, coding, and long-context processing

    These models require careful memory planning, particularly when larger contexts or concurrent requests are involved.

    3. Deployment Recommendations by GPU Memory Tier

    Around 6 GB: Entry-Level Discrete GPUs

    Start with models of 4B parameters or fewer.

    Aggressive quantization may make it possible to load a much larger model, but choosing a 20B-class model as the default starting point carries a substantial risk of running out of GPU memory.

    Set a conservative maximum context length. On a memory-constrained GPU, KV cache growth can quickly consume the space left after loading the weights.

    8–12 GB: Midrange GPUs

    This tier generally provides comfortable room for 4B-class models. Quantized versions of some 20B-class sparse models may also be worth evaluating, but they should not be assumed to fit entirely within GPU memory.

    Pay close attention to context length and runtime overhead, and avoid configurations that use every available byte. As a practical planning guideline, reserve at least 2 GB of GPU memory for runtime and system overhead.

    12–16 GB: Upper-Midrange GPUs

    This range makes 20B-class sparse models a more realistic option, especially toward the upper end.

    Loading a model successfully is not the same as running it reliably. Longer contexts increase memory pressure, while runtime allocation behavior can make overall consumption less predictable.

    Measure actual inference throughput, such as tokens per second, rather than judging the deployment solely by the GPU’s nominal capacity. Near the memory limit, some configurations may rely on transfers between system memory and GPU memory, causing a sharp drop in inference speed.

    24 GB and Above: High-End Consumer and Professional GPUs

    Quantized 30B-class models are worth evaluating at this tier and can provide high-quality output.

    Nevertheless, memory estimates are not guarantees. Long-context processing and multiple concurrent requests can substantially increase total memory consumption.

    Use monitoring tools such as nvidia-smi to observe GPU memory usage during real workloads, and adjust batch size accordingly. A configuration that works for one short request may not remain stable under sustained or concurrent use.

    4. Considerations for Unified-Memory Systems

    Unified-memory devices require a different approach from systems with discrete GPUs. Instead of separate GPU memory and system RAM, the CPU and GPU share a common memory pool.

    The main advantage is capacity flexibility. A sufficiently large shared-memory pool can accommodate model weights that would exceed the dedicated VRAM of many discrete GPUs, including models requiring tens of gigabytes.

    However, total installed memory should not be treated as memory available exclusively to the model. The operating system and other workloads share that same pool.

    Performance is another consideration. Memory bandwidth on unified-memory devices may be lower than that of high-end discrete GPUs using GDDR6X or HBM. A model can therefore fit in memory and run successfully while still being constrained by bandwidth.

    When evaluating these systems, assess two separate questions:

    • Can the model fit and run?
    • Is its inference speed sufficient for the intended workload?

    Capacity alone does not establish deployment suitability.

    5. Cloud Infrastructure as a Supplement to Local Hardware

    When local hardware cannot meet throughput or latency requirements, cloud GPU infrastructure can provide an alternative.

    Cloud platforms, including Baidu AI Cloud where the relevant services are available, can provide on-demand access to GPU compute resources. Service availability and deployment options should be checked in the official documentation for the intended region.

    A cloud deployment can combine several infrastructure components:

    • Object storage to manage large model weight files
    • Container platforms to orchestrate inference services and support scaling
    • Logging and monitoring to track GPU utilization, GPU memory consumption, and API response latency
    • Alerts to help identify resource pressure and service issues

    This approach moves the workload beyond the limits of a single local machine and can support availability and scalability requirements for production applications. It is particularly relevant when local capacity no longer matches the workload’s operational needs.

    6. Conclusion

    Estimating memory requirements for local LLM deployment requires more than multiplying parameter count by weight precision. A practical assessment must account for quantization, context-dependent cache usage, inference overhead, and the hardware’s memory architecture.

    For initial experiments, smaller models offer a manageable starting point. Larger sparse and dense models require more headroom and closer attention to context length, throughput, and concurrent workloads.

    Whether deploying on a local GPU, using a unified-memory system, or moving demanding workloads to cloud infrastructure, the same principle applies: match the model and runtime configuration to the available resources, then validate memory usage and performance under realistic conditions.