In short
For developers, green AI means building AI features that do the job with fewer tokens, fewer calls and smaller models. Most of the energy is set by a handful of design choices: which model handles each request, how much context each call carries, whether reasoning and agents are used only where they help, and how a self-hosted model is served. Log tokens per successful task from the start, because that is the number you can see and change.
Key points
- Energy per request rises with the tokens a model reads and writes: Epoch AI estimates a typical ChatGPT query at about 0.3 Wh, rising to about 2.5 Wh with a 10,000-token input.
- Hugging Face's AI Energy Score team found that reasoning models used, on average, 30 times more energy than models without reasoning.
- Anthropic reported that its agents typically used about four times the tokens of a chat, and multi-agent systems about fifteen times.
- Route routine requests to small models and escalate only the hard ones; measure cost and energy per successful task, not per call.
- Tokens per task are a good everyday proxy for energy; use EcoLogits for hosted APIs and CodeCarbon for hardware you run.
Why should developers care about green AI?
Because developers set most of the energy an AI feature will use. The model, the size of each prompt and the number of calls per user action are decided in code, and repeat on every request for as long as the feature runs.
The green choice and the good engineering choice are usually the same: fewer tokens mean lower latency and cost, and smaller models are faster. Green AI is about using AI where it adds value, without wasted work. A 2026 UK green AI sandpit of mathematicians, computer scientists and industry made the same point: efficiency has to come with cost, speed and quality, not compete with them.
This guide is about AI features in software. If you are building AI into a game, see green AI for game developers; if your users generate images, video or music, the guides for artists and creatives, screen production, music and advertising and publishing cover the habits on their side.
Where does the energy go in an AI feature?
Almost all of it goes on inference: the model reading your input and generating output, on every call. What you control is how much work each call asks for and how many calls you make.
- Tokens in and out. Energy rises with the tokens a model processes. Epoch AI estimates a typical ChatGPT query at about 0.3 Wh, rising to about 2.5 Wh with a 10,000-token input and almost 40 Wh with a 100,000-token input. Long context is the quiet cost in many features.
- Model size. Bigger models do more computation per token. Luccioni, Jernite and Strubell found multi-purpose generative models to be orders of magnitude more expensive to run than task-specific systems for the same task.
- Reasoning modes. "Thinking" models write long hidden chains of working. Hugging Face's AI Energy Score team found that reasoning models used, on average, 30 times more energy than models without reasoning, and that the same model used between 150 and 700 times more energy with reasoning switched on.
- Agents and retries. Anthropic reported that its agents typically used about four times the tokens of a chat, and multi-agent systems about fifteen times. Every retry, validation loop and failed tool call adds more.
- Images and video. In tests of open models by Luccioni, Jernite and Strubell, generating images used on average about 2.9 kWh per 1,000 images, against 0.002 kWh per 1,000 text classifications. Video is heavier again: one short clip from an open model used about 90 Wh in Delavande, Pierrard and Luccioni's tests.
For scale, Google reports that a median Gemini Apps text prompt used 0.24 Wh, and that this fell 33-fold over one year. Providers measure in different ways, so treat any single figure as indicative; see how much energy does AI use?.
How do I choose and route models?
Start with the smallest model, or the simplest non-AI method, that passes your evaluation set, and escalate only the requests that need more. Classification, extraction, tagging and short summaries rarely need a frontier model.
UNESCO and University College London found that smaller models fine-tuned for specific applications could cut energy use by up to 90% while keeping high accuracy on suitable tasks.
- Build an evaluation set of real requests with a pass mark. Without it you cannot choose or prove anything.
- Test small to large and stop at the first model that meets the bar. Check whether a classical method will do or a task-specific model exists.
- Route. Use rules, a difficulty classifier or a cascade that tries a small model first and escalates when a check fails. The RouteLLM study reported cost reductions of more than half in some cases without lowering response quality.
- Turn reasoning on per request, not globally. See when to use reasoning modes.
- Measure per successful task. A failed small-model attempt plus an escalation can cost more than going straight to the large model.
There is more in choose the right model and how to set up model routing. Hugging Face's AI Energy Score rates AI models from one to five stars for energy efficiency, compared with other models tested on the same task, based on GPU energy per 1,000 queries, which helps when shortlisting.
How do I make prompts and context efficient?
Send less, reuse what you can, and ask for exactly the output you need. These changes are cheap to make and pay back on every call. UNESCO and UCL found that shorter prompts and responses could cut energy use by over 50%.
- Use prompt caching. Put stable content (system prompt, tool definitions, reference documents) first and the changing part last. Anthropic prices cache reads at a tenth of the normal input price or less, depending on the model, with a five-minute default lifetime. OpenAI turns prompt caching on by default for supported models. Both need an identical prefix, so a timestamp at the top breaks the cache. See how to use caching.
- Cache responses yourself for identical requests, with an expiry that matches how fast the answer goes stale.
- Trim context. Don't resend whole conversations, logs or documents on every turn; summarise or drop old history. See how to stop resending the whole conversation.
- Constrain output. Set a maximum output length and ask for structured output (JSON with a schema) rather than prose you then parse. See how to limit how much an LLM writes.
- Batch work that can wait. Offline jobs such as tagging an archive can go through a provider's batch interface or your own queue. See how to batch AI requests.
- Don't run when nobody asked. Generate on demand, not on every page load or keystroke; see designing AI features that don't run needlessly.
How do I stop agents wasting tokens?
Give every agent a testable goal that ends the run, hard limits on steps, tokens and spend, and loop detection. Each call usually carries the growing history of the task.
Cemri and colleagues analysed more than 1,600 annotated traces from seven multi-agent frameworks and identified 14 distinct failure modes, from poor task specification to agents not verifying their work. Each is a way to spend tokens without getting a result.
- Stop when the goal is met. The Green Software Foundation's agent orchestration pattern advises halting agent loops when goals are achieved rather than running fixed iterations.
- Set hard caps. The OpenAI Agents SDK, for example, has a
max_turnssetting that raises an error when a run exceeds it. Make limits fail loudly: stop and report, don't silently retry. - Pick the least elaborate design that works: a script, then one call with tools, then one agent, and multiple agents only for broad, genuinely parallel tasks. Use plain code where a rule will do. The sandpit flagged agents trapping themselves in loops as a real and under-studied source of waste.
See how to stop AI agents wasting tokens and agentic AI and token waste.
How do I make RAG and embeddings efficient?
Retrieval should make the model read less, not more. Retrieve a few short, relevant passages, use an approximate nearest-neighbour index rather than brute-force comparison, and re-embed only content that has changed.
- Retrieve less, better. Good chunking, metadata filters and a reranking step let three short passages do the work of fifteen long ones. Oversized context is the main cost.
- Right-size the embedding model. Test a small one against a large one on your own retrieval set; measure retrieval quality separately from answer quality.
- Index incrementally. Don't rebuild the whole store nightly when a few documents changed.
- Then shrink the generator. With good context, a smaller generation model often answers just as well.
For facts that change, retrieval usually beats retraining; see RAG or fine-tuning?, making RAG more efficient and, if you do fine-tune, fine-tuning with less compute.
What if I serve models myself?
Serve the smallest model that meets your bar, on an inference engine with continuous batching, in half precision or a tested quantised format, on hardware sized to the model, and scale down when traffic drops. An accelerator serving one request at a time is underused but still drawing power.
- Batching. Kwon and colleagues reported that vLLM, with PagedAttention managing the KV cache, improved throughput 2 to 4 times at the same latency compared with earlier serving systems.
- Quantisation. Hugging Face's documentation gives Mistral-7B as needing 13.74 GB in half precision and 6.87 GB in 8 bits, which can mean fewer or smaller GPUs. UNESCO and UCL report that compression such as quantisation can save up to 44% of energy. Hugging Face also notes it can add a little latency, so test. See how to quantise a model.
- Optimised code paths. Hugging Face documents a static KV cache combined with
torch.compilefor up to a 4x speed-up, depending on model size and hardware. - Speculative decoding. A small draft model proposes tokens the large model checks. Leviathan, Kalman and Matias reported a 2 to 3 times speed-up on T5-XXL with identical outputs. See how to use speculative decoding.
- Right-sized hardware, no idle replicas. Benchmark GPU types and runtimes at real batch sizes and pick on energy per request as well as latency. See how to stop GPUs sitting idle and choosing energy-efficient hardware.
- Carbon-aware scheduling. Run batch inference, evaluation and fine-tuning when and where the grid is cleaner. CATS, an open-source scheduler, starts jobs when forecast grid carbon intensity is lowest, using National Grid data in Great Britain or European data elsewhere. See how to pick a low-carbon cloud region.
The full toolkit is in efficient training and inference and how to cut the energy of serving a model.
How do I measure the energy of AI features?
Log tokens and calls per successful task for every feature, estimate energy from them, and meter hardware you run. Tokens are the everyday proxy.
- Hosted APIs. CodeCarbon's own guidance is to use CodeCarbon for code on hardware you control and EcoLogits for calls to remote generative AI services. EcoLogits wraps common provider clients and estimates energy and emissions per request. Label these as estimates. See how to estimate the energy of API calls.
- Your own hardware. Add CodeCarbon to inference and training scripts. Be aware of telemetry limits: Yang and
colleagues found that on A100 and H100 GPUs,
nvidia-smisamples only 25% of the runtime for power, which can lead to large under- or over-estimates for short jobs. - Provider figures. Ask your provider for energy per request and the method behind it; see how to ask an AI company for its energy figures.
- A functional unit. The Green Software Foundation's Software Carbon Intensity specification expresses carbon as a rate per functional unit, such as per API call or per user. See how to calculate an SCI score for an AI feature.
- Budgets in CI. Fail the build when a representative task goes over its token or call budget. This catches prompt bloat, extra agent steps and accidental reasoning before production.
More in how to measure AI energy and tracking energy per task.
What about my own AI coding assistant?
Coding assistants have a footprint of their own, so use them where they clearly save time and keep what they read small. Cheung and colleagues compared manual and GPT-4-assisted development on 12 programming tasks and found the AI-assisted approach had about 33 times the carbon footprint of the manual one (32.72 times on average, ranging from 19.92 to 43.81 times), with the gap growing as tasks got harder. That is one study with one model, but habits matter.
- Focus the context. Point the assistant at the relevant files, not the whole repository, and start a new session for a new task.
- Right-size the model. Use a small, fast model for completions, renames and boilerplate; keep the large one for design and hard debugging.
- Limit agent modes. Give a clear goal, a stop condition and a step limit; don't leave an agent to "fix the tests" in an open loop.
- Review in small steps, and check the efficiency of what it writes.
See using a coding assistant with a smaller footprint.
How do I write honest claims in product docs?
Claim only what you have measured, say how, and give the baseline and the boundary. "Energy per summary fell by a stated amount between version 2 and version 3, measured with a named tool on a named workload" is a claim; "green AI" or "eco-friendly AI" is not.
- State the method (measured or estimated, tool and version), the boundary (accelerator only, or the whole server and data centre) and a unit users understand, such as per request or per document.
- Separate efficiency from total use. Cheaper features tend to be used more, which is the rebound effect.
- Don't present a provider's self-reported figure as comparable with another's, and don't net off offsets silently.
See honest green claims and how to make honest claims about green AI.
What to do next
- Log tokens, calls and model for every AI request, tagged by feature, and compute tokens per successful task.
- Build an evaluation set for your highest-volume feature and test whether a smaller model passes it.
- Turn on prompt caching and move stable content to the front of your prompts.
- Cap output length and switch reasoning on only for the requests that need it.
- Put a stop condition and hard limits on every agent before it reaches production.
- Add a token budget test to CI for a handful of representative tasks.
- If you self-host, benchmark your serving stack with batching and a quantised model at real traffic, and scale to zero when idle.
- Check your product copy against the honest claims guide, and look for training in the courses directory and tools in the products directory.
Frequently asked questions
How much energy does an LLM API call use?
It depends on the model, the tokens in and out, and the provider's hardware, and most providers don't publish per-call figures. Google reports 0.24 Wh for a median Gemini Apps text prompt, and Epoch AI estimates about 0.3 Wh for a typical ChatGPT query, rising steeply with long inputs. For your own calls, log tokens and estimate with a tool such as EcoLogits.
Does prompt caching save energy as well as money?
Yes. A cache hit reuses the processing of a prompt prefix the provider has already done, so less computation is needed, which is why providers charge less for cached input. Put stable instructions and documents first and the changing part last, because caching works only on an identical prefix.
Is it greener to self-host an open model than to call an API?
Not automatically. A large provider can keep accelerators busy with batched traffic, while a self-hosted GPU serving a few requests at a time still draws substantial power. Self-hosting is greener when the model is small enough, traffic is steady enough to batch, and you scale down when demand drops.
Do AI coding assistants have a large carbon footprint?
They can. One study using GPT-4 on 12 programming tasks found AI-assisted development had about 33 times the carbon footprint of writing the code by hand (32.72 times on average, ranging from 19.92 to 43.81). Use assistants where they save real time, keep the context focused and put limits on agent modes.
How can I test AI energy use in CI?
Run a fixed set of representative tasks in your test suite, count the tokens and calls each one uses, and fail the build when a task exceeds its budget. Tokens are a stable, cheap proxy; add an energy estimate from EcoLogits or CodeCarbon if you want a figure in Wh.
Sources
- How much energy does ChatGPT use?, Epoch AI (2025)
- Measuring the environmental impact of delivering AI at Google scale, Elsworth et al., Google (2025)
- Power Hungry Processing: Watts Driving the Cost of AI Deployment?, Luccioni, Jernite and Strubell, ACM FAccT (2024)
- AI Energy Score v2: refreshed leaderboard, now with reasoning, Luccioni and Gamazaychikov, Hugging Face (2025)
- AI Energy Score, Hugging Face (2025)
- How we built our multi-agent research system, Anthropic (2025)
- Why do multi-agent LLM systems fail?, Cemri et al. (2025)
- Running agents (max_turns), OpenAI Agents SDK documentation (2025)
- Optimize agent orchestration to reduce unnecessary model calls, Green Software Foundation, Green Software Patterns (2025)
- Smarter, smaller, stronger: resource-efficient generative AI and the future of digital transformation, UNESCO and University College London (2025)
- RouteLLM: learning to route LLMs with preference data, Ong et al., ICLR 2025 (2024)
- Prompt caching, Anthropic, Claude platform documentation (2026)
- Prompt caching, OpenAI API documentation (2026)
- Efficient Memory Management for Large Language Model Serving with PagedAttention, Kwon et al. (arXiv 2309.06180) (2023)
- Optimizing inference, Hugging Face Transformers documentation (2026)
- Fast inference from transformers via speculative decoding, Leviathan, Kalman and Matias, ICML 2023 (2022)
- CATS: Climate-Aware Task Scheduler, GreenScheduler (2025)
- Part-time power measurements: nvidia-smi's lack of attention, Yang et al. (arXiv 2312.02741) (2023)
- When to use CodeCarbon, CodeCarbon (2025)
- EcoLogits documentation, EcoLogits (2025)
- Software Carbon Intensity (SCI) specification, Green Software Foundation (2024)
- Video killed the energy budget: characterizing the latency and power regimes of open text-to-video models, Delavande, Pierrard and Luccioni (arXiv 2509.19222) (2025)
- Comparative analysis of carbon footprint in manual vs. LLM-assisted code development, Cheung, Kaul, Jahangirova, Mousavi and Zie, ResponsibleSE 2025 (ACM) (2025)
Related
Choose the right model for the job
How to right-size AI: when to use small or specialised models, when a frontier model earns its cost, how routing works, and when not to use AI.
Efficient AI training and inference
Techniques for developers and researchers to cut AI energy: pruning, sparsity, quantisation, distillation, KV cache, batching, mixed precision and scheduling.
How to measure the energy and carbon of AI
A practical guide to metering or estimating the energy and carbon of AI work: tools, system boundaries, per-task metrics and honest uncertainty.
Agentic AI and token waste
Why AI agents can use many times the tokens and energy of a chat, how loops waste them, and the guardrails that keep agents right-sized.