LLM Inference Energy and Cost: A Practical Guide to Tokens per kWh

    This guide presents a neutral, reproducible framework for estimating large language model inference energy consumption and cost. It explains how to define a consistent energy baseline, separate prefill and decode power curves, convert throughput into revenue per kWh, and turn uncertainty into an actionable tuning checklist. Readers will learn to compare deployment options using the same assumptions for model selection, pricing, and capacity planning.

    1. Why “Tokens per kWh” Deserves a Careful Calculation

    Discussions of model capability tend to focus on benchmarks and leaderboards. What actually determines whether a business can scale, however, is how many usable tokens a unit of energy and a unit of compute can return. Putting electricity cost, machine hours, and throughput into the same table answers three engineering questions: how much traffic a pipeline can handle, what the marginal cost of a single request is, and where the bottleneck will appear first when scaling up.

    This article does not evaluate any specific model or product. Instead, it offers a neutral, reproducible estimation framework. Any claim that a model “tops a benchmark” should first be translated into verifiable input and output assumptions before entering the cost model.

    2. Step 1: Establish a Credible Baseline for Energy per Token

    Inconsistent assumptions are the most common source of error in energy estimation. Fix the following four assumptions and state them explicitly in your documentation:

    • Card power: use the nominal power of the accelerator as the baseline (for example, around 700W);
    • Facility overhead: apply a PUE factor for cooling, networking, storage, CPUs, and so on (typically 1.2–1.4);
    • Effective power: card power × PUE, around 900W;
    • Output throughput: aggregated output speed per card under large-batch inference, conservatively 500, neutrally 1000, optimistically 3000 tokens/s.

    This yields the core formula:

    1. Energy per output token (J) = Effective power (W) / Output throughput (token/s)
    2. Neutral assumption: 900 / 1000 = 0.9 J/token
    3. 1 kWh = 3,600,000 J
    4. Output tokens per kWh ≈ 3,600,000 / 0.9 ≈ 4 million

    Treating throughput as a variable rather than a constant is key to this model. Every doubling of throughput halves the energy per token and doubles the output per kWh. This also explains why “the same kWh” can differ enormously under different workloads.

    3. Step 2: Separate the Energy Curves for Prefill and Decode

    Inference has two phases, prefill and decode, with completely different energy structures:

    • Prefill is highly parallel matrix computation. Per-card throughput can reach around 10,000 tokens/s, energy per token is around 0.09 J, and about 40 million input tokens can be processed per kWh.
    • Decode is token-by-token autoregression, constrained by memory bandwidth and batch size, with significantly higher energy consumption.

    Therefore, the input side and the output side must be priced and converted separately, then blended according to the actual business ratio. Conflating the two is the primary reason cost estimates become distorted.

    4. Step 3: Convert to Revenue per kWh Using Prices

    Given unit prices, energy consumption can be converted into economic value:

    1. Output side: 4 million tokens × ($50/million) ≈ $200/kWh
    2. Input side: 40 million tokens × ($10/million) ≈ $400/kWh
    3. Blended at input:output = 3:1 ≈ $250–300/kWh

    Considering throughput uncertainty, a reasonable range can be widened to $100–800/kWh. The width of this range is itself a conclusion: before real throughput is measured, no single-point number should be treated as a commitment.

    5. Step 4: Turn Uncertainty into an Actionable Tuning Checklist

    To put the estimation into practice, replace each assumption with measured values and optimize in the following order:

    1. Increase batch size and concurrency to amortize fixed overhead and directly raise tokens/s;
    2. Enable paged memory management and prefix reuse to reduce repeated prefill cost;
    3. Compress and apply retrieval-based trimming for long-input scenarios to reduce wasted prefill;
    4. Use monitoring, alerting, and logging services to collect real power, throughput, and queueing latency, forming a feedback loop;
    5. Use elastic scaling on a container platform to convert peak-to-trough differences into cost differences.

    Illustrative pseudocode:

    1. def cost_per_kwh(throughput_out, pue=1.3, card_w=700,
    2. price_out=50, price_in=10, in_out_ratio=3):
    3. eff_w = card_w * pue
    4. j_per_out = eff_w / throughput_out
    5. out_per_kwh = 3_600_000 / j_per_out
    6. in_per_kwh = out_per_kwh * 10 # Prefill throughput is roughly ten times decode
    7. mixed = (in_per_kwh * ratio_in * price_in +
    8. out_per_kwh * price_out) / 1e6
    9. return mixed

    6. A Rational View of the Market Landscape

    A benchmark lead brings short-term attention, but the landscape is determined by three things: cost per token, available capacity, and the engineering ecosystem. Only if a vendor improves both output per kWh and stability at the same time will price and market share genuinely shift; otherwise, leaderboard position is just a marketing variable. For developers, the safest strategy is to build a reproducible estimation table and compare different options horizontally with the same assumptions, rather than being pulled by a single metric.

    7. Conclusion

    Treating “tokens per kWh” as the first-principles metric, combined with separate input/output modeling, range estimation, and a measurement feedback loop, keeps you in control during selection, pricing, and capacity planning. Tools and platforms can be replaced; the methodology will not become outdated.