Local Deployment of Very Large Models: Quantization, Hardware, and Cost

    This article explains how to plan local deployment of very large models by separating startup, practical usability, and production service goals. It covers total versus active parameters, low-bit quantization tradeoffs, running hundreds of gigabytes of weights on limited RAM, KV cache and concurrency costs, total cost of ownership, and a staged validation workflow for quality, performance, permissions, and recovery.

    1. Define the Goal: What Does Local Deployment Need to Achieve?

    When discussing local deployment of very large models, the first question should not be “What is the minimum memory required?” The more important question is what the deployment is expected to achieve.

    An individual developer may only need single-user interaction and may tolerate a longer initial response time. A researcher may care more about reproducing experiments and comparing different quantization schemes. An enterprise user usually requires stable response latency, concurrency handling, access control, and continuous operation. The hardware cost for these goals can differ substantially.

    It is therefore useful to distinguish three levels:

    • Able to start: the model loads and can generate text.
    • Practical: at the target input length, time to first token and sustained generation speed are acceptable.
    • Able to provide service: when multiple requests arrive at the same time, stability and latency requirements are still met.

    Low-bit quantization primarily lowers the threshold for storing weights. It does not automatically solve compute speed, long-context caching, or multi-user concurrency.

    2. What Do Total Parameters and Active Parameters Determine?

    Very large models may use a mixture-of-experts architecture. Such a model has a large number of total parameters, but when processing a token, only some experts participate in computation.

    Two metrics need to be distinguished:

    Total parameter count mainly affects the size of weight files and the memory or VRAM capacity required for the full model to reside locally.

    Active parameters per token mainly affect the scale of parameters involved in a single computation. Actual computational cost also depends on the attention structure, expert routing, data precision, operator implementation, and hardware efficiency.

    Consider a hypothetical model with 2.8 trillion total parameters and about 104 billion active parameters per token. It would be incorrect to assume that only those 104 billion parameters need to be stored. Different inputs may select different experts, and a conventional deployment still needs the full set of weights to be accessible.

    Weight capacity can first be estimated with the following formula:

    Theoretical weight capacity ≈ total parameters × average bits per parameter ÷ 8

    Using 2.8 trillion parameters as an example, with decimal capacity:

    Weight precision Theoretical weight capacity
    16-bit About 5.6 TB
    8-bit About 2.8 TB
    4-bit About 1.4 TB
    2-bit About 700 GB
    1-bit About 350 GB

    This is only an idealized estimate. It does not include quantization scales, indices, metadata, unquantized layers, or runtime buffers.

    Therefore, if a weight file is about 594 GB, it should not be interpreted simply as “all parameters occupy only 1 bit.” Under the assumed parameter count above, the file averages about 1.7 bits per parameter; this value also includes additional information inside the file.

    Similarly, for a trillion-scale total-parameter model, hundreds of gigabytes of VRAM are usually insufficient to fully hold 16-bit weights. Any seemingly low hardware requirement needs further confirmation: does it rely on quantization, host-memory offload, storage mapping, or another layered loading mechanism?

    3. Why Does Low-Bit Quantization Compress, and What Does It Lose?

    1. Quantization Compresses Numerical Representation, Not Model Structure

    The basic idea of quantization is to use fewer bits to represent weights that were originally stored at higher precision. For example, a group of continuous values is mapped to a limited set of discrete levels, and approximate values are restored through scaling factors.

    Lower bit width usually means fewer representable numerical levels and a greater likelihood of approximation error. However, the impact of that error on downstream tasks is not uniform: some layers are more sensitive to quantization, while others can tolerate more aggressive compression.

    2. “1-Bit Versions” Often Use Mixed Precision

    In practical deployment, extremely low-bit versions may use different precisions for different tensors, retain higher precision for some important weights, and store additional information for quantization groups.

    Therefore, a quantized version should not be judged by its name alone. It is also necessary to check:

    • Which tensors are quantized, and which remain at higher precision;
    • The actual file size and average bit width;
    • Which languages and tasks the calibration data covers;
    • Whether the inference framework supports the corresponding computation method;
    • Whether there is obvious degradation on the target workload.

    A smaller file is not necessarily faster at inference. If the hardware lacks a suitable low-bit compute path, the runtime may need to decode, dequantize, or convert layouts, creating additional overhead.

    3. Precision Loss Cannot Be Summarized by a Single Percentage

    Perplexity can measure how well a model predicts test text, but the result depends on the dataset, tokenization method, evaluation procedure, and context settings. Values obtained under different conditions cannot be compared directly.

    The term “accuracy” also needs clarification: it may mean token-prediction agreement with a high-precision model, or it may mean the correctness rate on a task-specific test set. These are not the same thing.

    A more reliable approach is to build your own business test set covering at least:

    • Common question answering and professional knowledge;
    • Information extraction from long documents;
    • Multi-step reasoning;
    • Code generation and issue localization;
    • Structured output formats;
    • Multi-turn dialogue consistency.

    For applications that call external tools, tests should also verify whether parameters are correct, whether execution order is reasonable, and whether recovery is possible after failure. A slight change in language quality can sometimes be amplified into a workflow execution failure.

    4. Can Hundreds of Gigabytes of Weights Run on 128 GB of RAM?

    The answer depends on what “run” means in practice, not just on memory capacity.

    If the weight file is about 600 GB and the machine has only 128 GB of RAM, the model cannot fully reside in host memory. To attempt running it, the inference implementation must be able to access weights that are not resident through storage mapping, on-demand reads, explicit offload, or similar mechanisms.

    Such an approach may make startup and generation possible, but performance must be verified separately.

    1. Memory Mapping Is Not a Capacity-Extension Trick

    Memory mapping allows a program to access a file on demand, with the operating system loading the relevant pages. It changes the access method, but it does not turn an SSD into true memory.

    When an accessed weight page is not in cache, it must be read from the storage device. If expert routing keeps switching and the cache cannot cover frequently used weights, a large number of page faults and storage accesses may occur.

    At that point, the bottleneck may no longer be computation but data movement.

    2. Fewer Active Parameters Do Not Necessarily Mean Fewer Storage Reads

    A mixture-of-experts architecture can reduce the number of experts involved in computation for each token. However, if the required expert weights are not in memory or VRAM, they still need to be loaded.

    Generation latency may therefore be affected by several factors together:

    • The cache hit rate for expert weights;
    • The volume of weights that actually need to be loaded;
    • Random read performance of the storage device;
    • Transfer bandwidth between host memory and VRAM;
    • Whether computation and data transfer can overlap.

    A rough estimate can help illustrate the bandwidth constraint:

    Lower bound on data read time ≈ data volume actually loaded in this round ÷ effective read bandwidth

    For example, if a generation step really needs to load 10 GB of data from storage and the effective bandwidth is 5 GB/s, that read alone takes about 2 seconds. This example is not a performance prediction for any model. It shows that when weights cannot be fully cached, data movement alone may limit the interactive experience.

    3. Runtime Memory Is Not Only for Weights

    Deployment also needs to reserve space for:

    • The operating system and background processes;
    • Inference compute buffers;
    • The attention key-value cache;
    • Input preprocessing and multimodal encoding;
    • Request queues and service processes.

    Therefore, “total machine memory close to the weight file size” does not mean “the model can be loaded fully and stably.”

    5. Why Do Long Context and Concurrency Further Raise Requirements?

    Weight occupancy is relatively fixed, but the key-value cache usually grows with context length and concurrency.

    In common attention implementations, the following relationship can be used for a directional estimate:

    KV cache capacity ≈ 2 × layers × cached tokens × KV heads × head dimension × bytes per element

    Specific architectures may use cache compression, windowed attention, or other designs. Actual calculation should follow the implementation.

    Two distinctions are especially important:

    First, a model declaring support for a certain context length does not mean any local machine can run stably at that length.

    Second, input processing and token-by-token generation are different stages. Long document input may cause a long prefill time. Even if subsequent generation speed is acceptable, users may wait a long time before seeing the first token.

    Enterprise deployment must also consider multiple sessions retaining caches at the same time. Capacity evaluation should therefore test short context, target business context, and peak concurrency together, rather than validating with only a short prompt.

    6. How Much Does Local Deployment Cost? Calculate the Full Cost First

    Without specific region, procurement timing, and performance targets, giving a fixed total price is unreliable. A more practical method is to break down costs and request quotes for candidate configurations.

    1. One-Time Procurement Costs

    These mainly include:

    • Compute devices and accelerators;
    • Host memory or unified memory;
    • High-speed solid-state storage;
    • Interconnect between multiple devices;
    • Power supply, chassis, and cooling;
    • Necessary spare drives and backup space.

    If the goal is only to try running hundreds of gigabytes of quantized weights, first assess whether existing equipment supports layered loading. This should not be treated as a production configuration, because successful startup does not prove acceptable response speed.

    If most weights should remain resident in memory and a more stable interactive experience is required, a large-memory server or multi-accelerator configuration is often needed. If long context and concurrency are also required, the budget will increase further.

    2. Ongoing Operating Costs

    Electricity cost can be estimated as follows:

    Monthly electricity cost ≈ average power × daily operating hours × 30 × electricity price

    Assume a system has an average power of 1.2 kW, runs 8 hours per day, and electricity costs 0.8 CNY/kWh. The monthly electricity cost would be about 230 CNY. If it runs all day, the cost would be about 691 CNY.

    These numbers only demonstrate the calculation method. They do not represent the power consumption of any specific device and do not include additional cooling costs.

    3. Use Amortization to Judge Whether Purchase Is Worthwhile

    Assume a solution has a total quoted investment of 100,000 CNY and is planned for 36 months of use. Equipment amortization alone would be about 2,778 CNY per month. Electricity, maintenance, and labor costs must be added to obtain the full monthly cost of ownership.

    This assumption is not a recommended configuration, nor does it mean that this amount can definitely support any particular model deployment. It shows that for low-frequency use, the fixed cost of local procurement may be high; for high-frequency use, strict data control, or offline operation requirements, local deployment may become more valuable.

    4. Do Not Ignore Failure Costs

    Downloading hundreds of gigabytes of files, running multiple rounds of quantization tests, troubleshooting compatibility issues, and replanning storage all take time.

    The budget should therefore also account for:

    • Download and verification time;
    • Repeated acquisition of unsuitable quantization versions;
    • Model copies and upgrade space;
    • Testing and operations labor;
    • Upgrade risk after an under-spec configuration.

    Storage planning should not be based only on the final weight file size. Leave headroom for temporary files, logs, necessary copies, and future updates.

    Step 1: Check Licensing and Compatibility

    First confirm whether the model license permits the intended use, and whether the deployment implementation supports its architecture, quantization format, input types, and expert routing mechanism. The fact that text can run does not guarantee that multimodal components will also work.

    Step 2: Define Service Boundaries

    Clarify maximum input length, maximum output length, concurrency, acceptable wait time, and whether external tools are integrated. Without these metrics, reasonable selection is impossible.

    Step 3: Establish a Quality Baseline

    Use reliable reference results to build a test set, then compare candidate quantized versions. A few rounds of dialogue are not enough to judge whether extremely low-bit quantization is acceptable.

    Step 4: Test Performance in Stages

    Start with a single user and short input, then gradually increase context and concurrency. Record time to first token, sustained generation speed, peak memory, peak VRAM, storage read volume, and error rate.

    If large amounts of storage reads persist while compute device utilization remains low, check weight residency and data transfer first instead of blindly adding compute capacity.

    Step 5: Restrict External Execution Permissions

    Commands and tool calls generated by the model must not automatically receive unlimited permissions. Configure least privilege, resource limits, operation auditing, and human confirmation, especially for high-risk operations such as file writes, database modifications, and external requests.

    Step 6: Test Recovery and Rollback

    Verify behavior after process crashes, insufficient storage space, cache exhaustion, and request timeouts. Stable operation is not just “no errors”; it also includes controlled recovery when failures occur.

    8. Final Judgment: Minimum Configuration Is Not Minimum Effective Cost

    Low-bit quantization of very large models does lower the storage threshold for weights, but actual deployment is still constrained by memory capacity, storage bandwidth, compute efficiency, and task quality.

    For individual experiments, first verify whether the model can start, whether speed is acceptable, and whether quality meets the task requirements. Then decide whether to upgrade hardware.

    For enterprise applications, first use real business tests to determine the necessary model scale and precision, then evaluate concurrency, long context, and ongoing operating costs. A smaller model combined with retrieval, business rules, and controlled tool calls may be more economical than barely running a very large model for some tasks.

    The configuration truly worth purchasing is not the one that just barely loads the model, but the one with the lowest total cost of ownership and controllable risk under the target quality and service requirements.