# mlco2/codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.

Repository: https://github.com/mlco2/codecarbon
Canonical: https://ross.abutalabs.com/products/codecarbon
Homepage: https://docs.codecarbon.io/
Language: Python
License: MIT
License Family: permissive
Topics: ai-ethics, carbon-emissions, carbon-footprint, co2-emissions, energy-consumption, energy-efficiency, fairness, sustainability
Last push: 2026-08-20T06:21:50+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 96, longevity 100
- inputs: {"age_days": 2304, "days_push": 13, "days_rel": 29, "gap_med": 15.5, "n_releases_24m": 31}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1905, forks 316 (observed 2026-08-28T04:05:51.801048+00:00)

## What it is
CodeCarbon is a lightweight Python library and CLI that estimates and tracks CO2 emissions from local computing hardware (CPU, GPU, RAM) by measuring power consumption and applying regional carbon intensity. It helps quantify the environmental impact of running code, especially machine learning workloads, and recommends ways to reduce it.

## Use cases
- track carbon emissions of my machine learning training runs
- measure energy consumption of python code
- estimate co2 footprint of gpu training
- monitor sustainability of compute workloads
- compare carbon efficiency of ml models
- track emissions from a command without changing code

## When to choose
- you run ML training or heavy compute on local hardware and want to quantify its carbon footprint
- you want a simple pip-installable tracker with a Python API and CLI
- you need emissions reporting for sustainability or ai-ethics goals

## When to avoid
- you need emissions from remote GenAI API calls (use EcoLogits instead)
- you need fine-grained measurement of disk, network, cooling, or display power
- you run exclusively on hardware where power metrics are unavailable

## Facets
- artifact type: library
- maturity: active
- function: monitoring, analytics, benchmarking, cli
- domain: machine-learning, developer-tools, data-science, energy
- platform: python, windows, cli
- tags: carbon-emissions, energy-consumption, co2-tracking, green-computing, ai-ethics, sustainability, emissions-tracker, linux, macos

## Member repositories
- mlco2/codecarbon (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:51.801048+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:11:43.630860+00:00, confidence not recorded.
  - readme: https://github.com/mlco2/codecarbon (fetched 2026-08-28T04:05:51.801048+00:00, sha c292a9b950e4)
  - homepage: https://docs.codecarbon.io/ (fetched 2026-08-29T10:50:46.072088+00:00, sha be56de3a38dd)
  - site_page: https://docs.codecarbon.io/latest (fetched 2026-08-29T10:50:46.081602+00:00, sha 1f69784e88f0)
  - registry_pypi: https://pypi.org/pypi/codecarbon/json (fetched 2026-08-29T10:50:46.083977+00:00, sha 88309bfafe63)
- Data as of 2026-08-30T08:39:29.467469+00:00.
