How to Calculate Local LLM Energy per Token
My RTX 5090 test shows how watts and output rate become joules per token, and why the faster of two matched settings can waste energy.
The faster of two matched gemma4:26b settings was not the most efficient. One run gained 1.3% output speed and used 23.3% more energy per output token.
The short answer: Divide average GPU watts by output tokens per second. The result is joules per output token. In my RTX 5090 test, num_batch=256 used about 0.870 joules per output token. The 512 setting used about 1.072. Speed alone hid that difference.
Canonical URL: https://bmdpat.com/blog/local-llm-energy-per-token-2026

How do watts become joules per token?
NIST defines a watt as one joule per second. A model rate is output tokens per second. Divide the first rate by the second rate, and seconds cancel.
joules per output token = average GPU watts / output tokens per second
This number answers a narrow question. It estimates GPU energy during the measured generation period. It does not include the rest of the computer, model load time, prompt work, cooling, or idle power.
What did the two RTX 5090 rows show?
The August 20, 2026 5090 Report includes two gemma4:26b workshop rows. Both used Ollama, a 2,048-token context, 91 input tokens, and 482 output tokens. Both passed the fixed tasks.
| Setting | Output rate | Average GPU power | Energy per output token |
|---|---|---|---|
num_batch=256 | 215.7 tok/s | 187.6 W | 0.870 J/token |
num_batch=512 | 218.5 tok/s | 234.3 W | 1.072 J/token |
The arithmetic is direct. 187.6 / 215.7 = 0.8697. 234.3 / 218.5 = 1.0723. I round each result to three decimal places in the table.
The 512 row generated 1.3% faster. Average GPU power rose 24.9%. Energy per output token rose 23.3%.
Why is energy per token better than watts alone?
Watts measure a rate of energy use. They do not say how much work finished during that time. A 200-watt run can use less total energy than a 150-watt run if it finishes much sooner.
Tokens per second have the opposite gap. They say how fast output arrived, but not how much power the GPU drew to produce it. The fastest row can also be the least efficient row.
Joules per token join those two fields. The unit still does not say whether the answer was correct. I only compare rows after the task check passes. My earlier failed-row note shows why a fast row with a failed task stays out of production.
Can I turn this into electricity cost?
Yes, but I label the estimate. One million output tokens at 0.870 joules each equals 870,000 joules. Divide by 3.6 million joules per kilowatt-hour. The generation estimate is about 0.242 kWh.
The 512 row reaches about 0.298 kWh per million output tokens by the same method. That is a difference of about 0.056 kWh for the measured generation phase.
I do not call either number a full local inference cost. A full receipt also needs wall power, prompt work, load time, idle time, hardware cost, and the electricity rate. My local AI workbench note uses the same boundary when it converts one measured run into a rough electricity estimate.
When should I use this metric?
I use it after two rows pass the same task check. I keep the model, quant, runtime, workload, context, prompt, and output cap fixed. I also record the token counts so a later reader can see whether the runs did the same work.
Then I ask three questions. Did the task pass? Did the faster setting remove useful wait time? Did energy per output token improve or get worse?
For this workload, num_batch=256 is the better measured setting. It produced 98.7% of the 512 row's output rate while using less average GPU power and less energy per output token. That is a result for this RTX 5090 test, not a default for every model or GPU.
What should the benchmark receipt keep?
Keep the raw fields before the derived metric. Save the model, quant, runtime version, GPU, workload, context, output cap, input tokens, output tokens, output rate, average GPU power, and task result.
Calculate joules per output token from those saved values. Do not save only the rounded answer. The raw row lets another builder check the math and change the boundary.
Also name what the power sensor measured. GPU power is not wall power. A generation average is not a whole-request average. A clear label stops a small metric from becoming a large claim.
Accompanying prompt
What the prompt does: It calculates energy per output token from local LLM rows and rejects comparisons that lack a task check.
Copy/paste this prompt:
Copy-ready prompt
Paste the exact block into your coding agent.
No article chrome, no footnotes, no formatting drift.
This prompt and every other one we publish live in the free prompt library.
Copy the block above.
Get the next measured local AI build note from The 5090 Reports.
Get the Local AI Field Kit
Four copy-ready tools now, then one evidence-backed Local AI Lab Note on Friday when there is something worth sharing.
Get the requested artifact now, then at most one evidence-backed Local AI Lab Note on Friday when there is something worth sharing. One-click unsubscribe. No sponsored placements. Privacy.
Patrick Hughes
Building BMD HODL — a one-person AI-operated holding company. Nashville, Tennessee. Twenty-Two agents.
More writing
- 4 min
Why a Failed Local LLM Benchmark Row Still Matters
A failed local LLM row marks the test boundary. My RTX 5090 report shows why quality, speed, and settings belong in one receipt.
- 5 min
My local LLM eval hid four token caps
My 5090-rig eval uses four output caps: 50, 180, 192, and 256 tokens. A score without the cap is not a model result. Record the cap on every row.
- 5 min
The 26B Model Hit the Cap. The 8B Finished.
Same code task, same 512-token cap. Ollama's done_reason showed one local model finished and one got cut off. Tokens per second hid it.
- 5 min
How I Benchmark Local LLMs Before I Trust Them
A local LLM benchmark should end with a decision. I record task quality, tokens per second, VRAM, power, and failure state before I add a model.
- 5 min
How I Test a 30B Local Model Before I Load It
A 30B local model can fit on paper and still fail the job. This test plan checks memory, tool use, speed, and repeatability first.