How Much Does It Cost to Deploy a Trillion-Parameter MoE Model Locally?
This article explores the hardware and operational costs of deploying a trillion-parameter Mixture of Experts (MoE) model locally. It covers VRAM estimation, quantization impacts, communication bottlenecks in expert parallelism, cost breakdown, and a build-vs-buy analysis to help you plan your infrastructure.
1. Calculating VRAM: Storage Depends on Total Parameters
The VRAM footprint of a Mixture of Experts (MoE) model is determined by its total parameters, not the number of parameters activated during a single inference pass. While only a fraction of experts is routed to per token, the routing occurs dynamically at inference time. Therefore, all expert weights must reside in accessible memory to be loaded on demand. The activation ratio affects compute volume per inference but does not directly reduce storage requirements.
For example, consider a model with 896 experts where 16 are activated per token, yielding an expert activation ratio of roughly 1.79% (16 ÷ 896). This metric only reflects the compute ratio for the expert layers. Shared parameters, such as the backbone network, are involved in every inference pass, so it does not represent the strict overall parameter activation ratio. VRAM estimation should always be based on the total parameter count.
2. Quantization Format Determines Bytes Per Parameter
Low-bit quantization is the primary method for compressing weights. Using 4-bit weights as an example, the raw data volume for a 2.8-trillion-parameter model is 2.8 × 10¹² × 4 bits ÷ 8 ≈ 1,400 GB, representing the theoretical lower bound.
In practice, microscaling formats introduce additional overhead. Formats like MXFP4 use an 8-bit scaling factor shared across every 32 4-bit elements. This brings the average footprint per element to 4 + (8 ÷ 32) = 4.25 bits. At this rate, the weights alone require about 2.8 × 10¹² × 4.25 ÷ 8 ≈ 1,487.5 GB. The shared scaling factor helps preserve the dynamic range of values at lower bit widths.
Beyond weights, the following components must also be factored in: unquantized tensors (e.g., layers retaining higher precision), metadata, memory alignment padding, runtime workspaces, and the inference-time KV cache. The KV cache size scales with context length and concurrent requests; in long-context scenarios, it can exceed the memory used by the weights themselves.
The following function quickly estimates weight storage across different precisions (1 GB = 10⁹ bytes):
def weight_storage_gb(params_billion, bits_per_param, block_size=None, scale_bits=8):"""Estimate weight storage in GB (1 GB = 10^9 bytes)."""effective_bits = bits_per_paramif block_size:# One scaling factor shared per block, averaged per elementeffective_bits += scale_bits / block_sizetotal_bytes = params_billion * 1e9 * effective_bits / 8return total_bytes / 1e9print(weight_storage_gb(2800, 4)) # Raw 4-bit, approx 1400.0print(weight_storage_gb(2800, 4, block_size=32)) # With shared scaling factor, approx 1487.5
3. Calibrating Expectations with a Similar Model
Publicly available models with 671B parameters serve as a useful reference. In FP8 format, the main parameters plus roughly 14B auxiliary prediction parameters total about 685 GB. Using 4-bit quantization, the weights drop to around 335 GB; adding approximately 37 GB for activation-related overhead brings the total to about 400 GB. A single server with 8 GPUs (80 GB each), providing 640 GB combined, can accommodate this configuration.
The example model in this article has over four times the parameters of this reference model, scaling its weight volume proportionally. Consequently, deploying it at full precision requires VRAM far exceeding a single 8-GPU server, necessitating multi-GPU or even multi-node coordination.
4. Beyond VRAM: Communication Dictates GPU Count
Estimating based solely on VRAM suggests a modest GPU requirement. Assuming 80 GB per GPU and reserving a 30% overhead margin, you would need around 25 GPUs to hold the 1,487.5 GB of weights (1,487.5 × 1.3 ÷ 80 ≈ 25). This assumption merely illustrates the order of magnitude; actual overhead must be measured empirically.
The real constraint comes from expert parallelism communication during inference. With 896 experts distributed across multiple GPUs, each token must send its activations to the GPUs hosting the target experts for computation, then receive the results. This all-to-all communication occurs at every MoE layer, and its latency and bandwidth directly impact throughput.
The relationship between GPU count and experts per GPU is as follows:
| GPUs | Experts per GPU (896 ÷ GPUs) | Total VRAM (80GB/GPU) |
|---|---|---|
| 25 | ~36 | 2000 GB |
| 64 | 14 | 5120 GB |
| 128 | 7 | 10240 GB |
Therefore, using 64 or more accelerators to form a high-speed interconnected super-node is recommended. At this scale, the bottleneck is no longer VRAM capacity but interconnect bandwidth and latency. GPU count must satisfy both the VRAM floor and communication performance requirements.
5. What Makes Up the Cost?
The total cost of local deployment can be broken down into one-time investments and recurring expenditures:
Total Cost = Hardware Procurement + Network & Storage + Facilities & Power + Ops Staff + Software Maintenance + Capital & Depreciation
Hardware procurement is estimated as: Number of GPUs × Price per GPU × (1 + supporting ratio for servers, racks, and high-speed networking). This supporting ratio should be determined by the actual procurement plan, not generic figures.
Power typically accounts for a significant portion of recurring expenses. Monthly electricity costs can be estimated as: Total power draw (kW) × hours per month × electricity rate × data center PUE (Power Usage Effectiveness).
Alternatively, if using cloud on-demand or annual instances, the cost approximates to: Number of GPUs × hourly price per GPU × hours of usage. The choice between on-premises and cloud depends on whether the workload is continuous, requires dedicated resources, or has specific data compliance mandates.
6. Evaluating Build vs. API Service
A break-even analysis provides a baseline for this decision. Let F be the monthly fixed cost of the local solution, c be the marginal cost per API call (including power and minor ops), and p be the price per call via an external service. The break-even monthly call volume is:
Break-even Volume = F ÷ (p − c)
When the actual monthly call volume is significantly below this threshold, using a cloud service is more cost-effective. If the volume is stable and consistently exceeds it, building locally becomes viable. If data cannot leave the internal network, local deployment also ensures compliance—a benefit that shouldn’t be measured solely by price.
7. Common Paths to Cost Reduction
- Validate quantization accuracy: Low-bit formats significantly reduce VRAM, but precision loss must be evaluated on target tasks.
- Off-peak compute utilization: Renting clusters on-demand avoids prolonged idle time, making it suitable for highly variable workloads.
- Match model size to the task: Not all tasks require the full model’s capabilities. Smaller models can drastically lower hardware barriers.
- Control context length and concurrency: KV cache grows with both; limiting them directly reduces VRAM requirements.
8. Pre-Deployment Checklist
- Estimate KV cache VRAM usage based on actual context length and concurrency.
- Benchmark throughput and time-to-first-token to verify business metrics are met.
- Confirm interconnect bandwidth and network topology between servers to prevent communication bottlenecks.
- Plan failure handling strategies, specifying service degradation methods for single-GPU or single-node failures.
Note: The figures in this article are derived from public specifications for order-of-magnitude estimation. Before actual procurement and deployment, rely on empirical data from target hardware and current pricing.
