Put the Grid in Your AI Cost Model

Leader ●1 ●7 ●10
calendar_today ago • schedule4 min read

The U.S. Senate passed a bill 62 to 33 that would make data centers pay for the transmission they use. The House is expected to vote this week. A Cornell study in Nature Energy found data centers paid 38% of the infrastructure cost tied to their growth in 2025, and residents paid the other 62%.

Almost no AI cost model has a power line in it. Here is a small one that does. It runs, and the tests pass.

The model does not claim to know how much energy a token uses. That number depends on your hardware, model and batching. You measure it and pass it in. Everything else is arithmetic on public figures, with the sources named in the comments.

The model

"""Put the grid in your AI cost model.

Everything here is arithmetic on inputs you supply or numbers from public
sources named in the comments. Nothing in this file asserts how much energy
a token uses. Measure that for your own workload and pass it in.
"""
from dataclasses import dataclass


# Public figures used as defaults. Sources are in the post.
CORNELL_DC_SHARE = 3.12 / 8.25      # data centers paid 38% of $8.25B (2025)
CORNELL_RESIDENT_SHARE = 5.13 / 8.25
GS_DC_TWH = 192                     # Grid Strategies, from LBNL 2026
GS_TRANSMISSION_SHARE = 0.14        # transmission share of retail rate
GS_COMMERCIAL_RATE = 0.083          # EIA commercial $/kWh
GS_TEN_YEAR_TOTAL = 55e9            # estimated charges over 10 years, BAAJA


@dataclass
class Scenario:
    kwh_per_mtok: float          # YOUR measured energy per million tokens
    price_per_mwh: float         # wholesale $/MWh where the work runs
    uplift: float = 0.0          # fractional wholesale price increase
    adder_per_mwh: float = 0.0   # transmission or capacity pass through

    @property
    def effective_price_per_mwh(self):
        return self.price_per_mwh * (1 + self.uplift) + self.adder_per_mwh


def energy_cost(tokens, s):
    """Dollar cost of the electricity behind `tokens` tokens."""
    kwh = tokens / 1e6 * s.kwh_per_mtok
    return kwh / 1000 * s.effective_price_per_mwh


def exposure(tokens_per_task, base, uplifts, adder_per_mwh=0.0):
    """Electricity cost of one task under each uplift, with the delta."""
    base_cost = energy_cost(tokens_per_task, base)
    rows = []
    for u in uplifts:
        s = Scenario(base.kwh_per_mtok, base.price_per_mwh, u, adder_per_mwh)
        c = energy_cost(tokens_per_task, s)
        rows.append({"uplift": u, "cost": c, "delta": c - base_cost})
    return rows


def cost_shift(total_cost, dc_share=CORNELL_DC_SHARE):
    """Split infrastructure cost between data centers and everyone else."""
    dc = total_cost * dc_share
    return {"data_centers": dc, "everyone_else": total_cost - dc}


def existing_transmission_payments():
    """Reproduce Grid Strategies' ~$2B a year status quo estimate."""
    kwh = GS_DC_TWH * 1e9
    return kwh * GS_COMMERCIAL_RATE * GS_TRANSMISSION_SHARE


def incremental_vs_status_quo(total=GS_TEN_YEAR_TOTAL, years=10):
    """The 'additional' charge: ten year total minus the status quo."""
    return total - existing_transmission_payments() * years


if __name__ == "__main__":
    # Illustrative inputs. Replace with your own measurements.
    base = Scenario(kwh_per_mtok=1.0, price_per_mwh=60.0)
    print("uplift  cost/task  delta")
    for r in exposure(2_000_000, base, [0.10, 0.15, 0.20]):
        print(f"{r['uplift']:>5.0%}  ${r['cost']:.4f}   ${r['delta']:.4f}")
    print(f"existing payments ${existing_transmission_payments()/1e9:.2f}B a year")
    print(f"additional over 10y ${incremental_vs_status_quo()/1e9:.1f}B")

Run it

$ python grid_cost.py
uplift  cost/task  delta
  10%  $0.1320   $0.0120
  15%  $0.1380   $0.0180
  20%  $0.1440   $0.0240
existing payments $2.23B a year
additional over 10y $32.7B

The cost per task and kwh_per_mtok here are placeholders so the example runs. Replace kwh_per_mtok with your own measurement. The 10, 15 and 20 percent uplifts bracket the wholesale price increases the Cornell study found in its most affected hubs (about 15% in Virginia and about 20% in the southern Bay Area).

Tests

import math
import pytest
from grid_cost import (Scenario, energy_cost, exposure, cost_shift,
                       existing_transmission_payments,
                       incremental_vs_status_quo)


def test_energy_cost_basic():
    s = Scenario(kwh_per_mtok=100, price_per_mwh=50)
    # 1M tokens -> 100 kWh -> 0.1 MWh -> $5
    assert math.isclose(energy_cost(1_000_000, s), 5.0)


def test_uplift_and_adder():
    s = Scenario(100, 50, uplift=0.2, adder_per_mwh=10)
    assert math.isclose(s.effective_price_per_mwh, 70.0)


def test_exposure_delta_scales():
    base = Scenario(100, 50)
    rows = exposure(1_000_000, base, [0.1, 0.2])
    assert math.isclose(rows[0]["delta"], 0.5)
    assert math.isclose(rows[1]["delta"], 1.0)


def test_cost_shift_matches_cornell():
    out = cost_shift(8.25e9)
    assert math.isclose(out["data_centers"], 3.12e9, rel_tol=1e-9)
    assert math.isclose(out["everyone_else"], 5.13e9, rel_tol=1e-9)


def test_status_quo_is_about_two_billion():
    assert 2.0e9 < existing_transmission_payments() < 2.5e9


def test_additional_reconciles_to_about_35b():
    assert 31e9 < incremental_vs_status_quo() < 34e9
$ pytest -q test_grid_cost.py
......                                                                   [100%]
6 passed

Checking Grid Strategies' number

The $55 billion figure for ten years of data center transmission charges under the bill comes from Grid Strategies. existing_transmission_payments() rebuilds their status quo estimate from their own inputs: 192 TWh of data center demand, a 14% transmission share and an $0.083 per kWh commercial rate. It returns $2.23 billion a year. incremental_vs_status_quo() subtracts ten years of that from $55 billion and gets about $32.7 billion. The paper says $35 billion because it rounds the status quo to $2 billion a year. The paper also notes that some of its table labels are inconsistent, and that the $55 billion is an estimate, not a forecast.

What to do with it

  • Run your real tasks through exposure() at the 10 to 20 percent range and look at the delta per task.
  • Use adder_per_mwh to model a capacity or transmission charge if a vendor says it will pass one through.
  • Ask your vendors how grid and capacity charges are treated in your pricing. Their answer tells you who carries the risk.

The full story, with the PJM capacity auction and the House schedule, is on Hashnode. Repos: https://github.com/AndMaverick

Sources

Want more #ai & #python deep dives?

Join 6,134+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

1 Comment

1 vote

More Posts

What Developers Already Know About Data Center Delays

Tom Smithverified - Sep 28

Stop trusting verdicts your policy no longer supports

VEACESLAV - Dec 1

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12
chevron_left
1.1k Points • 18 Badges
5Posts
6Comments
3Connections
I was a product architect at OpenAI from 2016, then built the onboarding and documentation systems b... Show more

Commenters (This Week)

3 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!