DEV Community

Cover image for Coding Sustainability: Calculating the Carbon Intensity of AI Training in Python
Preston Marwicke
Preston Marwicke

Posted on

Coding Sustainability: Calculating the Carbon Intensity of AI Training in Python

As we deploy capital into green energy, we need to verify the "Greenness" of the AI models we support. We built a tool to estimate the carbon footprint of inference jobs based on grid location.

The Tech:

API integration with ONS (Brazilian Grid Operator) to get real-time generation mix (Wind vs. Hydro vs. Thermal).

Python script to map TWh to CO2e.

The Logic: if grid_mix == "100% Renewable": carbon_tax_credit = True

Why it matters: In 2026, "Green Compute" is a premium asset class. By quantifying it with code, we can value the companies providing it more accurately. We don't just trust the ESG report. We calculate the emissions ourselves.

https://www.velthorneassetmanagement.com/

Top comments (0)