Hardware and Cost Breakdown for Local Deployment of Trillion-Parameter Sparse Models
This article provides a realistic assessment of the hardware and costs required to deploy trillion-parameter sparse models (such as MoE architectures) locally. Using a 2.8-trillion-parameter model as an example, it breaks down VRAM budget calculations, GPU selection, performance benchmarking, and monthly operational expenses. It also includes a pre-deployment checklist to help teams evaluate whether self-hosting is viable compared to using hosted inference APIs.
Introduction: Calculate VRAM Before Deployment
Many developers see “Mixture of Experts” (MoE) and “sparsity” and assume the model can run on a few consumer-grade GPUs. This article uses a sample model to illustrate the real threshold. The model has a total of 2.8 trillion parameters, natively stored in 4-bit precision, with approximately 104 billion parameters activated per token. The figures here apply only to this hypothetical model; for other models, recalculate based on their configuration files. Readers can follow along based on four key questions: How much VRAM do weights occupy? Which GPU types can fit them? How is inference speed measured? How much will it cost per month?
1. Sparse Architecture Does Not Reduce Resident VRAM
During MoE inference, only a subset of experts is activated, leading to the misconception that only the activated parameters need to be loaded. This assumption is flawed. Expert routing is dynamic; different tokens within the same request and different decoding steps may select different experts. If inactive weights are stored in CPU memory or NVMe drives for on-demand loading, PCIe or NVLink bandwidth becomes a bottleneck, causing noticeable decoding speed drops.
Therefore, when the inference service starts, all 2.8 trillion parameters must be loaded into the high-bandwidth memory (VRAM) of the accelerators.
2. Four Components of the VRAM Budget
VRAM requirements consist of four parts:
| Item | Calculation Method | Example Estimate |
|---|---|---|
| Model Weights | Parameters × Bit-width ÷ 8 | 1.4TB |
| KV Cache | See formula below | Scales with context length and concurrency |
| Activation Buffers | Scales with batch size and sequence length | Requires testing |
| Safety Margin | 5% to 10% of total VRAM | Calculated based on total VRAM |
The weight calculation is straightforward: 2.8 trillion × 4 bits ÷ 8 = 1.4TB. This is the uncompressed baseline. If weights are restored to FP16 or BF16, the footprint becomes 5.6TB; at 8-bit, it is 2.8TB. This article assumes native 4-bit, so 1.4TB is used.
KV Cache is used to store the attention states of historical tokens. The formula is as follows:
- KV Cache per token = 2 × Number of layers × Number of KV heads × Head dimension × Bytes per element
- Total usage = KV Cache per token × Context length × Concurrent requests
Using a set of hypothetical parameters: 80 layers, 8 KV heads, head dimension of 128, and FP16 for KV Cache (2 bytes per element). A single token takes about 320KB. A single 32K context stream requires about 10.7GB, and 40 concurrent streams require about 429GB. If the context lengthens to 128K, a single stream approaches 43GB. These numbers depend on the real model’s configuration and are used here only to illustrate the scale.
Calculating just the weights and reserving 10%, the minimum total VRAM is at least 1.56TB. This is the lower limit for “fitting the model.” To leave room for KV Cache and activation buffers, the actual total VRAM must be significantly higher.
3. GPU Selection: Minimum Card Count and 8-GPU Margin
The table below compares common data center GPUs based on native MXFP4 computing capability, single-GPU VRAM, and 8-GPU configurations. GPU specs are based on vendor datasheets.
| GPU Type | Single VRAM | Native MXFP4 | Min. GPUs for Weights (10% reserved) | Total VRAM (8 GPUs) | Usable VRAM (8 GPUs, minus 10%) | Margin for KV & Activations (8 GPUs) |
|---|---|---|---|---|---|---|
| Hopper (e.g., H100) | 80GB | No | 20 | 640GB | 576GB | Insufficient |
| Hopper (e.g., H200) | 141GB | No | 12 | 1128GB | 1015GB | Insufficient |
| Blackwell (e.g., B200) | 192GB | Yes | 9 | 1536GB | 1382GB | Insufficient |
| Blackwell Ultra (e.g., B300) | 288GB | Yes | 6 | 2304GB | 2074GB | ~674GB |
Several points can be drawn from the table.
First, previous-generation GPUs lack native MXFP4 computing capability. They must convert 4-bit weights to FP16 or BF16 at runtime before computing. This leads to two consequences: a significant drop in computing throughput, and if the converted weights remain resident in VRAM, the footprint grows to 5.6TB, requiring about 78 cards at 80GB each. Being able to fit the model does not mean you can run it well.
Second, eight 192GB GPUs total 1536GB. After deducting a 10% reserve, only about 1382GB remains, which is already below the 1.4TB weight requirement, leaving almost no room for KV Cache. Even if the reserve is compressed to 5%, the remaining space is only about 59GB—far from enough for concurrent serving.
Third, eight 288GB GPUs total 2304GB. After deducting the reserve, about 2074GB remains; subtracting the weights leaves about 674GB available for KV Cache and activations. Based on the hypothetical parameters above, this is sufficient to handle about 40 concurrent 32K context requests.
Therefore, this article uses the 8-GPU 288GB configuration as the example baseline. Eight GPUs also match standard 8-GPU server specifications, facilitating tensor parallelism via NVLink. If budget is limited, nine 192GB GPUs can also fit the weights, but the KV Cache margin shrinks to about 155GB, limiting concurrency. Selection should be based on actual test results.
4. Performance Targets: Conditions for 25 Token/s
Generating 25 tokens per second per user is close to text reading speed and can serve as an interactive experience target. However, it is not a metric that can be directly guaranteed. Actual speed depends on the following conditions:
- Context length: The memory access pressure between 32K and 128K varies greatly.
- Batch size: Batching improves overall throughput but reduces the speed allocated to each user.
- Parallelism strategy: The combination of Tensor Parallelism (TP) and Expert Parallelism (EP) changes inter-GPU communication volume.
- Interconnect bandwidth: The All-to-All communication capability gap between NVLink and PCIe 5.0 is significant.
If 10 users are online simultaneously, each maintaining 25 tokens/s, the aggregate throughput must reach 250 tokens/s. This value needs to be measured under the same context length and concurrency; it cannot be extrapolated solely from single-user results.
5. Cost Estimation: Hourly, Daily, Monthly
Using a major overseas cloud platform’s public 12-month reserved pricing as an example, the cost is about $4.76 per GPU per hour. This price represents a specific configuration on that platform; actual prices vary by GPU type, region, contract length, and market conditions. Assuming this unit price applies to an 8-GPU configuration, the results are as follows:
- Hourly: 8 × $4.76 = $38.08
- Daily (24 hours): ~$914
- Monthly (30 days): ~$27,418
The above figures do not include object storage, public network bandwidth, logging services, taxes, or on-demand billing premiums. On-demand pricing is typically higher than reserved pricing. If instances are left idle without shutting down, costs continue to accrue.
For individual developers or small teams, this cost clearly exceeds typical budgets. A more reasonable approach is to launch on-demand instances only during experiments or stress tests, and use hosted inference APIs for regular use. For enterprises with strict data security requirements, the cost of building or leasing dedicated clusters may be justified by business value.
6. Pre-Deployment Checklist
Before going live, completing the following checks is recommended:
- Version compatibility: Ensure GPU drivers, CUDA, and inference engine versions support MXFP4 operations.
- Parallelism configuration: Determine the TP and EP combination, and verify VRAM distribution using the actual model configuration.
- Communication stress testing: Measure the proportion of All-to-All communication time relative to total decoding time.
- Stress test matrix: Combine context lengths (e.g., 32K, 128K) and concurrency levels (e.g., 1, 5, 10), recording Time-To-First-Token (TTFT), per-stream speed, and aggregate throughput.
- VRAM protection: Set KV Cache limits, request queuing, and maximum context length to prevent service disruptions caused by VRAM overflow.
- Paged KV Cache management: Implement methods like PagedAttention to reduce VRAM fragmentation.
- Monitoring and alerting: Track VRAM usage, KV Cache footprint, decoding speed, and inter-GPU bandwidth. For example, trigger an alert when VRAM usage consistently exceeds 90%.
Conclusion
The hardware threshold for the example model in this article is determined by three factors. First, the 1.4TB resident VRAM for weights. Second, GPUs capable of native 4-bit computation; otherwise, computing efficiency and VRAM usage will suffer. Third, the hourly billing cost structure, which can reach approximately $27,000 per month for long-term operation.
For most teams, a hosted inference API is usually a safer starting point. Investing in a self-built cluster is only worthwhile when data compliance requirements are explicit, workloads are stable, and budgets are sufficient. When planning budgets, calculate operating costs on a monthly basis and use throughput data from stress tests as the basis for capacity decisions.
