Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฑ Carbon-Aware AI

Make the Climate Impact of AI Visible, Measurable, and Actionable

A comprehensive decision-support system to estimate, track, and reduce the carbon footprint of AI operations including text generation, image creation, and video synthesis.


๐ŸŽฏ Overview

Carbon-Aware AI helps developers, researchers, and organizations understand and minimize the environmental impact of their AI workloads. The platform provides:

  • Real-time carbon footprint estimation for AI models
  • Smart model recommendations to reduce emissions
  • Multi-modal support: Text AI, Image Generation, and Video Generation
  • Data center comparison across global cloud providers
  • Historical tracking of your AI carbon footprint

โœจ Features

๐Ÿ“Š Text AI Carbon Estimation

  • Estimate COโ‚‚ emissions for LLM queries (GPT-4, Claude, Llama, etc.)
  • Support for 9+ popular AI models
  • Token-based calculation with regional carbon intensity
  • Batch query analysis

๐Ÿ–ผ๏ธ Image Generation Tracking

  • Track emissions for DALL-E, Stable Diffusion, Midjourney, Flux, and more
  • Resolution and step-based calculations
  • Model comparison visualizations

๐ŸŽฌ Video Generation Analysis

  • Measure carbon footprint for Sora, Runway, Pika, and other video models
  • Duration, resolution, and FPS-based estimates
  • Real-world equivalents (phone charges, streaming hours, car emissions)

๐Ÿข Data Center Insights

  • Compare carbon intensity across global data centers
  • PUE (Power Usage Effectiveness) metrics
  • Renewable energy percentage tracking
  • Provider-level emissions analysis

๐Ÿ“ˆ History & Analytics

  • Track your carbon footprint over time
  • Visualize trends and patterns
  • Export data for reporting

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.9 or higher
  • pip package manager

Installation

  1. Clone the repository
git clone https://github.com/MalikZeeshan1122/Carbon-Aware-AI.git
cd Carbon-Aware-AI
  1. Set up the Backend API

Open a terminal and run:

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

The API will be available at:

  1. Set up the Frontend Dashboard

Open a new terminal and run:

cd frontend
pip install -r requirements.txt
streamlit run app.py --server.port 8501

The dashboard will open automatically at http://localhost:8501


๐Ÿ“ Project Structure

Carbon-Aware-AI/
โ”œโ”€โ”€ backend/                 # FastAPI backend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py         # API entry point
โ”‚   โ”‚   โ”œโ”€โ”€ models/         # Data models
โ”‚   โ”‚   โ”œโ”€โ”€ services/       # Business logic
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ estimator.py      # Carbon estimation engine
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ recommender.py    # Model recommendation system
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ image_estimator.py
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ video_estimator.py
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ datacenter.py
โ”‚   โ”‚   โ””โ”€โ”€ utils/          # Helper functions
โ”‚   โ””โ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ frontend/               # Streamlit dashboard
โ”‚   โ”œโ”€โ”€ app.py             # Main dashboard application
โ”‚   โ””โ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ LICENSE

๐ŸŽฎ Usage

Estimating Text AI Emissions

  1. Open the dashboard at http://localhost:8501
  2. Select your AI model (e.g., GPT-4, Claude, Llama)
  3. Choose the task type (Classification, Summarization, etc.)
  4. Set prompt and completion token counts
  5. Select your cloud region
  6. Click "๐ŸŒฟ Estimate Impact"

You'll see:

  • Energy consumed (kWh)
  • COโ‚‚ emissions (grams)
  • Real-world equivalents (phone charges, tree-days needed)
  • Smart recommendations for more efficient models

Image Generation Analysis

  1. Navigate to the "๐Ÿ–ผ๏ธ Image AI" tab
  2. Select your image model (DALL-E, Stable Diffusion, etc.)
  3. Configure resolution, steps, and number of images
  4. Click "๐ŸŒฟ Estimate Image Impact"

Video Generation Tracking

  1. Go to the "๐ŸŽฌ Video AI" tab
  2. Choose your video model (Sora, Runway, etc.)
  3. Set duration, resolution, and FPS
  4. Click "๐ŸŒฟ Estimate Video Impact"

๐Ÿ”ง API Endpoints

Text AI

  • POST /estimate - Estimate carbon footprint for text generation
  • POST /recommend - Get model recommendations

Image AI

  • GET /image/estimate - Estimate image generation emissions

Video AI

  • GET /video/estimate - Estimate video generation emissions

Data Centers

  • GET /datacenters/comparison - Compare global data centers

For full API documentation, visit http://localhost:8000/docs


๐Ÿ“Š Supported Models

Text Models

  • GPT-4, GPT-3.5-turbo (OpenAI)
  • Claude-3-Opus, Claude-3-Sonnet (Anthropic)
  • Llama-3-70B, Llama-3-8B (Meta)
  • Mistral-Large (Mistral AI)
  • DistilBERT, FLAN-T5 (Hugging Face/Google)

Image Models

  • DALL-E 2 & 3, Stable Diffusion (XL, 3, 2.1, Turbo, Lightning)
  • Midjourney v5 & v6, Flux (Pro, Schnell)
  • Imagen 2, LCM

Video Models

  • Sora, Runway Gen2 & Gen3, Veo
  • Pika 1.0 & 1.5, Stable Video Diffusion, AnimateDiff

๐ŸŒ Regional Carbon Intensity

The system accounts for different carbon intensities across regions:

  • Global (average)
  • US-East (Virginia)
  • US-West (Oregon)
  • EU-West (Ireland)
  • AsiaPac (Singapore)

๐Ÿงฎ Methodology

Our carbon estimation is based on:

  1. Model parameters and computational requirements
  2. Token/pixel/frame counts for workload estimation
  3. Regional carbon intensity (gCOโ‚‚/kWh)
  4. Data center PUE (Power Usage Effectiveness)
  5. Hardware efficiency (GPU/TPU specifications)

References:

  • Patterson et al. (2021) - "Carbon Emissions and Large Neural Network Training"
  • Strubell et al. (2019) - "Energy and Policy Considerations for Deep Learning in NLP"
  • Luccioni et al. (2023) - "Estimating the Carbon Footprint of BLOOM"

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Carbon intensity data from Electricity Maps
  • Model efficiency research from leading AI labs
  • Open-source community for tools and libraries

๐Ÿ“ง Contact

Muhammad Zeeshan


๐ŸŒŸ Star History

If you find this project useful, please consider giving it a โญ on GitHub!


Together, let's make AI more sustainable! ๐ŸŒฑ

About

Carbon-Aware AI is a combined dashboard and decision-support framework designed to make the energy and carbon impacts of AI systems visible, measurable, and actionable.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages