On-Premises Long-Context LLM Costs: TCO, Throughput, and Cost per Million Tokens
Deploying a long-context LLM on premises involves much more than the purchase price of a server. This article presents a practical framework for estimating annualized total cost of ownership (TCO) and cost per million tokens, using two reference capacity tiers: an 8-GPU node with 96 GB of VRAM per GPU and a single server with 1 TB of VRAM. It also examines how utilization, KV cache size, context length, quantization, multi-token prediction, batching, and agent workloads affect real service cost, and it ends with a checklist for deciding between self-hosting and renting.
Local deployment of a long-context LLM should not be evaluated only by the purchase price of a single machine. The real budget driver is total cost of ownership (TCO): hardware depreciation, power and cooling, data center space, storage, networking, operations labor, spare parts, and the tuning and benchmarking work required to deliver stable service. The following sections provide a reusable estimation framework and use two representative capacity tiers to explain the relationship between cost and throughput.
1. Define the Cost Scope: Serviceable Cost
On-premises investment usually falls into four categories:
- One-time investment: inference servers, CPUs, memory, NVMe storage, network interface cards, switches, power supplies, racks, and related equipment.
- Recurring investment: electricity, colocation or self-built data center allocation, bandwidth, storage expansion, and spare parts.
- Labor: deployment, quantization calibration, benchmarking, monitoring, incident handling, and version upgrades.
- Efficiency loss: quality regression caused by quantization, low utilization caused by insufficient batch tuning, and KV cache fragmentation under long-context workloads.
Therefore, when discussing “how much it costs,” two metrics matter: annualized TCO and cost per million tokens. The first determines the budget. The second determines whether on-premises deployment is more economical than renting.
2. Two Representative Capacity Tiers
Tier A: An 8-GPU Node with 96 GB of VRAM per GPU
Under one reference workload, an 8-GPU node with 96 GB of VRAM per GPU, running 4-bit weights and 8-bit activations, can cover about 200K context and around 20 concurrent requests. With multi-token prediction enabled, single-stream decoding reaches about 80 tokens/s; aggregate throughput at 15 concurrent requests is around 600 tokens/s, with peaks of 800–1,000 tokens/s. The workload is primarily agent-based. This tier is suitable for medium-scale long-context question answering, tool calling, and multi-turn agent services.
Note that 20 concurrent requests is not a fixed ceiling. It depends on input length, output length, KV cache precision, batching strategy, and the service-level objective (SLO). If requests are generally close to 200K context, VRAM will be consumed quickly by the KV cache. If short-input, multi-turn tool calls dominate, prefix caching and continuous batching can significantly improve effective throughput.
Tier B: A Single Server with 1 TB of VRAM
A single server with 1 TB of VRAM can run 4-bit weights, 8-bit activations, and an 8-bit KV cache version, with a KV cache pool close to 4 million tokens. It is suitable for small-scale coding assistance and stable service. Its advantage is not extremely fast single-request performance, but the ability to maintain more concurrency and longer context within a large VRAM pool. By setting the batch count and batch size appropriately, it can provide relatively stable service.
This type of machine is better suited to scenarios where request lengths vary widely, longer context is needed, and concurrency is not extreme but stability matters. For a small amount of validation, direct purchase is not economical. If a stable workload already exists, a single large-VRAM server can reduce cross-node communication and scheduling complexity.
3. Cost Model: Make the Variables Explicit
The following pseudocode can be used to build an annualized TCO and cost-per-million-token model:
def annual_tco(capex, years, power_kw, electricity, pue,ops, storage, labor):depreciation = capex / yearselectricity_cost = power_kw * 24 * 365 * electricity * puereturn depreciation + electricity_cost + ops + storage + labordef cost_per_million_tokens(tco, throughput_tps,hours_per_day, utilization):annual_tokens = throughput_tps * 3600 * hours_per_day * 365 * utilizationreturn tco / (annual_tokens / 1_000_000)
The following example is illustrative and does not represent any specific quotation. The example uses RMB; substitute local rates when applying the model.
Suppose a complete server costs CNY 1.2 million and is depreciated over 3 years. The server draws 8 kW, electricity costs CNY 0.7 per kWh, PUE is 1.3, annual operations and storage costs are CNY 20,000, and labor costs are CNY 100,000. Annual depreciation is then CNY 400,000, annual electricity is about CNY 63,800, and annual TCO is about CNY 583,800.
If aggregate throughput is 600 tokens/s, the service runs 12 hours per day, and average utilization is 0.6, the annual effective token volume is about 5.676 billion tokens, yielding a cost of about CNY 103 per million tokens. If utilization rises to 0.9 and the service runs 24 hours per day, the cost falls significantly.
This leads to a key conclusion: the cost of on-premises deployment is extremely sensitive to utilization. Purchase price is only one input in the TCO numerator. What really raises the cost per million tokens is low load, poor batching efficiency, and KV cache occupancy caused by long context.
4. Why Long-Context and Agent Workloads Make Costs Rise Nonlinearly
The main cost of long context is the KV cache. A simplified formula is:
KV bytes per token ≈ 2 × layers × KV heads × head dimension × bytes per KV precision unitTotal KV ≈ KV bytes per token × sequence length × concurrency
When context increases from 8K to 200K, the KV cache can grow by more than an order of magnitude. Even if weights are already quantized, the KV cache still consumes VRAM and limits concurrency. Agent workloads are characterized by multiple turns, a mix of long and short inputs, frequent tool calls, and variable output lengths. As a result, it is common to see “good average throughput, but tail latency jitter.” Capacity planning therefore cannot rely only on peak throughput; it must also consider P95/P99 latency and request queueing time.
5. Benefits and Limits of Quantization, Multi-Token Prediction, and Batching
4-bit weights, 8-bit activations, and an 8-bit KV cache can significantly reduce VRAM usage, but quality evaluation and a fallback strategy are required. Not all layers are suitable for low precision, and calibration data must cover the real business distribution.
Multi-token prediction can improve decoding throughput, but the benefit depends on the acceptance rate. In agent scenarios with multiple turns and short outputs, scheduling overhead may offset the gain. Continuous batching, chunked prefill, paged KV cache, and prefix caching are key to turning throughput into stable service. In particular, cache system prompts, tool definitions, and repeated context.
6. Self-Hosting or Renting: A Decision Checklist
Use the following sequence to evaluate the decision:
- Is the workload stable? If daily request volume fluctuates widely and peaks are pronounced, prefer elastic rental or a hybrid deployment.
- Is long context common? If most requests exceed 32K, KV cache cost will dominate the budget, so performance testing should focus there.
- Concurrency and SLOs: For agent scenarios, test multi-turn conversations, tool calls, and mixed long/short inputs, not just single-turn throughput.
- Does the team have operations capability? Quantization calibration, monitoring and alerting, fault diagnosis, and version upgrades all require labor.
- Data compliance and network latency: Consider self-hosting only when localization requirements exist. Otherwise, first validate with GPU instances, container platforms, object storage, and monitoring and alerting in general cloud service categories.
Overall, an 8-GPU node with 96 GB of VRAM per GPU is suitable for medium-scale long-context and agent services, while a single server with 1 TB of VRAM is suitable for small-scale coding assistance and stable concurrent service. Budget planning should center on annualized TCO and cost per million tokens, with utilization, context length, KV cache precision, and batching strategy as the core variables in sensitivity analysis. Only then does “how much does local deployment cost?” become a verifiable capacity and cost-engineering question rather than a procurement question alone.
