-
-
EcoGuard PlanetOps — Intelligence for a Healthier Planet, powered by sustainable AI innovation.
-
EcoGuard achieves 64.6% lower CPU time while estimating 65% lower energy consumption per pipeline run.
-
EcoGuard identifies six computational inefficiencies, automatically fixing two and recommending further optimizations.
-
EcoGuard eliminates repeated ML feature extraction and introduces caching through a reviewable GitLab merge request.
-
GitLab CI/CD successfully completes testing, analysis, independent verification, and environmental reporting.
-
EcoGuard's GitLab Duo agent completes an autonomous optimization workflow, and identifies six computational inefficiencies.
-
EcoGuard verifies a 64.6% reduction in CPU time, preserves model accuracy, and reports estimated energy and carbon savings.
Inspiration
Every AI model we train and every software pipeline we execute consumes computational resources. But what happens when that energy is spent repeating work that has already been completed?
Machine learning pipelines frequently recompute the same features across hyperparameter searches, training stages, and CI/CD runs. The software produces correct results, so the inefficiency can go unnoticed.
I wanted to challenge the idea that successful software is automatically efficient software.
That inspired EcoGuard PlanetOps, an AI-powered sustainability engineer that treats wasted computation as a software defect—one that can be detected, corrected, and verified.
My goal was to make environmental responsibility a measurable part of software engineering rather than an optional afterthought.
What it does
EcoGuard PlanetOps is a supervised, multi-agent sustainability optimization system built on the GitLab Duo Agent Platform.
It identifies computational inefficiencies in machine learning workflows, generates safe optimizations, independently verifies the changes, and presents the results for human approval.
1. Intelligent waste detection
An analyst agent inspects Python machine learning code and GitLab CI/CD configurations to identify:
- Repeated feature extraction and preprocessing.
- Loop-invariant computations.
- Duplicate CI jobs.
- Unnecessary dependency installations.
- Redundant model-training operations.
2. Autonomous optimization
An engineer agent proposes source-preserving improvements, including moving redundant operations outside loops and implementing content-addressed feature caching.
The agent benchmarks its proposed improvements against the original code using comparable execution conditions.
3. Independent verification
GitLab CI/CD independently validates the proposed changes through automated tests, reproducibility checks, security scans, and environmental impact reporting.
Changes are recommended only when model accuracy, prediction equivalence, security, and reproducibility requirements are satisfied.
4. Human-supervised approval
EcoGuard opens a reviewable merge request containing the proposed code changes and environmental report.
A human developer makes the final approval and merge decision. The agent cannot merge its own changes.
This creates a complete workflow from computational waste detection to verified optimization without sacrificing human control.
Environmental impact
I wanted EcoGuard to demonstrate environmental improvements rather than simply claim them.
In its GitLab-hosted demonstration, EcoGuard achieved:
- 64.7% less CPU execution time on the optimized pipeline.
- Approximately 86% less CPU time on repeat executions benefiting from caching.
- Unchanged model accuracy of 94.25%.
- Byte-identical predictions and evaluation outputs.
- All 8 verification checks passed.
Software Carbon Intensity methodology
The environmental assessment follows principles from the Green Software Foundation's Software Carbon Intensity (SCI) methodology.
$$ SCI = \frac{(E \times I) + M}{R} $$
Where:
- (E) = Energy consumed, measured in kilowatt-hours.
- (I) = Carbon intensity of electricity, measured in grams of CO₂ equivalent per kilowatt-hour.
- (M) = Embodied hardware emissions.
- (R) = Functional unit, defined as one training-pipeline execution.
Because direct hardware energy measurements and attributable embodied-emissions data were unavailable on the shared runner, EcoGuard estimates operational electricity consumption and associated emissions using documented assumptions.
The estimated electricity consumption is:
$$ E = \frac{\left(t \cdot n \cdot W_{\min} + t_{\mathrm{cpu}}(W_{\max}-W_{\min}) + t \cdot m \cdot 0.392\right)\cdot \mathrm{PUE}}{3.6 \times 10^6} $$
Here, (t) is wall-clock time, (t_{\mathrm{cpu}}) is CPU time, (n) is the number of virtual CPUs, and (m) is memory consumption in GB. The power coefficients and PUE assumptions are documented in the project methodology.
For the emissions estimate, EcoGuard uses:
$$ I = 480\ \mathrm{gCO_2e/kWh} $$
This is the historical global-average electricity carbon-intensity factor selected for the demonstration.
Because embodied emissions are excluded, these calculations represent estimated operational emissions, not a complete lifecycle SCI score.
Verified benchmark results
The GitLab-hosted verification pipeline produced the following results:
| Metric | Baseline | Optimized | Change |
|---|---|---|---|
| CPU time per run | 15.72 s | 5.55 s | −64.7% |
| Wall time per run | 14.61 s | 4.93 s | −66% |
| Repeat-run CPU time | 15.72 s | 2.26 s | −86% |
| Estimated energy | 0.024 Wh | 0.0083 Wh | −65% |
| Estimated operational CO₂e | 0.011 g | 0.004 g | −65% |
The system clearly distinguishes between:
- Measured: Execution time, resource usage, and verification results.
- Estimated: Electricity use and operational emissions calculated from documented assumptions.
- Projected: Potential savings from repeated future executions.
At 100,000 comparable executions, the model projects approximately 1.5 kWh of electricity and 0.7 kg CO₂e avoided.
The demonstration intentionally uses a small ML workload to keep verification practical within GitLab CI. The absolute emissions savings are modest, but the underlying inefficiency can also occur in larger production pipelines.
EcoGuard never assumes that runtime reduction automatically equals equivalent energy reduction and does not claim unmeasured water savings.
How I built it
I developed EcoGuard PlanetOps using:
- Python 3.12 for the optimization and analysis engine.
- scikit-learn and NumPy for the demonstration machine learning pipeline.
- Python AST for identifying inefficiencies and implementing targeted source transformations.
- PyYAML for configuration analysis.
- pytest for automated correctness testing.
- Bandit for Python security analysis.
- Linux
wait4for process resource measurements. - GitLab Duo Agent Platform for orchestrating the analyst and engineer agents.
- GitLab CI/CD for independent verification and report generation.
- GitLab SAST and Secret Detection for additional security validation.
Multi-agent architecture
The implementation uses a custom GitLab Duo Agent Platform flow with two specialized agents.
Analyst Agent
Inspects machine learning code and CI/CD configuration, identifies redundant computations, and produces findings for optimization.
Engineer Agent
Applies safe code transformations, performs comparative benchmarks, validates correctness, and creates a merge request for human review.
Both agents operate within a workflow that prioritizes reproducibility, accountability, and safe optimization.
The final output is an environmental impact report containing benchmark results, verification checks, assumptions, and an approval recommendation.
Challenges I ran into
One of the most important lessons came from EcoGuard's first optimization attempt.
When the agent re-examined its own results, it discovered that the verification numbers were inconsistent.
Rather than recommending approval, EcoGuard flagged the discrepancy and advised against merging the change.
The underlying issue came from a problem in the test fixtures, which I corrected before running the optimization again.
That experience reinforced an important design principle:
A trustworthy AI agent should be able to recognize uncertainty and reject its own recommendations.
The other major challenge was making scientifically defensible environmental claims.
Runtime reduction does not automatically establish equivalent energy savings, and estimated energy consumption is not the same as directly measured electricity use.
I addressed this by separating measured, estimated, and projected results and documenting the assumptions behind the environmental calculations.
Accomplishments I'm proud of
My biggest accomplishment is taking EcoGuard from an environmental software concept to a functioning GitLab-integrated engineering demonstration.
I'm particularly proud that:
- I built a functioning supervised multi-agent workflow using GitLab Duo.
- The system generated a reviewable optimization through a real GitLab merge request.
- Independent verification demonstrated 64.7% less CPU execution time without sacrificing model accuracy.
- The verification system rejected unreliable results instead of presenting misleading claims.
- All 8 verification checks passed.
- Every environmental metric is accompanied by its measurement classification and relevant assumptions.
Most importantly, EcoGuard demonstrates that environmental efficiency can become an active, testable part of the software development lifecycle.
What I learned
This project changed how I think about software performance and sustainability.
Runtime is not energy. Energy is not carbon. And optimization is not automatically environmental progress.
Each conclusion requires appropriate measurements, models, and assumptions.
I also learned that agentic AI becomes more useful when it can execute complex workflows while remaining accountable to automated verification and human review.
Building responsible AI means designing systems that can explain what they changed, demonstrate why the change matters, and recognize when the evidence is insufficient.
What's next for EcoGuard PlanetOps
My long-term vision is to extend EcoGuard beyond individual machine learning pipelines into a comprehensive environmental optimization platform for software and AI infrastructure.
Future development will focus on:
- GPU-aware optimization: Measuring and reducing unnecessary resource consumption during AI model training.
- Intelligent retraining prevention: Avoiding training runs when model inputs have not changed.
- Artifact reuse: Sharing reusable intermediate results across CI/CD jobs.
- Carbon-aware scheduling: Executing flexible workloads when electricity is less carbon-intensive.
- Organization-wide optimization: Identifying computational waste across multiple GitLab repositories.
- Improved emissions accounting: Integrating direct hardware and infrastructure telemetry.
Ultimately, I want EcoGuard to help developers consider computational efficiency and environmental responsibility as fundamental software quality requirements.
The future of software engineering shouldn't only be about making code work. It should also be about making it work responsibly.
Links
GitLab Repository: EcoGuard PlanetOps
Agent-Generated Merge Request: Merge Request !2
Verification Pipeline: GitLab Pipeline #2992919379
Built With
- bandit
- gitlab
- gitlab-ci
- gitlab-duo-agent-platform
- gitlab-sast
- green-software-foundation
- numpy
- pytest
- python
- pyyaml
- scikit-learn
Log in or sign up for Devpost to join the conversation.