Inspiration
As AI systems and cloud workloads continue to grow, inefficient software increasingly contributes to energy consumption and digital carbon emissions. We built EcoCode AI to help developers understand the environmental impact of their code and make sustainable software engineering measurable, practical, and accessible.
What it does
EcoCode AI is an AI-powered sustainable software engineering platform that analyzes Python code and GitHub repositories to detect inefficient execution patterns, estimate environmental impact, and generate intelligent optimization suggestions.
The platform provides:
- Estimated CO₂ emission tracking
- Runtime and memory analysis
- Code complexity analysis
- Green Score generation
- AI-powered optimization suggestions
- Before-vs-after benchmarking
- Repository-wide sustainability scanning
- Secure sandboxed code execution
How we built it
We built EcoCode AI using Python and Streamlit for the frontend and interactive dashboard experience.
Our analysis pipeline combines:
- AST parsing for static code analysis
- Radon for complexity metrics
- psutil and tracemalloc for runtime monitoring
- Plotly for interactive benchmarking charts
- Secure subprocess sandboxing for isolated code execution
We integrated the Google Gemini API to power intelligent sustainability analysis and code optimization suggestions. Gemini analyzes inefficient code patterns, explains their environmental impact in plain language, and generates optimized versions focused on reducing runtime, memory usage, and computational waste.
Challenges we ran into
One of the biggest challenges was securely executing untrusted code while accurately collecting runtime and sustainability metrics.
We also faced challenges in:
- estimating emissions for short-running scripts
- creating meaningful optimization comparisons
- ensuring AI-generated optimizations remained transparent and understandable
- balancing optimization quality with safe execution
Accomplishments that we're proud of
We are proud of building a fully working AI-powered sustainability platform that transforms invisible software inefficiencies into measurable insights.
Some accomplishments include:
- AI-powered optimization workflow using Gemini API
- Real-time sustainability benchmarking
- Interactive before-vs-after simulator
- Repository-wide sustainability analysis
- Secure sandboxed execution engine
- Transparent Green Score system
- Interactive dashboards and PDF sustainability reports
What we learned
We learned that sustainable software engineering is closely connected to efficient software engineering. Reducing unnecessary computation not only improves performance and scalability, but also lowers energy consumption and digital carbon emissions.
We also gained experience with:
- AI-assisted developer tooling
- Runtime benchmarking
- Secure sandboxed execution
- Sustainability-focused system design
- Explainable AI workflows using Gemini API
What's next for EcoCode AI
We plan to expand EcoCode AI with:
- support for multiple programming languages
- CI/CD integration for automated sustainability audits
- IDE extensions for real-time developer feedback
- cloud workload sustainability analysis
- AI-powered autonomous optimization agents
- organization-wide engineering sustainability dashboards
Our long-term goal is to make sustainability a core software engineering metric alongside performance, scalability, and reliability.
Log in or sign up for Devpost to join the conversation.