Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Generative Workload Power and Carbon Ledger Reconciler
Format
Code-aware
Lines
65
Sections
11
Linked challenge
Build a Generative Workload Power and Carbon Ledger Reconciler
Prompt source
Original prompt text with formatting preserved for inspection.
65 lines
11 sections
No variables
1 code block
## Build
Correlate per-request batch tokens with measured accelerator power sensor logs. Synthesize carbon footprint summaries and efficiency improvement plans using hosted Claude.
## User
Datacenter Sustainability Lead
## Workflow
1. Ingest normalized time-series power telemetry from GPU power sensors and batch serving token counts.
2. Compute joules-per-token and convert total watt-hours to carbon equivalents using local regional grid emission factors.
3. Invoke hosted Claude to identify power-inefficient batching patterns and draft optimization proposals.
4. Produce an energy ledger report detailing departmental carbon footprints and recommended power caps.
## Interface
Static HTML sustainability report generator and downloadable CSV carbon allocation ledger.
## Data
Normalized power telemetry logs (Watts) paired with synthetic continuous batching request logs containing input/output token counts.
Starter examples below are synthetic. They are not downloaded records.
## Source
[NVIDIA DCGM exporter](https://raw.githubusercontent.com/NVIDIA/dcgm-exporter/main/README.md)
Utilizes DCGM exporter power consumption metrics (DCGM_FI_DEV_POWER_USAGE) to calculate physical energy draw.
## Tools
evidently-ai, anthropic.
Evidently AI monitors data drift and distribution changes in power-per-token consumption over time.
Hosted a currently available hosted Claude model accessed via Anthropic Python SDK; purely analytical role.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Calculates exact watt-hours and joules-per-token metrics from telemetry.
- Applies regional emission factors accurately to produce kgCO2e values.
- Synthesizes actionable efficiency advice via hosted Claude without fabricated metrics.
## Starter Examples
```json
[
{
"input": {
"team": "SearchPlatform",
"tokens_processed": 5000000,
"duration_hours": 10,
"avg_power_watts": 350,
"grid_carbon_intensity_g_kwh": 380
},
"expected_output": {
"total_kwh": 3.5,
"joules_per_token": 2.52,
"total_emissions_kg_co2": 1.33,
"sustainability_advice": "Joules per token are within standard bounds. Recommend dynamic power capping during low-traffic windows."
}
},
{
"input": {
"team": "DocumentSummarizer",
"tokens_processed": 50000,
"duration_hours": 8,
"avg_power_watts": 320,
"grid_carbon_intensity_g_kwh": 400
},
"expected_output": {
"total_kwh": 2.56,
"joules_per_token": 184.32,
"total_emissions_kg_co2": 1.02,
"sustainability_advice": "Extremely high joules per token detected due to low batch occupancy. Recommend request queue pooling to increase continuous batch utilization."
}
}
]
```
## Safety
Calculations rely solely on explicitly provided telemetry; does not enforce hardware power caps directly.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.