Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

An open-source Python package that estimates the electricity use and carbon emissions of your code while it runs, for measuring and reporting the footprint of training and running models.

Websitehttps://codecarbon.io/
Source codehttps://github.com/mlco2/codecarbon
Developed byMila, BCG GAMMA, Comet.ml, Haverford College, Code Carbon NGO (2020)
TypeSoftware library: Python package with command-line tool and dashboard
Lifecycle phaseDevelopment, Deployment
FUTURE-AIGeneral recommendations, Traceability
ForAI developers, Researchers
FacilitationNo facilitator needed
Skills neededPython
CostFree
LanguagesEnglish
MaturityEstablished
LicenceMIT

What it is

You wrap your code in a tracker (or run it through the command-line tool), and CodeCarbon measures or estimates the power drawn by the CPU, GPU and RAM. It then multiplies that energy by the carbon intensity of the electricity grid where the computation runs. Results are saved to a file and can be viewed in a local or online dashboard. It covers compute on hardware you run yourself; it does not account for disk, network or cooling, and it does not track calls to remote generative AI APIs.

In healthcare

Useful when a hospital or research group wants to report the environmental cost of training a clinical model, or to compare candidate models on emissions as well as accuracy.

Where to use it in The ELSA Way

References

References
  1. Benoit Courty, Victor Schmidt, Goyal-Kamal, MarionCoutarel, Boris Feld, Jérémy Lecourt, LiamConnell, SabAmine, inimaz, supatomic, Mathilde Léval, Luis Blanche, Alexis Cruveiller, ouminasara, Franklin Zhao, Aditya Joshi, Alexis Bogroff, Amine Saboni, Hugues de Lavoreille, … MinervaBooks. (2024). mlco2/codecarbon: v2.4.1. Zenodo. 10.5281/ZENODO.11171501