Deploying a Trillion-Parameter Model Locally: License, Storage, and VRAM Assessment
This article provides a practical, step-by-step framework for evaluating whether a trillion-parameter sparse expert model can be deployed on local infrastructure. It covers the essential checks in order: license compliance, storage and VRAM estimation, parallel inference strategies, and latency validation. It includes calculation formulas for storage and KV cache, sample scenarios, and three deployment routes with clear go/no-go criteria.
1. Conclusion First
The evaluation order is: first check the license, then calculate storage and VRAM, and finally verify latency through testing. If the license does not permit your intended use, hardware investment is meaningless and you should stop immediately. If storage, VRAM, or latency fall short, you can typically still address these issues through quantization, concurrency limits, or scaling up, so there is no need to abandon the project right away.
2. License Compliance Checklist (Do This First)
Licensing is a prerequisite for any hardware purchase and should be verified before estimating hardware requirements. Review the following points:
- Commercial use: Is the model permitted for use in revenue-generating products or internal business systems?
- Redistribution: Are you allowed to provide the weights or images containing the weights to customers, partners, or subsidiaries?
- Derivative models: Are fine-tuned, quantized, or pruned versions considered derivative works? Do they require the same license or a separate statement?
- Output ownership: Who owns the copyright to generated content, and are there restrictions on using outputs to train other models?
- Use policy: Any prohibited-use clauses attached to the license, such as restrictions on specific industries, regions, or scale.
- Attribution and disclosure: Are you required to attribute the model source in your product or retain the license text?
- Scale thresholds: Some licenses set thresholds based on monthly active users or revenue, beyond which a separate license is required.
- Patent clauses: Does the licensor grant patent rights, and are there termination clauses related to litigation?
- Export controls: Are cross-border transfers of weights, accelerators, and related technology restricted, especially when overseas teams or cross-border deployments are involved?
This list covers the directions to check; the final determination must be confirmed by legal counsel. This article does not constitute legal advice.
3. Storage: Parameters, Precision, and File Size
File size can be estimated using the following relationship:
File size ≈ total number of parameters × bytes per parameter
The total parameter count includes all parameters, including all experts in a sparse model. Sparse expert models only activate a subset of experts per token, but both the weight files and VRAM must accommodate all experts, so you cannot estimate based on active parameters only.
The bytes per parameter depend on storage precision: BF16 or FP16 uses 2 bytes, FP8 or INT8 uses 1 byte, and INT4 uses 0.5 bytes. Halving the bit width approximately halves the size. Quantization also introduces additional data such as scaling factors, so the actual file size is typically slightly larger than the theoretical value. The impact of quantization on output quality must be validated with your own evaluation set—do not rely on file size alone.
This article uses decimal units throughout: 1 TB equals 10¹² bytes, and 1 GB equals 10⁹ bytes. Operating systems and some tools display sizes in binary units, where 1 TiB equals 2⁴⁰ bytes, approximately 1.0995 TB. For procurement and capacity planning, the team must agree on a consistent unit convention; otherwise, errors of around ten percent can easily creep in.
For a 1-trillion-parameter model as an example, theoretical sizes and reserved storage are shown in the table below.
| Precision | Theoretical size (decimal) | Theoretical size (binary) | Recommended reservation (×1.2 to 1.5) |
|---|---|---|---|
| BF16 | 2 TB | 1.82 TiB | 2.4 to 3.0 TB |
| INT8 | 1 TB | 0.91 TiB | 1.2 to 1.5 TB |
| INT4 | 0.5 TB | 0.45 TiB | 0.6 to 0.75 TB |
The theoretical sizes in the table do not include overhead from index files, tokenizers, or configuration files. Optimizer states only occupy space during training and are not counted for inference deployment.
The 1.2 to 1.5 reservation factor is based on empirical ranges; you should measure the actual value for your own conversion pipeline. To measure it: first record the disk usage after downloading the original weights, then track the peak usage of temporary copies during sharding, format conversion, and checksum verification, and finally record the total usage of backups and the final deployment version. Dividing the peak usage by the theoretical size gives you your team’s actual factor.
4. VRAM: Weights, KV Cache, and Framework Overhead
Total VRAM requirements can be estimated in three parts:
Total VRAM ≈ weight VRAM + KV cache + framework and activation overhead
Weight VRAM is approximately equal to the file size converted at the loading precision.
The KV cache estimation formula is:
KV cache bytes = 2 × number of layers × number of KV heads × head dimension × context length × concurrent requests × bytes per element
The factor of 2 accounts for both the K and V caches. Some architectures use compressed or shared attention structures; the layer count, KV head count, and head dimension should be taken from the model’s official configuration file, not from generic defaults. Long contexts and high concurrency significantly amplify the KV cache, making it one of the most commonly underestimated items in VRAM planning.
The following example uses a set of assumed parameters. Assume the model has 61 layers, 8 KV heads, a head dimension of 128, a context length of 32768, and KV elements stored in BF16 at 2 bytes each:
- At 8 concurrent requests: 2 × 61 × 8 × 128 × 32768 × 8 × 2 ≈ 65.5 GB, roughly 3.3% of the BF16 weight size (2000 GB).
- At 64 concurrent requests: approximately 524 GB with the same parameters, roughly 26% of the BF16 weight size.
Doubling concurrency doubles the KV cache. In high-concurrency scenarios, it can exceed one-fifth of the weight size itself.
For framework and activation overhead, a common rule of thumb is to reserve 10% to 20% of the weight VRAM. The exact percentage depends on the inference framework, batching strategy, and graph compilation settings, and should be measured with real workloads.
The GPU count estimation formula is:
Number of GPUs ≥ total VRAM requirement ÷ (per-GPU VRAM × usable ratio)
The usable ratio refers to the proportion of VRAM that can be allocated to the model, typically 0.85 to 0.9, leaving headroom.
The following example assumes 80 GB per GPU with a usable ratio of 0.9, giving 72 GB per GPU; framework overhead is 15% of the weights; the KV cache is calculated for 64 concurrent requests with a context length of 32768, stored in BF16.
| Weight precision | Weight VRAM | KV cache | Framework overhead | Total requirement | Estimated GPUs |
|---|---|---|---|---|---|
| BF16 | 2000 GB | 524 GB | 300 GB | 2824 GB | 40 |
| INT8 | 1000 GB | 524 GB | 150 GB | 1674 GB | 24 |
| INT4 | 500 GB | 524 GB | 75 GB | 1099 GB | 16 |
The GPU counts here are theoretical lower bounds. A real deployment must also account for how experts are placed across GPUs, the interconnect bandwidth within and across nodes, and how many GPUs can fit per server. If expert parallelism places different experts on different GPUs, every token can trigger cross-GPU communication, and communication overhead increases as the GPU count grows.
5. Parallel Inference Approaches
When the model does not fit on a single GPU, computation must be split across multiple GPUs. Common parallelism approaches include:
- Tensor parallelism: Splits the matrices of a single layer across multiple GPUs, requiring one or more collective communication operations after each layer. Best suited for single-node, multi-GPU setups with high inter-GPU bandwidth. When inter-GPU bandwidth is low or GPUs span multiple servers, communication becomes a latency bottleneck; in such cases, this approach should be dropped or the parallelism degree reduced.
- Pipeline parallelism: Assigns different layers to different GPU groups, passing only activations between GPUs with relatively low communication volume. Suitable for cross-node deployment, but a single request must pass through each stage sequentially, increasing time-to-first-token. If first-token latency is critical for your workload, this approach should be ruled out.
- Expert parallelism: Places different experts on different GPUs; each token is routed to only a subset of experts, reducing computation. However, routing determines communication targets, and load imbalance can leave some GPUs hot while others sit idle. If routing is highly skewed and cannot be improved through load-balancing strategies, this approach should be dropped.
- Data parallelism: Each GPU group holds a full copy of the model and handles different requests. This does not solve the problem of a single copy not fitting on one GPU; it is only useful for scaling throughput once the model already fits within one GPU group.
Production systems typically combine multiple approaches. Teams need to choose the combination based on inter-GPU interconnect, GPUs per node, and latency targets—not purely on theoretical compute capacity.
6. Validate Latency and Throughput with Real Testing
Having enough VRAM does not mean the service is usable. Before going live, verify the following:
- Fix the target hardware, precision, parallelism approach, and inference framework version, and record the version numbers.
- Build a test set with the same input length distribution as production; do not use only short prompts.
- Increase concurrency in steps, recording time-to-first-token, average time per output token, overall throughput, and P95 and P99 latencies.
- Find the maximum concurrency that satisfies your SLA—the highest throughput point that still meets latency requirements.
- Monitor VRAM peaks and confirm they stay within the usable ratio with headroom.
- If results fall short, try lowering precision, capping context length, adjusting batching parameters, or adding GPUs—one variable at a time, re-measuring after each change.
Quality evaluation must be redone after quantization. Quantization can change output accuracy and stability, affecting both business quality and compliance assessments. Keep a rollback plan in place before going live, such as retaining the original-precision deployment package and a traffic switch that can quickly revert to the original version.
7. Three Deployment Routes and Their Trade-offs
Route 1: Fully on-premises deployment. All weights, inference, and data stay in the local data center.
- Adopt when: The license permits local deployment, data cannot leave the facility, the team has stable data center, power, and operational capabilities, and the workload is steady enough over time to amortize hardware costs.
- Abandon when: GPU count exceeds data center capacity, procurement timelines cannot meet the launch schedule, or peak load is far above average, leaving significant hardware idle.
Route 2: Hybrid or cloud-assisted deployment. Core or sensitive workloads run locally; peak traffic or experimental tasks are dispatched to the same model version running in the cloud.
- Adopt when: The license permits cloud hosting and the cloud environment meets data compliance requirements; load fluctuates significantly; both sides can maintain identical model versions and configurations.
- Abandon when: The license prohibits third-party hosting or redistribution, data cannot leave the local environment, or version consistency between the two sides is hard to maintain, leading to inconsistent outputs.
Route 3: Quantized deployment. Use INT8 or INT4 weights to reduce GPU count and storage, running either on-premises or in the cloud.
- Adopt when: Quality degradation after quantization is within acceptable limits on your own evaluation set, and the license explicitly permits the use and redistribution of quantized versions.
- Abandon when: Quantization degrades key metrics beyond thresholds, or the license treats quantized versions as restricted derivative works, making them unusable for the target scenario.
These three routes can be combined. For example, start with quantization to reduce GPU count, then deploy in a hybrid on-premises + cloud setup.
8. Decision Steps
Work through the following steps in order. If any step fails, record the reason before deciding whether to continue:
- Review the license, confirming commercial use, redistribution, derivatives, output ownership, and export control terms, and obtain legal sign-off in writing.
- Estimate weight size using the formula, applying your team’s measured reservation factor to determine storage requirements.
- Estimate total VRAM using the formula, plugging in actual layer count, KV head count, context length, and concurrency, to determine GPU count.
- Run latency and throughput tests on candidate hardware, finding the maximum concurrency that satisfies your SLA.
- Compare the three routes against their adoption and abandonment criteria, choosing between on-premises, hybrid, or quantized deployment.
- If the conclusion is feasible, proceed to procurement and deployment.
After completing these six steps, your team can determine whether a trillion-parameter sparse expert model can be hosted locally—and know exactly where each number in the conclusion came from.
