Calculating VRAM and Licensing Before Deploying Trillion-Parameter Open-Source Models
Before deploying a trillion-parameter open-source large language model, it is crucial to accurately estimate VRAM requirements and understand licensing constraints. Using an approximately 2.8T parameter MoE model as an example, this article details weight storage precision, the download and verification process, GPU hardware budgeting, parallelism strategies, the trade-offs of quantization and CPU offloading, alongside a compliance checklist and a practical decision framework.
1. Prerequisites
This article uses a Mixture-of-Experts (MoE) model with approximately 2.8T total parameters, a download size of about 1.56TB, and roughly 104B activated parameters per token as an example. Since the original source does not specify the model name, these figures serve merely as estimation samples. Before you begin, verify the parameter count, number of experts, routing details, and storage precision against the official model card. All conclusions should be based on official documentation.
2. MoE Structure and Associated Costs
In an MoE architecture, the total parameters dictate the storage requirements for the weights, while the activated parameters determine the computational overhead per token. Using the 2.8T total and 104B activated parameters example, each forward pass utilizes only about 3.7% of the weights.
This does not mean the VRAM pressure is lower. In a typical configuration with 896 routed experts where 16 are selected per token plus a few shared experts, all expert weights must reside in VRAM or be capable of being swapped in quickly. Otherwise, a routing hit will cause a stall. Furthermore, with over ninety layers, long contexts consume significant KV Cache, and this portion of VRAM scales with concurrency and context length.
3. Weight Size and Storage Precision
The same model can vary significantly in size depending on the storage precision used. Calculated by bytes per parameter:
- BF16 (2 bytes): ~5.6TB
- FP8 (1 byte): ~2.8TB
- INT4 (0.5 bytes): ~1.4TB
The released 1.56TB weights equate to an average of about 4.5 bits per parameter. This indicates the release likely uses mixed precision, such as storing expert weights in lower bits while keeping attention and embedding layers at higher precision. Therefore, you cannot directly equate the download size to the BF16 size, nor can you assume the loaded VRAM footprint equals the download size.
The total VRAM footprint during loading roughly equals the weight size, plus KV Cache, activations, routing buffers, and framework overhead. It is recommended to reserve at least a 25% margin, with long context or high concurrency scenarios requiring even more.
4. Download and Verification Steps
- Choose tools that support resumable downloads. For instance,
huggingface-cli downloadsupports resuming by default, andaria2ccan be used for multi-threaded downloads over unstable networks. If using a trusted mirror site, ensure the files are identical to the official repository. - Verify shards. Open the index file in the repository (e.g.,
model.safetensors.index.json) and confirm that the number of shards and the size of each shard match the official list. - Verify hashes. Compare them one by one using the official SHA256 checksum file, for example, by executing
sha256sum -c SHA256SUMS. If no checksum file is provided, at least save the hash of each shard for future troubleshooting. - Plan storage. Given the original weights plus format conversions, quantized copies, and caches, reserve 2 to 3 times the original volume of space. Use NVMe or parallel file systems to avoid being bottlenecked by disk speed during loading.
Risk Warnings:
- Network interruptions or jitter can corrupt shards. Corruption often only triggers an error during the loading phase, making troubleshooting costly, so verification steps cannot be skipped.
- Insufficient storage space will cause write failures, and some files may be left incomplete without being easily noticed.
- Re-verify the hashes every time weights are updated.
5. Required GPUs and Hardware Budget
The table below calculates the number of GPUs required for the weights alone, excluding KV Cache and safety margins. For actual deployment, the number of GPUs will need to be higher.
| Load Precision | Weight Size | 80GB GPUs | 141GB GPUs | 192GB GPUs |
|---|---|---|---|---|
| BF16 | ~5.6TB | 70 | 40 | 30 |
| FP8 | ~2.8TB | 35 | 20 | 15 |
| INT4 | ~1.4TB | 18 | 10 | 8 |
| Release (Mixed) | 1.56TB | 20 | 12 | 9 |
Clarifying a common misconception: Even with 8 GPUs of 192GB each, the total VRAM is only about 1.54TB, which is less than the 1.56TB size of the release version. Therefore, an 8-GPU setup cannot fully accommodate this model’s weights. To fully load the release version with some margin, you typically need 12 or more GPUs, configured with high-speed interconnects across nodes.
Costs can only be estimated based on quotes; this article does not provide specific pricing. You can calculate using the following formula:
Total Cost = Number of GPUs × Unit Price + Server, Rack, and Network Costs + Electricity Cost (System Power × Operating Hours × Electricity Rate)
It is recommended to request separate quotes from vendors and include the quote date and taxes in your budget table.
6. Parallelism Strategies and Startup Essentials
Multi-GPU deployment typically combines Tensor Parallelism (TP) and Pipeline Parallelism (PP). TP splits single-layer computation across multiple GPUs within the same node, relying on high-bandwidth interconnects like NVLink. PP splits by layers and is suitable for cross-node setups. Expert Parallelism (EP) assigns different experts to different GPUs, which is a common approach for MoE models.
Taking vLLM as an example, --tensor-parallel-size and --pipeline-parallel-size control the partitioning, and their product should equal the total number of GPUs participating in inference. Before starting, confirm that the framework version supports the model architecture and quantization format, otherwise shape mismatch or configuration errors will occur during loading.
Common Issues and Troubleshooting:
- OOM during loading: Reduce the maximum context length, lower the VRAM utilization cap, or add more GPUs.
- Multi-GPU communication timeout: Check inter-node network bandwidth, NCCL configurations, and driver versions.
- Quantization configuration errors: Ensure the quantization configuration file in the weights directory aligns with framework requirements.
- Abnormal output or gibberish: Check if the tokenizer and chat template match the model.
7. Trade-offs of CPU Offload and Quantization
CPU offload places some experts in system memory and swaps them into VRAM as needed. When routing hits a non-resident expert, latency will spike. Therefore, this is only suitable for functional verification and not for online serving.
Quantization reduces footprint size, but lower bit depths can affect expert routing accuracy, with long texts and complex reasoning tasks being the most prone to exposing issues. Before going live, compare the results of the original precision and the quantized version using your own evaluation sets, and observe whether the expert load is imbalanced. Keep the original precision version for easy rollback in case of issues.
8. Licensing and Compliance Checklist
“Open weights” does not mean free to use however you want. Verify the following before deployment:
- Is commercial use permitted?
- Are there user volume or revenue thresholds?
- Must derivative models use the same license?
- Are there additional restrictions for multimodal components?
- What are the usage restrictions and attribution requirements for the output content?
- Do data retention and privacy requirements comply with your own compliance standards?
Enterprise usage should be evaluated by legal personnel beforehand.
9. Recommended Decision Framework
- First, verify the business value via API to confirm the model can solve practical problems.
- Calculate the total hardware and operational costs using the GPU table and quotes provided in this article.
- Assess whether your team has the operational capability for multi-node, multi-GPU management.
- Once all three criteria are met, decide whether to proceed with private deployment.
Most teams will find sufficient answers at step one and do not need to rush into hardware investments.
