Deploying Extra-Large Models Locally: Requirement Tiers and Cost Estimation

    Deploying extra-large models locally requires clear goals, ranging from simply running the model to supporting concurrent users. This article categorizes deployment requirements into three tiers, details VRAM estimation formulas, quantization strategies, and memory offloading techniques, and provides a comprehensive cost estimation and hardware validation framework to guide your local deployment decisions.

    1. Define Deployment Objectives First

    Before deploying an extra-large model, you need to determine whether the goal is “to run” or “to be usable.” The hardware requirements for these two goals differ significantly. In practice, requirements are typically divided into three tiers:

    1. Runnable Tier: You only want to verify that the model can load normally and answer questions, without caring about generation speed.
    2. Single-User Tier: For interactive use by one person, the generation speed should reach approximately 25 tokens/s. This is an industry-standard empirical threshold, close to human reading speed, ensuring a basically fluent conversational experience.
    3. Small-Scale Service Tier: The system must support 10 concurrent requests, with each stream maintaining a generation speed of no less than 25 tokens/s. The throughput requirement for this tier is much higher than the previous two. VRAM must accommodate both model weights and the KV Cache for multiple concurrent requests, causing capacity demands to multiply.

    Only after defining the tier can you reverse-engineer the required VRAM, system memory, storage capacity, and number of devices. If you skip this step and jump straight to hardware selection, the common result is either overspending or an experience that falls short of expectations.

    2. Estimating VRAM Requirements

    The space occupied by model weights can be estimated using a simple formula:

    Weight Memory ≈ Parameter Count × Bits per Parameter ÷ 8

    The following sample code calculates based on 1 GB = 10⁹ bytes:

    1. def weight_memory_gb(params_billion: float, bits_per_param: float) -> float:
    2. """Estimate model weight memory (GB)"""
    3. total_bytes = params_billion * 1e9 * bits_per_param / 8
    4. return total_bytes / 1e9

    Taking a 1T (1000B) parameter model as an example, the weight size under different precisions is as follows:

    Storage Precision Bits per Parameter Weight Size (Approx.)
    16-bit 16 2000 GB
    8-bit 8 1000 GB
    4-bit 4 500 GB
    2-bit 2 250 GB
    1-bit 1 125 GB

    Actual memory usage is usually higher than this number for three reasons:

    • Certain structures like embedding and output layers often retain higher precision and are not fully compressed.
    • The KV Cache size grows with context length and concurrency; in long-context scenarios, it may exceed the weights themselves.
    • The inference framework and runtime consume additional VRAM and system memory.

    For Mixture of Experts (MoE) architectures, two metrics must be distinguished. Total parameters determine how much space the weights occupy. Activated parameters determine the compute per token, directly affecting decoding speed. The routing module needs fast access to all experts, so it is best to keep total parameters resident in faster storage tiers; otherwise, speed will drop noticeably.

    3. Quantization: Low Bit Does Not Mean Low Quality

    Quantization is the process of mapping weights from high-precision floating-point numbers to low-bit representations. Its core objective is controlling precision loss. There are three common strategies:

    1. Uniform Quantization
    All layers use the same precision. It is simple to implement, but when the bit-width drops to very low levels, errors concentrate on layers that have a large impact on output, leading to a significant drop in quality.

    2. Mixed Precision (Layer-wise Bit Allocation)
    Bit-width is allocated based on the sensitivity of each layer to the output. Sensitive layers retain higher precision, while highly redundant layers are compressed to lower bit-widths. An illustration is as follows:

    1. # Illustration: Allocating bit-width by layer type (specific values depend on actual evaluation)
    2. bit_policy = {
    3. "embed_tokens": 8, # Embedding layer, major impact on input representation
    4. "lm_head": 8, # Output layer, directly affects sampling distribution
    5. "attn.q_proj": 4, # Attention projection, moderately sensitive
    6. "moe.experts": 2, # Expert weights take up the most volume, offering the highest compression gains
    7. }

    3. Quantization-Aware Training (QAT)
    Low-precision computation is simulated during the training phase, allowing the model to actively adapt to quantization errors. Compared to compressing after training, it typically retains more capability at the same bit-width.

    When evaluating quantization quality, two types of metrics are commonly used:

    • Perplexity: Measures the model’s predictive uncertainty for text. Lower is better, suitable for comparing different compressed versions of the same model.
    • Task Accuracy: The accuracy on downstream evaluation sets, which is closer to actual usage performance.

    Both metrics need to be considered together. Even among low-bit versions, different quantization strategies can perform very differently at similar sizes. Therefore, when making a selection, you should compare evaluation data rather than just looking at the bit-width number.

    4. Memory Tiering and Offloading

    Local devices typically have multiple storage tiers, where speed and capacity are inversely related:

    • GPU VRAM: Highest bandwidth, smallest capacity.
    • System Memory or Unified Memory: Lower bandwidth, larger capacity.
    • Local SSD: Largest capacity, but bandwidth is more than an order of magnitude lower than memory.

    Offloading refers to placing weights that cannot fit into faster tiers into slower tiers, reading them on demand during inference. This allows the model to load and run, but every access to weights in the slower tier adds latency, causing generation speed to drop.

    Take a quantized model of about 500 GB as an example. If the device’s memory is only 128 GB, about three-quarters of the weights must be placed on the SSD. At this point, the model can run, but the speed is primarily limited by the SSD read speed. Empirically, when the total available memory is close to the model size, the extra disk read overhead is minimized, and the experience is noticeably better.

    When using offloading, you also need to reserve sufficient storage space. Weight files, runtime caches, and other copies of the model will occupy disk space, so capacity planning should be considered at the TB level.

    5. Cost Estimation Framework

    The cost of local deployment is divided into three parts:

    Total Cost = One-time Hardware Investment + Ongoing Operational Costs + Hidden Costs

    • One-time Hardware Investment: Procurement costs for compute devices, memory, high-speed storage, network equipment, etc.
    • Ongoing Operational Costs: Electricity, cooling, server room or space fees.
    • Hidden Costs: Equipment depreciation, operations and maintenance (O&M) labor, downtime losses.

    Based on the three requirement tiers, general selection directions can be provided:

    • Runnable Tier: A workstation with large memory plus high-speed external storage is sufficient. The main cost lies in storage, and the hardware investment is relatively controllable.
    • Single-User Tier: Requires devices where the combined VRAM and memory capacity is large enough, or a multi-GPU workstation. You should calculate the amortized cost based on daily usage hours to determine whether purchasing is more cost-effective than renting.
    • Small-Scale Service Tier: Usually requires multi-GPU servers or clusters, accompanied by an inference serving framework, load balancing, monitoring and alerting, and logging services. The proportion of O&M costs in the total will rise significantly.

    If usage is unstable, cloud instances billed by the hour or by usage offer more flexibility, suitable for evaluation phases and intermittent tasks. For specific pricing, refer to the billing rules published by the service provider; specific quotes are not provided in this article.

    6. Hardware Selection and Validation Steps

    It is recommended to proceed with the following steps to avoid making purchasing decisions without empirical data:

    1. Define Tiers and Metrics: Determine the target values for Time to First Token (TTFT), single-stream generation speed, and concurrency.
    2. Estimate Capacity: Use the weight formula to estimate the model size, then add KV Cache and runtime overhead.
    3. Choose a Quantization Strategy: Compare the size, perplexity, and task accuracy of different schemes, and select the version with the best quality within the target capacity.
    4. Small-Scale Testing: Run benchmarks on candidate devices, recording actual speed, VRAM, and memory usage. Below is a sample code for measuring generation speed:
    1. import time
    2. def measure_tps(generate_fn, prompt: str, max_new_tokens: int = 256) -> float:
    3. """Measure single-stream generation speed (tokens/s). generate_fn is a placeholder for the inference interface and should be replaced with the actual call."""
    4. start = time.perf_counter()
    5. generated = generate_fn(prompt, max_new_tokens) # Returns the actual number of generated tokens
    6. elapsed = time.perf_counter() - start
    7. return generated / elapsed
    1. Decide on Purchase or Rent: Based on the test results and expected usage duration, compare the total cost of buying versus using the cloud.

    7. Conclusion

    The barrier to local deployment of extra-large models is lowering. Low-bit quantization and offloading technologies have made the conditions for getting a model to “run” much more relaxed. However, achieving target speeds and supporting concurrent users still relies on large-capacity VRAM, high-bandwidth interconnects, and a reasonable inference architecture. For individual users, this is suitable for verifying model capabilities and familiarizing themselves with the deployment process. For production environments, decisions should be based on empirical data, combined with tier requirements and total cost analysis.