# MoE Model Private Deployment: Planning VRAM and Concurrency Requirements
A practical guide to estimating VRAM requirements for deploying Mixture-of-Experts (MoE) models on private infrastructure. This article explains why active parameters cannot be used to estimate memory, how to calculate KV Cache for long-context and concurrent workloads, and how to choose node configurations and parallelism strategies based on your response time targets.
1. The Problem
When teams evaluate on-premises deployment of large models, the typical question is “how many accelerator cards do we need?” The question itself is incomplete. With the same eight accelerator cards, serving a single user, analyzing long documents, and handling high-concurrency online Q&A may require configurations that differ by several times. Card count is only an outcome; what actually determines the configuration is context length, the number of concurrent requests, request types, and response targets.
Using a Mixture-of-Experts (MoE) model as an example, this article walks through a complete planning process, from VRAM estimation to node selection. All numbers are illustrative assumptions used to demonstrate the calculation methods—they do not represent measured data for any specific model. In actual planning, always refer to the model’s official configuration files and your own load-testing results.
2. Why Active Parameters Don’t Determine VRAM
An MoE model contains a large number of expert networks, and each token is routed to only a few of them for computation. This is why MoE models are typically described by two sizes: total parameters and active parameters.
- Total parameters determine how much storage and VRAM the weights occupy.
- Active parameters determine the computation per token. A rough estimate is about 2× the active parameter count in floating-point operations per token.
Routing is dynamic—different tokens select different experts—so during inference, the weights of all experts must reside in accessible memory. Loading only the active portion of the weights cannot support inference.
Suppose a model has 300B total parameters and 18B active parameters, with weights in FP8 format at 1 byte per parameter. The weights alone require about 300GB. Active parameters only affect per-token compute time; they cannot reduce the VRAM needed for weights.
VRAM requirements can be broken into four parts:
- Model weights;
- KV Cache, proportional to context length and concurrency;
- Activations, communication buffers, and runtime overhead;
- Headroom for fragmentation and peak fluctuations.
3. KV Cache and Long Context
The KV Cache stores the attention keys and values of previously generated tokens, avoiding repeated computation at each step. Its size can be estimated as:
Bytes per token = 2 × layers × KV heads × head dimension × bytes per element
Total usage = bytes per token × context length × concurrent requests
Different attention architectures (such as grouped-query attention or low-rank compression) significantly change the KV head count and per-token footprint, so you must use the actual parameters from the model’s configuration file.
Continuing the assumptions above: 60 layers, 8 KV heads, head dimension of 128, and FP8 for the KV Cache. Per-token usage is 2 × 60 × 8 × 128 × 1 = 122,880 bytes, roughly 120KB. A single request with a 1 million token context needs about 122.9GB of KV Cache. With 4 such concurrent requests, the KV Cache grows to about 491.5GB.
Long context is the most commonly underestimated factor in VRAM planning.
The following script provides a quick first-pass estimate:
def estimate_memory_gb(total_params_b, weight_bytes, layers, kv_heads,head_dim, kv_bytes, context_len, concurrency,overhead_ratio=0.15):"""Estimate weights, KV Cache, and total VRAM in decimal GB (example function)."""weights_gb = total_params_b * 1e9 * weight_bytes / 1e9kv_per_token = 2 * layers * kv_heads * head_dim * kv_byteskv_gb = kv_per_token * context_len * concurrency / 1e9total_gb = (weights_gb + kv_gb) * (1 + overhead_ratio)return {"weights_gb": round(weights_gb, 1),"kv_cache_gb": round(kv_gb, 1),"total_gb": round(total_gb, 1),}# Example: 300B total params, FP8 weights, 1M context, concurrency of 1print(estimate_memory_gb(300, 1, 60, 8, 128, 1, 1_000_000, 1))# {'weights_gb': 300.0, 'kv_cache_gb': 122.9, 'total_gb': 486.3}
4. Concurrency, Request Types, and Response Targets
Different workloads stress resources in different directions, so start by defining your request types:
- Long-document analysis: long context per request, high prefill cost, usually low concurrency; VRAM is dominated by the KV Cache.
- High-frequency short Q&A: short context, high concurrency, focused on throughput and cost; resident weights take a larger share of memory.
- Offline batch processing: insensitive to per-request latency and tolerant of queuing; best served with throughput-oriented batch scheduling.
Response targets should be described with quantifiable metrics. Common ones include:
- Time to first token (TTFT), measuring how long users wait for the first token;
- Output tokens per second, measuring generation speed;
- Requests per second or token throughput, measuring overall capacity;
- Tail latency (e.g., P95, P99), measuring stability under high load.
Only when these metrics are mapped to request types do card counts and concurrency limits have a solid basis.
5. Node Selection and Parallelism
Single-node deployment offers simpler setup and shorter communication paths. When the sum of weights and KV Cache exceeds the available VRAM of a single node, you need to split the model using tensor parallelism, expert parallelism, or pipeline parallelism.
MoE models generate substantial cross-card data exchange under expert parallelism, making interconnect bandwidth a significant factor in latency. Compare the following dimensions when choosing a topology:
| Dimension | Single-Node Multi-GPU | Multi-Node Cluster |
|---|---|---|
| Deployment complexity | Lower | Higher; requires networking and scheduling support |
| Communication latency | Intra-node interconnect, usually lower | Cross-node network, affected by network quality |
| Scalability | Limited by single-node card count | Nodes can be added as needed |
| Failure blast radius | Single-node failure affects the whole service | Requires fault tolerance and replica design |
Accelerator selection should consider per-card VRAM capacity, memory bandwidth, interconnect topology, and support for the low-precision formats you plan to use. These specifications should be based on vendor-published datasheets and evaluated together with your parallelism strategy.
6. Deployment Checklist
- Confirm the precision and file size of the model weights; verify total and active parameter counts.
- Define maximum context length, target concurrency, and request types.
- Estimate the KV Cache using the formula in Section 3 and calculate peak VRAM.
- Reserve runtime headroom; adjust the ratio based on load testing, with 10% to 20% as a common starting point.
- Run benchmarks and record TTFT, output speed, and tail latency.
- Monitor peak VRAM during load tests to confirm that overlapping long requests do not trigger out-of-memory errors.
- If VRAM is insufficient, consider reducing concurrency, limiting maximum context length, adding cards, or adding nodes—in that order.
7. Conclusion
Planning the deployment of large-scale MoE models should start with VRAM, but never with active parameters alone. Weight size, KV Cache, concurrency, and response targets jointly determine the configuration, with long context and high concurrency having the largest impact on the KV Cache. Under the example assumptions, a single million-token context request already consumes roughly half the combined VRAM of an eight-card single node, and multiple concurrent requests quickly exceed capacity. Therefore, calculate VRAM first, then determine card count and node topology, and validate the results through load testing.
