Plan usage board shows energy, in kitchen terms - #6
Open
debtn wants to merge 1 commit into
Open
Conversation
The board already knew everything it needed: the proxy records input, output, cache-write and cache-read separately, per person per day per model, and the model recorded is the one that actually served. Energy is a coefficient on top of that, so it accumulates through the same path as cost and lands beside it. Output tokens dominate -- generating is sequential, one forward pass per token -- while prefill runs in parallel and a cache read skips recomputation almost entirely, so the classes are weighted 1 / 0.15 / 0.15 / 0.05 the way the price weights mirror billing. Per-model scaling comes from each model's output price relative to Opus: price is a proxy for serving compute rather than a measurement of it, but treating a day on Haiku like a day on Fable would be more wrong than this is, and the scalar only moves things 0.2-2x. Two things the display is deliberate about, because the number invites overclaiming in both directions. It always shows a band. The absolute coefficient is inferred, not published: from hardware it lands near 0.04-0.15 mWh per output token, and from labs' per-prompt figures nearer 0.8-1.1 mWh, a spread of roughly twentyfold that nothing outside a datacenter closes. A single confident figure would read as a measurement. The token counts underneath are exact, and stay separable from the coefficient so it can be revised later without the history becoming a lie. And it compares to appliances, not vehicles. A whole project works out to about 376 feet of driving, which reads as "this is nothing" -- and inflating it to avoid that would be worse. A kettle, a phone charge, a day of the fridge sit at the same order of magnitude as the real number, so the comparison informs instead of dismissing. The anchor ladder climbs with the amount, so a person-day reads in kettles and the network's all-time total reads in fridge-days rather than four thousand phone charges. The note above the board says plainly that it's an estimate, and that builders on their own API key aren't counted at all -- every metering call in the proxy is gated on community membership. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFnFvBZPsVQjc5Xwj7H9nZ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds estimated watt-hours and a household comparison to the steward Plan usage tab — per builder, and for the network as a whole. Follows from the energy design exploration.
Why this was cheap
The board already knew everything it needed. The proxy records input, output, cache-write and cache-read separately, per person per day per model, and the model recorded is the one that actually served — so outage fallbacks attribute correctly. Energy is a coefficient on top of that, accumulating through the same path as cost and landing beside it. No schema change, no new tracking.
How the number is built
Output tokens dominate: generating is sequential, one forward pass per token, memory-bandwidth-bound. Prefill runs in parallel and is far cheaper per token, and a cache read skips recomputation almost entirely — so the classes are weighted
1 / 0.15 / 0.15 / 0.05, the way the price weights already mirror billing.Per-model scaling comes from each model's output price relative to Opus. Price is a proxy for serving compute rather than a measurement of it, but treating a day on Haiku like a day on Fable would be more wrong than this is, and the scalar only moves things 0.2–2×, well inside the band.
Two things the display is deliberate about
It always shows a band. The absolute coefficient is inferred, not published: from hardware it lands near 0.04–0.15 mWh per output token; from labs' per-prompt figures nearer 0.8–1.1 mWh. That's a spread of roughly twentyfold, and nothing outside a datacenter closes it. A single confident figure would read as a measurement. The token counts underneath are exact and stay separable from the coefficient, so it can be revised later without the history becoming a lie.
It compares to appliances, not vehicles. A whole project works out to about 376 feet of driving — which reads as "this is nothing", and inflating it to avoid that would be worse. A kettle, a phone charge, a day of the fridge sit at the same order of magnitude as the real number, so the comparison informs rather than dismisses. The anchor ladder climbs with the amount:
The note above the board says plainly that it's an estimate, and that builders on their own API key aren't counted at all — every metering call in
llm-proxyis gated on community membership.Files
src/lib/energy.tsformatWh, the household anchor ladder, and the reasoning behind bothsupabase/functions/admin-requests/index.tsenergyUsage()beside the existing rates;whaccumulates through members, network totals and the 14-day seriessrc/cloud/community-usage.tswhonUsageTotalsand the daily seriessrc/components/StewardPage.tsxVerification
Rendered the real
UsageTabin a browser against the dev server with a stubbed report, and checked the strings across five orders of magnitude — from a single chat turn to the network's all-time total — to confirm the anchors ladder sensibly and nothing reads as "about 4,000 kettles". Two phrasings were wrong on the first pass and are fixed:about 0 phone chargesfor tiny amounts (now less than a phone charge) and~<1 Wh–9.5 Wh(now under 9.5 Wh).tsc -bandvite buildclean;npm run lintunchanged at the 21 pre-existing problems.Deploying
admin-requestsis an edge function, so merging alone won't populate the numbers — it needs a deploy (perCLAUDE.md, via the Management API). Until then the board degrades gracefully:whis absent, the guard suppresses the line, and everything else renders exactly as before.🤖 Generated with Claude Code
https://claude.ai/code/session_01RFnFvBZPsVQjc5Xwj7H9nZ
Generated by Claude Code