Adds seed_energy.py, which runs a fixed reference task N times per routable
model and writes energy_observations rows tagged 'seed_reference'. Scoring
now reads mean measured USD billed and mean measured gCO2eq from those rows
instead of the catalog's list price.
List price was not merely imprecise, it was inverted: deepseek-v4-flash
lists 33% cheaper than gemma-4-31b ($0.28 vs $0.42 per 1M) but costs 95%
more to run ($9.80e-05 vs $5.02e-05) and emits 284% more carbon. Billing is
min($8.00/kWh x energy, 3 x list token price), validated against all 65
samples; the ceiling bound twice, both deepseek energy spikes, matching to
the cent. That rule stays in the docs as rationale — no billing formula is
in the code, since measured cost already accounts for it, including the flex
tier. flex_cost_multiplier is therefore removed rather than left as a guess.
Cost and eco deliberately stay separate axes. Collapsing them looked
right — cost = 8 x energy, so they seemed to be one signal — but carbon is
energy times the serving region's grid intensity, and the catalog spans
37 gCO2/kWh (FI) to 505 (US-MIDA-PJM). They rank models differently:
glm-5.2-fast is 2nd cheapest and 6th cleanest; kimi-k3-flex draws 3.7x less
energy than kimi-k2.7-code while emitting 3.6x more carbon. A test pins it.
Only reference-workload observations steer routing. Organic traffic stays
logged for accounting but is excluded, because per-request energy varies
more with request shape than with the model — 19x across organic traffic on
a single model, purely from differing prompt and completion sizes.
cost_score and eco_score were byte-identical implementations; both now alias
one normalize_inverted.
Effect: 27 routing decisions (9 categories x 3 tiers) went from 2 distinct
models to 3, and tier 1 flipped from deepseek-v4-flash to gemma-4-31b.
Category still cannot influence a decision — proficiency is the only
category-dependent term and remains empty, which is now the single
highest-value gap.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018xTPER7K8fNyKiuqNvTCTa