LLM Inference Electricity Cost: Calculating Tokens per kWh

    This article breaks down the electricity cost of large language model inference by converting everything into a single physical metric: tokens produced per kilowatt-hour. It walks through a three-layer estimation model covering effective power draw with PUE, memory-bandwidth-bound decoding throughput, and lower-energy prefill, then translates those figures into electricity-price equivalents and explains why real utilization discounts the theoretical numbers. Finally, it outlines the deployment economics of private hosting, aggregation services, and application-level optimization, along with a practical checklist for measuring tokens per joule and planning capacity.

    1. Why Convert Cost into “Cost per kWh”

    When leading models become comparable in general capability and only trade wins on narrow tasks, purchasing decisions shift quickly from benchmark rankings to the landed cost per token. This is not a value judgment but a basic rule of engineering economics: converging capability lowers switching costs, and lower switching costs push prices toward marginal cost. For LLM inference, marginal cost lands almost entirely on electricity and the depreciation of the hardware that consumes it.

    Expressing everything as “how many tokens a single kWh can produce” strips away vendor pricing strategy, commercial discounts, cache hit rates, and every other external variable. What remains are the hard constraints of the physical and architectural layers. It is also a useful counter-intuitive tool: many people assume tokens are expensive, but from an energy standpoint, generating one token costs almost nothing. What is expensive is the entire pipeline that packages that tiny capability into a stable service.

    2. The Estimation Chain: From Per-GPU Power to Tokens per kWh

    The calculation rests on three layers of assumptions: power, throughput, and utilization. A change in any layer shifts the conclusion by a multiple, so every assumption must be stated explicitly.

    1. Power Layer: Effective Power, Not Nameplate Power

    Take a single high-power inference accelerator. Nameplate power is typically around 700W, but a real rack adds cooling, power delivery losses, network switching, the host CPU, and storage nodes. The industry uses PUE (Power Usage Effectiveness) to describe this overhead; newly built large data centers generally fall in the 1.2–1.4 range. With PUE ≈ 1.3, the effective power per GPU is about 900W, or 900 joules per second.

    2. Throughput Layer: Decoding Is a Serial Bottleneck

    Autoregressive decoding generates tokens one at a time. Each step reads all weights and the growing KV Cache from memory, so decoding is memory-bandwidth-bound rather than compute-bound. In large-batch, high-concurrency scenarios, an aggregated single-GPU output throughput around 1000 tokens/second is a reasonable conservative figure; a well-tuned cluster under load testing can push into the thousands.

    The energy per output token is therefore:

    1. 900 J/s ÷ 1000 token/s = 0.9 J/token
    2. 1 kWh = 3,600,000 J
    3. 3,600,000 ÷ 0.9 ≈ 4 million output tokens / kWh

    3. Prefill: Higher Parallelism, Lower Energy

    The input side (prefill) processes an entire prompt in one matrix multiplication. It has high parallelism and is compute-bound, with single-GPU throughput reaching tens of thousands of tokens/second, or roughly 0.09 J/token. That means one kWh can process about 40 million input tokens. This 10x gap is the root of every cost conclusion that follows.

    3. Converting to Money: Both Sides and the Mix Ratio

    Multiplying these physical results by price yields the “electricity-price equivalent”:

    • Output side at $50 per million tokens: 4 million × 50 / 1 million ≈ $200/kWh
    • Input side at $10 per million tokens: 40 million × 10 / 1 million ≈ $400/kWh
    • Blended at a typical 3:1 input-to-output ratio: about $250–300/kWh, or roughly ¥1800–2200

    In other words, the “revenue per kWh” implied by mainstream API pricing is two to three orders of magnitude above industrial electricity rates. That gap is not the electricity bill. It covers depreciation, networking and storage, amortized R&D, security and compliance, sales and channels, and a product premium that the price war has not yet fully erased.

    Sensitivity to the range must be stressed: letting throughput assumptions vary from 500 to 3000 tokens/second swings the conclusion between $100–800/kWh (about ¥700–6000). The correct use of this number is order-of-magnitude judgment, not a basis for quoting prices.

    4. Putting Utilization Back In: Why the Theoretical Value Needs a Discount

    The calculation above is an ideal full-load figure. Real systems discount it in four ways:

    1. Batching efficiency: at low concurrency, batches are not filled, memory bandwidth idles, and per-token energy can multiply several times over;
    2. KV Cache and the memory wall: long contexts make cache occupancy squeeze the concurrency batch that fits, so throughput does not scale linearly with context length;
    3. Idle power: with no requests, GPUs still draw substantial baseline power, and a low-utilization platform’s tokens per kWh deteriorates sharply;
    4. Model size differences: parameter count, attention implementation, and quantization precision together determine bandwidth demand, so the same coefficient cannot be carried across models.

    A practical self-check metric is “tokens per watt” (token/J). Making it a routine observation in your load-testing pipeline predicts the bill better than any single-point benchmark.

    1. # Example: convert load-test results into tokens per kWh and electricity-price equivalent
    2. def per_kwh(energy_j_per_token: float, price_per_mtok: float) -> dict:
    3. tokens = 3_600_000 / energy_j_per_token # tokens / kWh
    4. return {
    5. "tokens_per_kwh": tokens,
    6. "usd_per_kwh": tokens * price_per_mtok / 1e6,
    7. }
    8. print(per_kwh(0.9, 50)) # output side
    9. print(per_kwh(0.09, 10)) # input side

    5. Deployment Economics: Where the Break-Even Lines Fall

    Once the cost structure is clear, the conditions for three strategies follow:

    • Private deployment: when call volume is large enough, load is stable enough, and data compliance requirements are strict, replacing API spend with “electricity + depreciation + operations staff” is more economical. The key is not unit price but whether utilization can stay above the break-even line over the long term; with insufficient utilization, self-hosting is actually more expensive.
    • Relay and aggregation services: their revenue is essentially a channel fee plus a stability premium, so they naturally lean toward self-hosting or hosting open-weight models, using controllable cost per kWh to serve the long tail of small customers and scattered calls.
    • Application-layer optimization: prompt compression, result caching, semantic routing (simple requests to smaller models), batching, and asynchrony all improve tokens per kWh directly without touching infrastructure.

    6. An Action Checklist for Developers

    1. Build your own token/J baseline, measured separately by model, context length, and concurrency tier;
    2. In capacity planning, look at both the PUE and utilization curves rather than GPU count alone;
    3. Use the input-to-output ratio to reverse-engineer the real bill structure and spot the hidden cost of long-prompt scenarios;
    4. Treat “capability is sufficient” as the selection prerequisite, then let cost per kWh make the final call;
    5. If self-hosting is on the table, build a load-testing and observability loop on general-purpose container platforms, object storage, message queues, and monitoring and alerting, so the cost model keeps recalibrating itself.

    The conclusion is plain: once capability converges, the deciding factor in LLM competition is how many usable tokens each watt can produce. Whoever pushes that curve lower holds the initiative on pricing.