codecarbon  by mlco2

Track and reduce computing's environmental footprint

Created 6 years ago
1,776 stars

Top 23.7% on SourcePulse

GitHubView on GitHub
Project Summary

Emits CO₂ emissions from local computing, providing tools for developers and researchers to estimate, track, and analyze their environmental impact. It offers a lightweight Python library and CLI for easy integration, enabling users to contextualize emissions with real-world equivalents and identify opportunities for reduction.

How It Works

CodeCarbon estimates electricity power consumption by combining hardware metrics (GPU, CPU, RAM) with the carbon intensity of the computing region. This methodology, detailed in the project's documentation, allows for a quantitative assessment of the carbon footprint generated by computational tasks.

Quick Start & Requirements

Install via pip: pip install codecarbon. For Conda users, activate your environment first. A Python quickstart involves importing EmissionsTracker, starting it, running your code, and stopping it to retrieve emissions data. The CLI allows tracking commands directly, e.g., codecarbon monitor --no-api -- python train.py. Configuration can be managed via ~/.codecarbon.config, ./.codecarbon.config, environment variables, or Python arguments. Official installation and API documentation are available.

Highlighted Details

  • Focuses on local computing emissions; for remote GenAI API calls, EcoLogits is recommended.
  • Provides effective visual outputs via a dashboard or the local carbonboard tool.
  • Supports comparing model efficiency and includes framework examples for scikit-learn.

Maintenance & Community

CodeCarbon is a community-driven project welcoming contributions via issues and pull requests. It is supported by the French non-profit Code Carbon, having previously received support from Mila, DataForGoodFR, Comet.ml, and BCG GAMMA. Community interaction is facilitated through Discord.

Licensing & Compatibility

The provided README does not explicitly state the software license type. Therefore, compatibility for commercial use or closed-source linking cannot be determined from this document.

Limitations & Caveats

This tool exclusively tracks emissions from local computing hardware. It does not measure emissions from remote GenAI API calls, for which a separate tool, EcoLogits, is suggested. The project's licensing is not specified in the README, which may impact adoption decisions.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
40
Issues (30d)
9
Star History
45 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.