Calculating the Costs of Private LLM Deployment: From Throughput to Break-Even
This article explores how to accurately calculate the costs of privately deploying Large Language Models (LLMs). It covers key factors including hardware constraints, the difference between single-request speed and overall system throughput, and cost models for leasing versus purchasing. It also provides a practical method to estimate the break-even price per million tokens, helping you assess whether a pricing model is profitable or operating at a loss.
1. Why Pricing Should Be Reverse-Engineered from Costs
When evaluating whether the price of a model service is reasonable, a common approach is to look at capability rankings first, and then the price list. While this method compares capabilities, it fails to explain the costs behind the pricing. A more reliable approach is to reverse-engineer it: first estimate the hardware costs, then estimate the number of tokens the system can produce per unit of time, and finally calculate the break-even price to compare against market rates.
A service provider’s pricing can be broken down into two parts:
- Unit Cost: The hardware, electricity, and operational expenses required to produce one million tokens.
- Profit Margin: The gross profit added on top of the unit cost, factoring in competition and user scale.
As long as the unit cost is calculated clearly, you can determine whether a given price offers a healthy profit margin, operates at a loss, or is sustained by subsidies.
2. Hardware Constraints: Can It Run, and How Fast?
2.1 VRAM Capacity
Model weights must fit entirely into VRAM or high-speed accessible memory. In Mixture of Experts (MoE) models, only a portion of the parameters is activated during inference, but the weights of all experts must still reside in memory. Therefore, fewer activated parameters do not necessarily mean lower memory requirements. When selecting hardware, you should first calculate the weight footprint and then reserve space for activation values and caches.
Quantization can reduce the number of bytes occupied by a single parameter, thereby lowering VRAM requirements. However, the drop in precision may affect output quality, which requires validation using your own evaluation datasets.
2.2 Node Scale and Communication
Multiple accelerator cards within a single node collaborate via high-speed interconnects. When a model can fit on a single node, cross-card communication overhead is low, and latency is more controllable. If the model needs to be partitioned across multiple nodes, the network bandwidth and latency between nodes will directly slow down inference speeds, reducing overall system throughput. Therefore, whether a model can be deployed on a single node is the first dividing line in cost estimation.
2.3 Context Length and KV Cache
During inference, the model must save the Key-Value (KV) cache of historical tokens for each request. The cache size grows with the context length and the number of concurrent requests. Long-context requests consume a significant amount of VRAM, reducing the number of requests that can be served simultaneously, which in turn lowers overall throughput. When estimating, you should use the real-world context length distribution of your business, rather than just the maximum context length.
3. Two Metrics of Throughput: Single-Request Speed vs. Overall System Throughput
Many comparison articles only provide the output speed of a single request, such as tokens per second. This number reflects the waiting experience of a single user and does not directly represent production capacity.
Online services typically use continuous batching, combining multiple requests into the same batch for computation. As concurrency increases, the computing resources allocated to each request decrease, causing the single-request speed to drop, but the overall system throughput will rise.
Consider this hypothetical example:
- With only 1 concurrent request, the single-request output speed is 40 tokens/second, and the system throughput is also 40 tokens/second.
- When concurrency increases to 20, the per-request speed drops to 16 tokens/second, but the system throughput reaches 320 tokens/second.
Production capacity should be calculated based on overall system throughput. The estimation formula for monthly output is:
Monthly Output (tokens) = Overall System Throughput × Seconds per Month × Average Utilization Rate
Here, the average utilization rate refers to the ratio of the actual processed load to the full-load capacity. Running at full capacity all day is rare; traffic often varies significantly between day and night, and between weekdays and weekends. Ignoring the utilization rate will lead to an overestimation of production capacity, which in turn makes the break-even unit price appear artificially low.
4. Cost Models: Leasing vs. Purchasing
4.1 Leasing
The monthly cost of leasing typically includes:
- Monthly rent for computing resources;
- Additional fees for storage, networking, images, and load balancing;
- Other fees arising from interruptions or overages.
The advantages of leasing are low upfront investment and high elasticity. The downside is a higher long-term cost of ownership, making it suitable for businesses with highly fluctuating loads or those in the validation phase.
4.2 Purchasing
The monthly cost of purchasing requires amortizing the one-time investment over the usage period, typically including:
- Total equipment cost divided by the depreciation period in months (e.g., 36 months);
- Electricity costs, calculated based on power draw, electricity rates, and operating hours;
- Data center colocation, cooling, and network bandwidth;
- Operations and maintenance (O&M) labor and spare parts for failures;
- Cost of capital.
Electricity and cooling costs cannot be assumed to be zero. When high-power accelerator cards run at full load, power consumption and cooling expenses can form a significant portion of the long-term costs.
5. Reverse-Engineering the Break-Even Price from Monthly Costs
The formula for calculating the break-even unit price is:
Break-Even Price (yuan / million tokens) = Monthly Cost (yuan) ÷ Monthly Output (million tokens)
A common pitfall here is unit conversion. 2 billion tokens equals 2,000 million tokens, not 20,000 million tokens. A conversion error will cause a 10x discrepancy in the results, so it is crucial to standardize units before calculating.
5.1 Leasing Example
Assume the monthly rent is 265,000 yuan, and the system produces 2 billion tokens per month at full load.
- Monthly Output: 2,000 million tokens;
- Break-Even Price: 265,000 ÷ 2,000 ≈ 132.5 yuan / million tokens.
This means that if you only charge for output tokens, the unit price must be higher than approximately 132 yuan / million tokens to cover costs.
5.2 Purchasing Example
Assume the total equipment cost is 7,000,000 yuan, depreciated over 36 months, temporarily excluding electricity and O&M costs.
- Monthly Depreciation: 7,000,000 ÷ 36 ≈ 194,444 yuan;
- Break-Even Price at Full Load: 194,444 ÷ 2,000 ≈ 97.2 yuan / million tokens;
- If the average utilization rate is only 50%, the monthly output drops to 1,000 million tokens, pushing the break-even price up to approximately 194.4 yuan / million tokens.
The impact of the utilization rate on the unit price is often greater than the hardware selection itself. (Note: The examples above are hypothetical demonstrations and do not represent any specific market data.)
