Inspiration

Modern software development increasingly relies on AI tools like GitLab Duo to accelerate coding. However, this introduces a hidden cost — increased computational energy usage and environmental impact.

We were inspired by a simple question:

“Can we use AI to build software faster while also making it more sustainable?”

This led us to design a system that not only leverages AI for development tasks but also measures, understands, and reduces the environmental footprint of those activities.

What it does

We built a multi-agent, sustainability-aware CI/CD pipeline on GitLab that:

Uses AI (GitLab Duo) to generate unit tests for Vue.js components Optimizes tests by removing redundancy and improving efficiency Executes tests and captures runtime metrics Estimates carbon footprint based on execution time Provides actionable insights to reduce compute and energy usage Workflow

Developer → AI Test Generation → Optimization → Test Execution → Carbon Analysis → Insights

Carbon Estimation Model

Energy (kWh):

E = (Execution Time (s) × Power (W)) / (1000 × 3600)

CO₂ (kg):

CO₂ = E × Carbon Intensity

How we built it

We implemented a multi-agent orchestration using GitLab CI/CD:

  1. Test Generation Agent (LLM-based, human-in-the-loop) Used GitLab Duo (Claude under the hood) Generated Vue.js unit tests using prompts
  2. Optimization Agent (Deterministic) Removes duplicate or inefficient tests Reduces unnecessary compute
  3. Execution Agent (Deterministic) Runs tests using Vitest Generates report.json
  4. Sustainability Agent (Deterministic) Calculates CO₂ emissions from execution time
  5. Insights Agent (Deterministic / extensible) Analyzes metrics and suggests improvements Tech Stack GitLab Duo GitLab CI/CD Vue.js + Vitest Node.js Challenges we ran into GitLab Duo does not expose LLM energy or token usage Pipeline stages are isolated → solved using artifacts Node.js module issues (ESM vs CommonJS) Clarifying agent vs pipeline stage concepts Accomplishments that we're proud of Built a working multi-agent system in GitLab CI/CD Integrated AI-assisted development Added sustainability visibility to CI pipelines Designed hybrid architecture (LLM + deterministic agents) Demonstrated real-world green software engineering What we learned Sustainability is about optimization, not just measurement Not all agents need AI — use it selectively CI/CD pipelines can orchestrate agents effectively Execution metrics can approximate environmental impact Human-in-the-loop AI is still a valid agent pattern What's next for Sustainability-aware engineering (Green Software) Add real LLM energy tracking using API/token metrics Build dashboards for CO₂ visibility across teams Enable fully autonomous AI agents in pipelines Use LLMs for smarter, dynamic insights Optimize CI workloads (run only impacted tests, detect inefficiencies) Final Thought

The future of software is not just intelligent — it must also be sustainable.

Tagline

AI-powered development, optimized for the planet.

Built With

  • duo
  • gitlab
  • vue
Share this project:

Updates