Inspiring Vision • Creative Connection • Transformational Action

Adora Foundation LLM Propmpt Optimization Handbook & Toolkit

Ecodesign principles, decision frameworks, and governance models for energy-aware AI systems.

Summary & Navigation

Part 1 – The Handbook Handbook

This handbook sets out Adora Foundation’s ecodesign principles for LLM-powered systems. It is written for technologists building, integrating or governing AI features who want to minimise environmental impact while retaining strong user value.

1. Core Ecodesign Principles for LLM Applications

Principle 1 — Rightsize Your Models

Match model complexity, architecture, and specialisation to the task. Larger models are not automatically better, and smaller models are not automatically greener: fit-for-purpose is the goal.

  • Separate dimensions clearly: size (SLM vs LLM), generalist vs specialist, dense vs MoE, cloud vs self-hosted.
  • Task analysis first: define accuracy, latency, safety, and cost thresholds per use case.
  • Benchmark energy per 1,000 tokens (e-tokens) alongside accuracy using standard prompt sets.
  • Orchestration by default: assume you will use multiple models, not a single monolith.
DistilBERT and MobileBERT achieve ~95% of BERT’s performance at ~40% of its energy cost. GPT-2 can consume 5–10× less energy per simple task than frontier-scale models.
Principle 2 — Make LLM Calls a Last Resort

Every token has a carbon cost. Use classical code and ML wherever you can, and reserve LLMs for tasks that genuinely require advanced language modelling.

Decision hierarchy for each request

  1. Rule-based logic, SQL, APIs (≈0.001–0.1 J)
  2. Traditional ML (e.g., scikit-learn, XGBoost)
  3. Keyword or semantic search
  4. Small generalist or specialist model (<10B params)
  5. Large or frontier model (>70B params)
  6. Agentic chains only when justified and governed

Token accounting rule

Measure total tokens per model: user input, system prompts, context, rules, tool I/O, agent hand-offs, reasoning traces, final answer. Optimise to reduce the total, not just the average.

Principle 3 — Optimise Context Windows Aggressively

Context size grows energy use roughly linearly, but model quality gains often plateau quickly. Only send what the model genuinely needs.

  • 50% rule: never exceed 50% of context capacity unless long-document reasoning is essential.
  • Prefer “new chat per topic” with memory augmentation rather than mega-threads.
  • Use dynamic relevance pruning and chunk overlap <20% for RAG corpora.
  • Load tool descriptions and schemas lazily (e.g., MCP tools), not on every request.

In MCP-based stacks, much of the bloat comes from tool metadata rather than user prompts. Use a tool broker (such as the ToolHive MCP Optimizer) that lets the model first search for relevant tools via find_tool, then call only that short list via call_tool. This progressive discovery pattern routinely cuts tool tokens by 60–80% in real-world GitHub/Grafana/Notion workflows.

Principle 4 — Tier Your Memory Architecture

Choose the lightest viable memory pattern for the data and query pattern:

Tier Technique Energy Profile Best For
1 Direct DB / API Very low Structured data, metadata, analytics
2 Simple indexing Low Codebases, small and static datasets
3 Semantic search Medium Mixed data, small to medium text corpora
4 RAG (vector / hybrid) Medium–high Large, evolving document sets
5 CAG (cache-augmented generation) Low–medium Small static datasets with high repeat queries
6 Full context Very high Novel long-text reasoning only

Distillation, summarisation and quantisation are powerful tools, but their up-front training and compute costs must be amortised across expected lifetime use.

Principle 5 — Maintain Green Software Hygiene

LLM efficiency multiplies when combined with traditional green-software practices:

  • Schedule batch jobs for low-carbon hours (e.g., renewable peaks).
  • Autoscale to zero; avoid long-running idle instances.
  • Use efficient codecs, compression and HTTP caching.
  • Regularly optimise non-LLM code paths—every 10% baseline gain compounds.
Principle 6 — Govern Agentic Architectures Strictly

Multi-agent systems can be powerful, but their chained calls amplify token use and external tool emissions.

  • Impose hard limits on agent hand-offs (e.g., ≤4 per request).
  • Limit tool invocations and avoid agent loops.
  • Make orchestrator agents responsible for minimising total tokens and emissions.
Principle 7 — Measure, Budget and Review Carbon & Tokens

Token counts and energy per 1,000 tokens (e-tokens) are first-class metrics, not incidental telemetry. Every LLM feature must have a defined emission budget and monitoring plan.

Use emission budgeting to align query volume, model choice, and hardware with science-based targets.

2. Hardware & Infrastructure Selection Framework

Hardware choices influence the energy profile of LLM inference as much as the model itself. Adora distinguishes between GPUs, TPUs, LPUs and optimised GPU serving stacks.

2.1 Hardware decision matrix

Use case GPU (H100) TPU v5e Groq LPU Recommendation
High-throughput batch Good Excellent Excellent TPU v5e for energy; LPU for latency
Real-time low-latency Moderate Good Excellent LPU if available
Multimodal models Excellent Moderate Poor GPU for ecosystem maturity
Small model serving (<1B) Poor Good Excellent LPU or CPU depending on workload
Cost-constrained startup Moderate Limited access Limited Cloud GPUs + vLLM optimisation

