Deploying Ultra-Large Open-Source Models: From VRAM Sizing to Cost Decisions
A practical guide to deploying ultra-large open-source models: how to estimate VRAM requirements, handle MoE architecture trade-offs, evaluate long-context effectiveness, account for multimodal token costs, interpret benchmarks, and calculate per-token inference costs.
1. Start with VRAM: Capacity Is the First Gate
The total parameter count determines the size of model weights. At 2 bytes per parameter (FP16 or BF16), 1 trillion parameters require roughly 2 TB of weight storage, and 3 trillion parameters require about 6 TB. With FP8 or INT8 quantization, weight size is halved: 1 trillion parameters come to about 1 TB.
The table below covers weights only:
| Total Parameters | FP16/BF16 Weights | FP8/INT8 Weights |
|---|---|---|
| 1 trillion | ~2 TB | ~1 TB |
| 3 trillion | ~6 TB | ~3 TB |
Real deployments need additional memory for the KV cache, activations, communication buffers, and inference framework overhead. These vary with concurrency and sequence length, so they cannot be estimated with a fixed multiplier. When planning capacity, use weight size as the lower bound, then determine cluster size from peak memory measured under real workloads.
2. Architecture Trade-offs: Compute and Communication in Sparse Activation
Many current ultra-large open-source models use a Mixture of Experts (MoE) architecture. Each token activates only a subset of expert networks, so per-forward compute is determined by the activated parameters, while total parameters determine how much VRAM the weights occupy. These two numbers must be accounted for separately.
MoE introduces two engineering challenges. The first is uneven expert load: if many tokens are routed to a small number of experts, the GPUs hosting those experts become bottlenecks. A capacity factor limits how many tokens each expert processes per step, and tokens beyond that limit must be dropped or rerouted—so the drop rate needs continuous monitoring. The second is cross-node communication: when experts are spread across multiple nodes, All-to-All communication can take longer than the computation itself. Common mitigations include grouping experts so that frequently co-activated experts sit on the same node, and overlapping communication with computation in the scheduler.
3. Long Context: Nominal Window Is Not Effective Window
The context window in a model’s documentation—say, 1 million tokens—is the maximum input the model accepts. The length you can actually use in production depends on two things: whether the model accurately retrieves information at long distances, and whether your deployment can handle the corresponding KV cache.
KV cache size can be estimated. Suppose a configuration has 80 layers, 8 KV heads, and a head dimension of 128, stored in FP16. The KV cache per token is then:
2 × 80 × 8 × 128 × 2 bytes ≈ 320 KB
A single 1-million-token sequence would need roughly 320 GB of KV cache—more than the memory of most single GPUs for just one request. The layer and head counts above are illustrative only; substitute the real parameters of your target model.
Evaluate long-context effectiveness as follows:
- Embed a key fact into business data at different positions in the text, padded with varying amounts of irrelevant content.
- Test in length tiers, for example 8K, 32K, 128K, 512K, and 1M tokens.
- Measure recall per tier and set a launch threshold—for example, at least 95% recall per tier, with the threshold set by the business owner.
- Record time-to-first-token and memory usage per tier to confirm whether long-context costs are acceptable.
4. Multimodal: Resolution Drives Visual Token Cost
Native multimodal models encode images into visual tokens that enter attention computation alongside text tokens. Larger images produce more visual tokens, driving up latency and cost.
The number of visual tokens is roughly proportional to image area, subject to preprocessing and merging strategies. Using an estimate of one visual token per 28×28 pixels (an example figure only—refer to your model’s preprocessing code), a 1024×1024 image yields about 1,300 visual tokens. If your application only needs to read large text, resizing images to an appropriate resolution can significantly reduce token consumption.
5. How to Read Leaderboards
Leaderboard rankings are useful for narrowing down candidates, not for making launch decisions. When reading them, check four things.
First, whether the evaluation dimensions match your business. Coding arenas primarily measure code generation and instruction following, which do not fully correspond to long-document summarization, multi-turn customer service, or structured extraction.
Second, whether the benchmark data may have leaked into training data. Public test sets carry contamination risk, and scores may be inflated.
Third, whether the evaluation date and model version match the version you plan to deploy. Different versions of a same-named model can perform very differently.
Fourth, the confidence intervals of the results. With few test items, ranking differences may be random noise.
Use a private validation set as the final basis for decisions. Draw 200 to 500 samples from real business data, stratify them by task type and difficulty, record the pass rate for each sample, and compare candidate models under identical prompts and decoding parameters.
6. Inference Cost: A Measurable Path
The cost of an open-source model consists of three parts: licensing cost (not billed per token), hardware cost that the enterprise controls and schedules itself, and maintenance cost for the engineering team. The first two can be quantified; the third must be accounted for separately.
Per-token cost can be estimated as:
Unit cost = GPU hourly price ÷ effective output tokens per hour
Effective output tokens should be measured at the throughput achieved while meeting P95 or P99 latency targets. Throughput varies significantly with batch size and concurrency, so a single benchmark run cannot represent production performance.
6.1 Quantization
FP8 or INT8 quantization reduces weight memory and improves throughput. The steps:
- Extract 512 to 2,048 samples from business data as a calibration set.
- Run sensitivity analysis separately on attention layers and MoE expert layers, comparing perplexity (PPL) and task accuracy before and after quantization.
- Keep higher precision for sensitive layers and quantize the rest.
- Set a rollback threshold—for example, roll back if task accuracy drops by more than 1 percentage point.
