The Real Cost of Self-Hosting Large Models: VRAM Math and a Three-Year TCO Analysis
Planning to self-host a very large language model on your own GPUs? This article walks through the full cost picture: how VRAM breaks down across weights, KV cache, and runtime overhead; how context length and concurrency scale memory requirements; how many H200 nodes different workloads require; and what a three-year total cost of ownership looks like when hardware, power, and operations are all counted. It concludes with practical guidance on choosing context length, precision, and deployment strategy before committing a budget.
1. Establishing the Baseline
This article does not target a specific model. All numbers are based on the following assumptions:
- The example model has roughly 740B total parameters (740 billion), with about 40B parameters activated per token during inference.
- It has 60 layers and uses grouped-query attention (GQA) with 8 KV heads and a head dimension of 128.
- The default precision is FP8, at 1 byte per parameter. BF16 (2 bytes per parameter) is used as the comparison case.
- The server is a single node with 8× H200 GPUs, each with 141GB of HBM3e, giving roughly 1,128GB (about 1.1TB) of VRAM per node.
- Optimizations such as prefix cache sharing and KV cache quantization are excluded. These can reduce VRAM requirements, but their impact depends on the serving framework and workload.
Total parameters determine how much VRAM the weights consume; activated parameters determine per-token compute and speed. They affect different hardware metrics and must not be conflated in calculations.
2. VRAM Consists of Three Parts
Model weights. 740B parameters require roughly 740GB in FP8 and about 1.48TB in BF16 — rounded to about 1.5TB below. Weight size depends only on parameter count and precision.
KV cache. Every token’s Key and Value vectors must be cached so subsequent tokens can perform attention. The bytes per token can be estimated as:
KV bytes per token = 2 × layers × KV heads × head dimension × bytes per element
Plugging in the example values, FP8 gives 2 × 60 × 8 × 128 × 1 = 122,880 bytes, or about 120KB. BF16 is about 240KB. Always verify these figures against the actual layer count, head count, and other values in the model’s configuration file.
Framework and runtime overhead. PyTorch, CUDA, cuBLAS, NCCL, and similar components consume roughly 1–2GB per GPU. In addition, the scheduler, batching buffers, and similar structures should reserve 5%–10% of VRAM as headroom.
3. Converting Context Length into VRAM
At roughly 120KB per token, the KV cache for a single session (FP8) is approximately:
- 32K context: about 4GB
- 128K context: about 16GB
- 500K context: about 60GB
- 1M context: about 120GB
Concurrency refers to the number of sessions simultaneously holding KV cache. For example, 20 concurrent sessions at 1M context each require about 2.4TB of KV cache in total; 50 sessions require about 6TB. The higher the concurrency, the more the KV cache dominates total VRAM consumption.
4. How Much Concurrency Can a Single Node Support?
An 8× H200 node provides about 1,128GB in total. Deduct as follows:
- Subtract 740GB for FP8 weights.
- Subtract framework overhead of about 16GB (8 GPUs × 2GB).
- Reserve about 10% headroom, roughly 113GB.
That leaves about 259GB for the KV cache, which translates to:
- 500K context: about 4 concurrent sessions — single-digit concurrency.
- 1M context: only about 2 concurrent sessions.
- 128K context: about 16 sessions; 32K context: 60 or more.
These figures are VRAM ceilings. Real concurrency is also limited by compute and throughput, and must be confirmed through load testing.
5. Deriving the Number of Nodes
Total VRAM required = weights + KV cache + framework overhead, multiplied by a 1.1 headroom factor. The node count is that value divided by 1,128GB per node, rounded up.
| Scenario | Precision | Context | Concurrency | VRAM Required (approx.) | Nodes |
|---|---|---|---|---|---|
| Single node | FP8 | 500K | 4 | ~1.1TB | 1 |
| Two nodes | FP8 | 500K | 10 | ~1.5TB | 2 |
| Four nodes | FP8 | 1M | 20 | ~3.5TB | 4 |
| Seven nodes | FP8 | 1M | 50 | ~7.5TB | 7 |
| Two nodes | BF16 | 500K | 1 | ~1.8TB | 2 |
With the same two servers, the FP8 configuration supports about 10 concurrent sessions at 500K context, while the BF16 configuration supports only one. Precision choice directly determines how much concurrency each unit of budget buys. Note that multi-node deployments require high-speed interconnects, and cross-node communication reduces throughput.
6. Budget Estimation
The prices below are planning assumptions, not verified quotes.
Hardware is priced per fully configured node — 8× H200, CPUs, memory, NVLink, NVMe storage, and power supplies — at roughly ¥3M–3.8M (approximately $420K–$530K) per node. Tax treatment and quote dates must be confirmed through actual vendor inquiries. Network switches, facility modifications, and management nodes are priced separately.
- Two nodes, FP8 (10 concurrent, 500K context): about ¥6M–7.6M.
- Four nodes, FP8 (20 concurrent, 1M context): about ¥12M–15.2M.
- Seven nodes, FP8 (50 concurrent, 1M context): about ¥21M–26.6M.
- Two nodes, BF16 (1 concurrent, 500K context): about ¥6M–7.6M.
The BF16 setup costs the same in hardware as two-node FP8 but delivers roughly one-tenth the concurrency. If your workload requires multiple concurrent sessions, BF16’s cost per unit of concurrency is far higher.
7. Ongoing Operating Costs
Power. Assume an IT load of about 8kW per node — roughly 5.6kW from GPUs at full load, the rest from CPUs, memory, networking, and so on. Two nodes draw about 16kW. Annual electricity cost is calculated as:
Annual power cost = IT load × 8,760 hours × utilization rate × PUE × electricity price
For two nodes, assume utilization of 70%–90%, PUE of 1.3–1.5, and an electricity price of ¥0.7–1.0/kWh. The result is roughly ¥90K–190K per year. Four nodes double the power draw, at roughly ¥180K–380K per year.
Cooling retrofits. Liquid cooling or high-density air cooling retrofit costs must be quoted based on the actual facility. PUE already includes cooling power consumption, but not the one-time retrofit investment.
Operations and software. Assume a dedicated ops team costs ¥800K–1.5M per year in labor, plus ¥400K–800K per year for monitoring, persistent storage, backup services, and related software. Operational work includes VRAM and throughput monitoring, isolating failed GPUs and rescheduling tasks, model version updates, and access logging with compliance auditing. If the organization already has an ops team, these costs can be reduced substantially.
8. Three-Year Total Cost of Ownership
Using the two-node FP8 scenario with mid-range values for each item:
- Hardware: about ¥6.8M
- Electricity: about ¥140K per year, roughly ¥420K over three years
- Labor and software: about ¥1.75M per year, roughly ¥5.25M over three years
The three-year total is about ¥12.5M. Hardware accounts for roughly 55%, electricity about 3%, and labor and software about 42%. Under these assumptions, hardware purchases make up just over half of total investment — but operating costs are equally impossible to ignore.
9. Recommendations
- First, confirm your real context length. Most internal Q&A workloads run between 5K and 10K tokens and can be handled with truncation or RAG — there is no need to pay for 1M context.
- Use real traffic data to measure peak concurrency and average length per session before deciding on node count, rather than estimating from theoretical ceilings.
- Prefer FP8, but for code generation, mathematical reasoning, and similar tasks, validate quantization loss on your own test sets first.
- If budget is tight or the workload fluctuates, start with on-demand or reserved GPU instances from a cloud provider to validate demand, then migrate once usage stabilizes.
- Where data sovereignty requirements are low, a hybrid architecture — processing sensitive data locally while routing general tasks to external APIs — is usually more cost-effective.
Conclusion
Under the assumptions in this article, self-hosting a hundred-billion-scale MoE model on a single node supports only short-context workloads or small-scale long-context use; two nodes are the practical starting point for internal team use. The budget is driven primarily by three parameters: concurrency, context length, and precision. Determine these three first, then apply the formulas in this article to estimate the node count and budget you will need.
