The Real Cost of Self-Hosting Large Language Models: A TCO Breakdown
A practical breakdown of the true cost of self-hosting large language models, covering GPU hardware tiers, supporting infrastructure, software and integration labor, and annual operations, plus a TCO estimation script and cost-reduction tips.
1. Why the GPU Quote Is Not the Real Cost
Most budgets for self-hosting large language models go wrong for one reason: they treat the one-time hardware purchase price as the entire investment. The real cost is closer to total cost of ownership (TCO), which combines one-time capital expenditure (CapEx) with ongoing operating expenditure (OpEx), amortized over a 3-year depreciation cycle. A workable estimation skeleton looks like this:
TCO (3 years) = compute hardware + supporting infrastructure + software & licensing + integration & engineering labor + 3 years of operations powerUnit cost = TCO (3 years) / (3 × 365 × 24 × target utilization)
Target utilization is the value most often overestimated. Internal enterprise workloads typically show pronounced peaks and troughs. If you size for the peak but run at the average, unit cost can multiply.
2. Breaking Down the Four Cost Blocks
2.1 Compute hardware: it sets the cost baseline
By capability tier, there are three categories. Entry level is a single 24GB consumer or professional card, roughly CNY 15,000–20,000 for a full machine, comfortably running quantized 7B–13B models. Mid-range is a single 40GB/80GB data center accelerator at about CNY 80,000–120,000, suited to 13B–70B. Enterprise grade is a multi-GPU cluster server starting at CNY 500,000 per unit, aimed at models above 10 billion parameters. Prices swing with supply and demand, so quote against current market pricing.
A rough formula can establish feasibility from memory capacity first:
VRAM requirement ≈ parameter count × bytes per parameter × (1 + activation & KV cache factor) + framework overhead# FP16: 2 bytes per parameter; INT8: ~1 byte; INT4: ~0.5 byte# Long context and high concurrency raise KV cache significantly; the factor is often 0.2–0.5 or higher
2.2 Supporting infrastructure: the 15%–20% that gets missed
High-performance storage, network equipment, racks, and cooling usually account for 15%–20% of total hardware spend. Inference has different storage needs than training: loading model weights is a sustained sequential read, so high throughput matters more than extreme IOPS. Multi-GPU tensor parallelism is sensitive to inter-card interconnect bandwidth, which makes the network the throughput ceiling. For multiple GPUs in one machine, power delivery and cooling density also need evaluation.
2.3 Software and engineering: a tradeoff between two routes
Self-deploying open-source models means free software, but you build the inference framework, quantization pipeline, and service wrapper yourself. An integrated hardware-software appliance works out of the box, with the price covering both hardware and software licensing, typically at a 30%–50% premium. The first route converts cost into labor and time; the second buys out the uncertainty.
2.4 Operations: incurred annually
This covers power and cooling, monitoring, alerting and logging services, model iteration and security compliance, and on-call staff. If you use a cloud resource pool, it instead shows up as a recurring bill for shared resource categories such as a container platform, object storage, and message queues.
3. Turning the Estimate into an Executable Script
def estimate_tco(gpu_unit_price, gpu_cnt, infra_ratio=0.18,software=0, integration_person_month=2, person_month_cost=30000,annual_power=40000, years=3):hardware = gpu_unit_price * gpu_cntinfra = hardware * infra_ratioone_time = hardware + infra + software + integration_person_month * person_month_costreturn one_time + annual_power * yearsprint(estimate_tco(100000, 8)) # Example: mid-range 8-GPU server
4. Three Reference Tiers and Optimization Advice
The entry tier (single GPU, quantized 7B–13B) fits department-level pilots. The mid-range tier (single machine, 8 GPUs) fits mainstream business running 32B–70B. The enterprise tier (multiple machines and GPUs) targets 10B+ parameters and high concurrency. Cost-reduction levers include quantization and distillation to cut VRAM usage, dynamic batching and paged caching to raise utilization, tiered mixed deployment by workload, and an elastic resource pool to absorb peaks. The conclusion: work out VRAM and utilization first, then talk about the purchase list, and the budget will not spiral out of control.
