Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tools/gsf/green-code-skill/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ For full detail on any pattern, the agent can fetch the URL.
- Use energy-efficient AI/ML models — match model size to task, routing pattern. → /architecture/technology-selection/energy-efficent-models
- Use serverless cloud services — FaaS, serverless containers, serverless databases. → /architecture/technology-selection/use-serverless

### Operations (1 pattern)

- Optimize power-performance for edge AI inference — power-aware scheduling, thermal-aware throttling, battery-level policies, DVFS; named modes (Performance/Balanced/Power Saver) calibrated from energy-latency-accuracy triplet. → /operations/optimize-edge-ai-power-performance

### Agentic AI patterns

Applied to LLM-driven orchestration, agentic loops, and tool-calling workflows. These patterns target the energy and emissions profile of agentic AI systems, where each loop iteration is a model call and call counts can compound rapidly across planning, retries, and tool invocations.
Expand Down
2 changes: 1 addition & 1 deletion tools/gsf/green-code-skill/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,5 @@ Inside this skill package:
- `references/sci-formula.md` — SCI grounding and what each SCI term represents
- `references/patterns-development.md` — 23 Development patterns with detection signals and fixes
- `references/patterns-architecture.md` — 17 Architecture patterns
- `references/patterns-ai-ml.md` — 9 AI/ML model and training patterns + 10 agentic AI workload patterns
- `references/patterns-ai-ml.md` — 10 AI/ML model and training patterns + 10 agentic AI workload patterns
- `references/trade-offs.md` — contextual considerations for applying patterns well
2 changes: 1 addition & 1 deletion tools/gsf/green-code-skill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The skill covers:

- **23 patterns from the GSF Development category** — data handling, media efficiency, web performance, cloud deployment
- **17 patterns from the GSF Architecture category** — system topology and technology selection
- **9 AI/ML model and training patterns** cross-referenced from the Development and Architecture categories
- **10 AI/ML model and training patterns** cross-referenced from the Development, Architecture, and Operations categories
- **10 agentic AI workload patterns** applying the same SCI principles to LLM-driven orchestration — model routing, retry budgets, planning depth caps, response and prompt caching, parallel tool calls, two-stage retrieval, structured output, `max_tokens` hygiene, and loop-safe tool calling

Choices this implementation made, documented so readers can evaluate them against their own context:
Expand Down
2 changes: 1 addition & 1 deletion tools/gsf/green-code-skill/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Detailed pattern entries (problem, detection signals, fix approach, SCI term, ca
|---|---|---|
| `references/patterns-development.md` | 23 Development patterns | Code-level: data handling, media, web performance, async, compression, TLS termination |
| `references/patterns-architecture.md` | 17 Architecture patterns | System-level: region selection, containers, serverless, statelessness, scaling |
| `references/patterns-ai-ml.md` | 9 AI/ML model and training patterns + 10 agentic AI workload patterns | Model selection, edge inference, agentic loops, LLM caching, retry budgets, planning depth |
| `references/patterns-ai-ml.md` | 10 AI/ML model and training patterns + 10 agentic AI workload patterns | Model selection, edge inference, agentic loops, LLM caching, retry budgets, planning depth |
| `references/sci-formula.md` | SCI specification primer | Whenever the user asks "how does this reduce carbon?" or wants the math |
| `references/trade-offs.md` | When NOT to apply a pattern | Always consult before applying anything aggressive |

Expand Down
9 changes: 9 additions & 0 deletions tools/gsf/green-code-skill/references/patterns-ai-ml.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ This file consolidates AI/ML patterns across two families: model and training pa
- **Trade-off:** Shifts M to client devices. Name this explicitly.
- **URL:** https://patterns.greensoftware.foundation/architecture/system-topology/energy-efficent-ai-edge

### Optimize power-performance for edge AI inference
- **Problem:** Edge AI deployment strategies optimize for accuracy and latency without treating power as a first-class metric, which drains batteries, triggers thermal throttling, and shortens device lifespan.
- **Detection signals:** Inference always run at peak frequency/precision regardless of battery level or temperature; no DVFS, thermal-aware throttling, or battery-tier policies; no linked energy/latency/accuracy measurement per model variant or power mode.
- **Fix:** Add power-aware workload scheduling (defer non-urgent inference, thermal-aware throttling, tiered battery-level policies, DVFS, placement across heterogeneous CPU/GPU/NPU/non-von-Neumann accelerators); expose a small set of named modes (Performance/Balanced/Power Saver) calibrated from the energy-latency-accuracy triplet rather than raw knobs; close the loop with fleet telemetry.
- **SCI:** Reduces E (operational energy, longer battery life) and M (fewer battery/device replacements from reduced thermal stress); can reduce I via time-shifting workloads to cleaner-grid or charging windows.
- **Trade-off:** Deferring or throttling inference adds latency; scheduling, mode calibration, and telemetry add engineering and testing complexity. Start with simple battery-tier policies before adaptive systems.
- **Pillar:** Energy efficiency, hardware efficiency.
- **URL:** https://patterns.greensoftware.foundation/operations/optimize-edge-ai-power-performance

### Select a more energy-efficient AI/ML framework
- **Problem:** Frameworks differ significantly in throughput per watt for the same model on the same hardware.
- **Detection signals:** Eager-mode PyTorch in production inference, no consideration of optimized runtimes.
Expand Down