Running a 671B-Parameter LLM Locally: A Configuration Guide

    This guide estimates the memory needed to run a 671B-parameter model locally at 8-bit and 4-bit quantization. It covers multi-GPU and CPU options, fine-tuning requirements, system engineering concerns, and a deployment checklist.

    1. What “Full Model” Means

    Deploying a 671B-parameter model locally requires a clear definition of “full model.” Here, it does not mean lossless training precision. It means loading all 671 billion parameters and keeping the model usable for inference. This article uses a conservative baseline: running the complete 671B model at 8-bit quantization. Quantization reduces the bit width of each weight but does not reduce the parameter count, so memory requirements remain very large.

    A conservative estimation formula is:

    M = (P × 4) / (32 / Q) × 1.2

    where M is the required memory in GiB, P is the parameter count in billions, Q is the quantization bit width, and 1.2 is a rough overhead factor. The overhead factor covers model copies, context caches, the KV cache, workspace, and framework overhead. The 1.2 factor is only a rough engineering estimate. Long contexts, high concurrency, multi-node communication buffers, and runtime memory fragmentation can all push actual usage higher.

    Substituting P = 671:

    • At Q8: M = (671 × 4) / (32 / 8) × 1.2 = 805.2 GiB
    • At Q4: M = (671 × 4) / (32 / 4) × 1.2 = 402.6 GiB

    Even with 4-bit quantization, the weights and basic runtime overhead exceed 400 GiB. At 8-bit, they exceed 800 GiB. A single GPU cannot hold the model, so deployment requires multiple GPUs, multiple servers, or a large-memory CPU system.

    2. GPU Memory and Multi-GPU Configurations

    Common accelerator cards fall into three memory tiers: 80 GB, 48 GB, and 24 GB. The table below shows theoretical configurations in three groups: Q8 with redundancy, Q8 compact, and Q4. The numbers are rough planning estimates for total card count and server count. They are not product recommendations. Actual deployments depend on the parallelism strategy, context length, concurrency, KV cache policy, and memory reserved for overhead.

    Per-GPU memory Q8 with redundancy Q8 compact Q4
    80 GB 2 servers with 8 GPUs each 1 server with 8 GPUs + 1 server with 4 GPUs 1 server with 6 GPUs
    48 GB 3 servers with 8 GPUs each 2 servers with 8 GPUs each + 1 server with 4 GPUs 1 server with 8 GPUs + 1 server with 2 GPUs
    24 GB 5 servers with 8 GPUs each 4 servers with 8 GPUs each + 1 server with 4 GPUs 3 servers with 8 GPUs each

    With 80 GB cards, Q8 needs roughly 12 to 16 GPUs to leave a reasonable margin. With 48 GB cards, it needs about 20 to 24 GPUs. With 24 GB cards, it needs 24 to 40 GPUs. More cards mean more cross-GPU and cross-node communication overhead and a more complex failure domain. Enough total memory does not guarantee that the model will run well. Multi-node deployments usually require high-speed interconnects, low-latency networking, and a suitable parallel partitioning strategy. Without these, the system can suffer from communication waits, lower throughput, and long-tail latency.

    The Q4 approach lowers the memory threshold to about 402.6 GiB, but quantization can degrade quality. The impact is most visible in long-context reasoning, complex instruction following, and code generation. Before adopting Q4, run a structured evaluation. Compare accuracy, stability, and refusal rates against the Q8 baseline using samples from your own workload, then decide whether the trade-off is acceptable.

    3. CPU Inference: Feasible, but with Clear Limits

    For CPU inference, running Q8 requires at least one dual-socket, high-core-count server with about 1 TB of memory. Q4 has the same structure but a lower memory requirement. CPU deployment makes memory capacity easier to expand and procurement relatively simple. Its bottlenecks are significant, however. Memory bandwidth is limited, CPU parallel compute is weak, and a model of this size leaves almost no spare compute headroom.

    In practice, first-token latency is high and throughput is low. Long-context and high-concurrency workloads are harder to sustain. CPU inference suits offline batch processing, model validation, low-concurrency internal tools, or a fallback for a GPU deployment. It is not suitable for interactive production services. If you choose CPU inference, focus on high-bandwidth multi-channel memory, NUMA affinity, huge page configuration, KV cache management, and request queue control. Fine-tuning or training on CPUs is generally impractical and should not be part of a production plan.

    4. Fine-Tuning and Training Require Separate Sizing

    Being able to run inference does not mean you can fine-tune the model. With parameter-efficient methods such as LoRA, the base weights still have to stay fully resident in memory. The memory requirement is generally close to inference. You also need room for adapter parameters, optimizer states, activations, and framework overhead. Full-parameter fine-tuning requires much more. It typically needs 6 to 10 times the inference memory. Based on the estimates above, full-parameter fine-tuning of a 671B model could require memory on the scale of several terabytes. That demands large-scale parallelism, checkpoint sharding, and high-bandwidth interconnects.

    If your goal is domain adaptation or specialized training, evaluate parameter-efficient fine-tuning, partial layer freezing, data distillation, and smaller-model validation first. If you do need full-parameter training, plan for high-speed interconnects, storage throughput, fault recovery, and training stability. Do not size a training cluster based only on inference GPU counts.

    5. System Engineering and Cost Control

    Deploying a 671B model locally involves more than buying accelerators. You also need to plan storage, loading, power, cooling, and monitoring. Model weights typically run to hundreds of GB, so the loading stage needs fast local disks or an object storage distribution path. Multi-node deployments should plan for parallel loading and checksum verification. Calculate total power draw and rack cooling in advance so the facility can support the hardware. At runtime, monitor memory usage, temperature, network bandwidth, request queues, first-token latency, and throughput, and define capacity thresholds.

    For cost, inference workloads prioritize memory capacity, memory bandwidth, energy efficiency, and total cost of ownership. Training workloads prioritize interconnect bandwidth between GPUs and between nodes. Accelerators with strong compute and large memory may offer better inference value, but large-scale training is still constrained by communication bandwidth. If you prefer cloud deployment, Baidu AI Cloud offers general-purpose services such as on-demand GPU instances, container platforms, object storage, and log monitoring. Use them for elastic validation before deciding how much hardware to buy locally. Check the official documentation for service availability in your region.

    6. Deployment Checklist

    1. Define the precision target: Q8 or Q4, and confirm whether the output quality is acceptable for your workload.
    2. Calculate the base memory with the formula, then add a 20% to 30% safety margin.
    3. Estimate concurrency, context length, and KV cache growth.
    4. Choose a tensor parallelism, pipeline parallelism, or expert parallelism strategy.
    5. Plan multi-node interconnects, storage loading, power, and cooling.
    6. Run load tests and record first-token latency, throughput, and tail latency.
    7. For fine-tuning, validate parameter-efficient methods first. Treat full-parameter training as a separate project.
    8. Make decisions based on total cost of ownership, not the price of a single card.

    The following illustrative script shows the estimation logic:

    1. P = 671 # parameter count in billions
    2. for Q in [8, 4]:
    3. base = (P * 4) / (32 / Q)
    4. total = base * 1.2
    5. # output Q and total

    Overall, the main barriers to running a 671B-parameter model locally are memory capacity, interconnect bandwidth, and systems engineering capability. Q8 suits workloads that require stable quality, but it needs a base capacity of about 805.2 GiB plus redundancy. Q4 lowers the threshold to about 402.6 GiB, but it carries quantization risk that must be evaluated. A sound approach starts with capacity planning using the formula, validates parallelism strategy and output quality in a small-scale environment, and then decides between local procurement and elastic cloud deployment.