This document defines a standard for AI providers (such as Mistral) to disclose energy consumption and carbon emissions data through their APIs. The goal is to enable clients to track and report the environmental impact of AI usage.
AI model inference consumes significant energy. Users and organizations increasingly want visibility into:
- Energy consumption (joules, watt-hours, kilowatt-hours)
- Carbon emissions (grams CO2 equivalent)
- Data attribution (measured vs estimated, methodology used)
Client applications like Mistral Vibe currently track:
- Token usage (input/output tokens)
- Cost (based on pricing per million tokens)
- But NOT energy or carbon emissions
Providers SHOULD send energy data as SSE (Server-Sent Events) comments alongside the main response stream.
Format:
: energy {"energy_joules": <float>, "energy_kwh": <float>, "wh": <float>, "g_co2e": <float>, "source": "measured", "provider": "<provider>"}
Example:
data: {"choices": [{"delta": {"content": "Hello"}}]}
: energy {"energy_joules": 500.0, "energy_kwh": 1.39e-07, "wh": 0.000139, "source": "measured", "provider": "mistral-datacenter", "method": "direct"}
data: {"choices": [{"delta": {"content": " world"}}]}
data: [DONE]
Advantages:
- Non-breaking: Clients that don't support energy ignore the comments
- Streaming updates: Energy can be reported in real-time during inference
- Simple parsing: Lines starting with
: energyare clearly marked
Providers SHOULD include energy data in the usage object of the response body.
Format:
{
"choices": [...],
"usage": {
"prompt_tokens": 100,
"completion_tokens": 50,
"energy": {
"joules": 1500.0,
"kwh": 4.167e-07,
"wh": 0.000417,
"g_co2e": 0.000167,
"source": "measured",
"provider": "mistral-datacenter",
"method": "direct-instrumentation",
"grid_carbon_intensity": 400.0
}
}
}Providers MAY include energy data in response headers for simple integrations.
Header: X-Energy-Data
Example:
X-Energy-Data: {"energy_joules": 1500.0, "source": "measured"}
| Field | Type | Required | Description |
|---|---|---|---|
joules |
float | Recommended | Energy in joules (SI unit) |
kwh |
float | Recommended | Energy in kilowatt-hours (billing unit) |
wh |
float | Recommended | Energy in watt-hours (convenient unit) |
g_co2e |
float | Recommended | Carbon emissions in grams CO2 equivalent |
source |
string | Required | "measured" or "estimated" |
provider |
string | Recommended | Provider/datacenter identifier |
method |
string | Recommended | Attribution method (e.g., "direct", "proportional") |
- 1 Wh = 3,600 J
- 1 kWh = 3,600,000 J = 1,000 Wh
- 1 Wms (Watt-millisecond) = 1/3,600,000 Wh
Carbon emissions (gCO2e) = Energy (kWh) × Grid Carbon Intensity (gCO2/kWh)
Typical grid intensities:
- Global average: 400-500 gCO2/kWh
- Low-carbon grids (France, Norway): 20-100 gCO2/kWh
- High-carbon grids: 600+ gCO2/kWh
The proposed implementation adds:
-
Energy Capture Module (
vibe/core/llm/energy_capture.py)- Parses SSE comments and response body for energy data
- Supports Neuralwatt and GreenPT formats
- Provides fallback estimation when provider doesn't support energy disclosure
-
Extended AgentStats (
vibe/core/types.py)- Tracks session and per-turn energy consumption
- Accumulates carbon emissions
- Distinguishes measured vs estimated energy
-
Backend Integration (
vibe/core/llm/backend/generic.py)- Captures energy data from SSE streams
- Stores energy in response headers
from vibe.core.types import AgentStats
stats = AgentStats()
# After each LLM call, energy is automatically updated
stats.update_energy(measured_energy_data)
# Display to user
print(f"Energy: {stats.session_energy.energy_summary}")
print(f"Carbon: {stats.session_energy.carbon_summary}")
print(f"Source: {stats.session_energy.source}")Implementing energy disclosure:
- Transparency: Shows commitment to environmental responsibility
- Trust: Users can verify sustainability claims
- Differentiation: Stand out in a competitive market
- Future-proofing: Prepare for potential regulations
We propose that Mistral and other AI providers:
- Implement the SSE comment format for streaming energy disclosure
- Include energy data in non-streaming response bodies
- Document the methodology used for energy measurement/estimation
- Report both energy and carbon emissions where possible
This standard enables a new generation of energy-aware AI clients that help users understand and minimize their environmental impact.
- Neuralwatt Documentation
- GreenPT API
- Electricity Maps - Grid carbon intensity data
***