# Green AI engineering

> Technical guides for developers and AI engineers on building AI that uses less energy, from design patterns to CI energy tests.

Source: https://greenai.guide/engineering/

For the people who build AI systems: design patterns, an energy-aware orchestration engine, energy tests in CI, CPU and GPU benchmarking, energy observability and the payback of AI-assisted optimisation. Each chapter has working example code and a source for every figure.

- [A catalogue of green AI design patterns](https://greenai.guide/engineering/design-patterns/): Eighteen named design patterns that cut the tokens, calls and energy of AI features, each with trade-offs, how to measure it and a code sketch.
- [How to add energy-efficiency testing to CI/CD](https://greenai.guide/engineering/ci-energy-testing/): How to test energy in CI: tokens per task, CPU time, RAPL and NVML counters, noise, budgets and regression gates, with a worked GitHub Actions example.
- [How to benchmark CPU versus GPU inference for energy](https://greenai.guide/engineering/cpu-vs-gpu-inference/): Compare CPU and GPU inference energy fairly: fixed prompts, a quality check, steady load levels, RAPL, NVML and wall meters, and a break-even point.
- [How to build AI energy observability](https://greenai.guide/engineering/energy-observability/): Record tokens, latency, energy and grid carbon for every AI request and agent step with OpenTelemetry, Prometheus and Kepler, and set energy budgets.
- [How to build an energy-aware AI orchestration engine](https://greenai.guide/engineering/orchestration-engine/): Architecture and a Python reference sketch for an AI orchestration engine that routes, caches, budgets and accounts for tokens and estimated energy.
- [How to calculate the energy payback of AI-optimised code](https://greenai.guide/engineering/energy-payback/): Does the energy spent using AI to write or optimise code come back as run-time savings? The formula, published inputs, a worked example and a calculator.