2.2 Cloud vs on-premise

  • Cloud: lower volume (<10K/day), small teams, fast iteration, higher-carbon grids.
  • On-premise: high sustained volume (>100K/day), access to low-carbon power, strong data-sovereignty needs.
  • Hybrid: on-prem baseline load plus cloud bursting to retain >60% average utilisation.

3. Memory Augmentation Deep Dive

Retrieval and caching choices shape both user experience and environmental impact.

3.1 RAG vs CAG

RAG (Retrieval-Augmented Generation) excels for large, evolving knowledge bases. CAG (Cache-Augmented Generation) shines where queries repeat heavily and answers change rarely.

Hybrid patterns use RAG for discovery while caching high-traffic answers as CAG entries.

3.2 RAG data sanitisation

  • Deduplicate; remove navigation, boilerplate and low-value content.
  • Apply consistent chunking and metadata tagging (source, date, access level).
  • Discard the least relevant 20–30% of chunks before indexing.

4. Prompt Engineering for Sustainability

Prompt design is a powerful lever for token and energy reduction.

  • Set explicit max_tokens, temperature and top_p limits.
  • Discourage or rewrite “be verbose / explain in detail / step by step” prompts.
  • Prefer short, structured outputs (JSON, enums) over freeform narrative where possible.
  • Use chain-of-thought only when necessary; otherwise return concise answers.

5. Governance, Budgets & Rebound Effects

Every LLM feature should have an emissions budget, monitoring plan and rebound assessment. Governance is how ecodesign moves from intent to practice.

  • Set per-application CO2 budgets and query-volume caps.
  • Monitor daily/weekly energy per 1,000 tokens (e-tokens) and adjust routing, caching and model choice.
  • Explicitly evaluate rebound effects: does the feature increase overall consumption elsewhere?

Part 2 – The Toolkit Toolkit

All resources below are designed to be copied directly into your repositories, docs or governance portals. You can also extract them as separate files for download.

A1. Model Selection Decision Tree Click to expand
Copy this into architecture docs or share as a diagram. It encodes the “LLM as last resort” and rightsizing principles.
Copyable text (PlantUML-style decision tree):
START: New LLM Feature Request

1. Is the task deterministic / structured (CRUD, lookups, simple transforms)?
   - YES → Use code / SQL / APIs / regex (0.001–0.1 J). END.
   - NO  → Go to 2.

2. Can traditional ML (non-LLM) meet requirements?
   - YES → Use classifier / regressor / rules. END.
   - NO  → Go to 3.

3. Is the domain narrow and stable?
   - YES → Prefer specialist or distilled model (2–13B) with small context.
   - NO  → Go to 4.

4. Task complexity:
   - Simple Q&A, extraction, summarisation:
       → Use small generalist model (≤7B).
   - Multi-step reasoning, fuzzy or cross-domain tasks:
       → Use 13–70B model, with RAG if needed.
   - Very complex reasoning and creativity:
       → Use frontier model (e.g., GPT-4, Claude opus) with strict token budgets.

5. Traffic volume:
   - <10K queries/day:
       → Use managed cloud API, aggressive caching, and emission budgets.
   - 10K–100K queries/day:
       → Consider self-hosting 13B–70B on TPU/LPU.
   - >100K queries/day:
       → Distilled / fine-tuned model + model cascading.

Ensure non-LLM approaches are attempted before any LLM call.
A2. LLM Application Ecodesign Checklist Click to expand
Use this checklist at design reviews. You can paste it into issue templates or pull-request templates.
A3. Architectural Decision Record (ADR) Template – Sustainability Edition Click to expand
Markdown template:
A4. Model Selection Matrix Click to expand

Use this table in internal docs or spreadsheets to compare candidate models. Values are illustrative; replace with your own benchmarks.

Model Params Energy / 1,000 tokens (J) Typical latency (ms) Best use case
DistilBERT-base 66M 2–5 ≈15 Classification, NER, routing
MobileBERT 25M 1–3 ≈10 Edge/mobile NLP
Mistral-7B 7B 40–50 ≈80 General Q&A, summarisation
Llama 2–13B 13B 80–100 ≈120 Balanced tasks
Llama 2–70B 70B 200–300 ≈250 Complex reasoning & synthesis
Frontier API (e.g., GPT-4) Large 400–600 ≈500 Highest-complexity use cases
A5. LLM Governance Policy – Sustainability Mandate Click to expand
A6. Agentic Architecture Governance Spec (YAML) Click to expand
A7. Prompt Injection Security + Efficiency Gateway Click to expand
A8. Continuous Monitoring Dashboard Spec Click to expand
A9. Implementation Roadmap & Success Metrics Click to expand

Tip: to make resources directly downloadable, save each textarea block into its own .md, .yaml or .json file and expose them via links in your documentation site or repository.