Skip to content
@mlco2

CodeCarbon

Open tools to measure the environmental footprint of local compute & remote GenAI

Website · CodeCarbon docs · EcoLogits docs · Discord

Code Carbon is a French non-profit (NGO). We build free, open-source software to help developers and researchers understand the energy and carbon impact of their work.

Most of what you see here is maintained by volunteers — researchers, engineers, and sustainability practitioners who contribute in their spare time. Sponsors and partner organisations provide hosting, funding, and expertise; the day-to-day work still runs on community effort.

People also build integrations outside these repos — editor plugins, status bars, and tooling that connect to our libraries and APIs. We highlight the ones we know about below; if you ship something similar, tell us on Discord.


Two tools, one mission

AI and software need electricity. Where that code runs — on your laptop or on a provider's servers — changes what you can measure directly.


CodeCarbon

EcoLogits
What it tracksEmissions from local computing — code on hardware you controlEmissions from GenAI API calls — OpenAI, Anthropic, Mistral, etc.
Typical use casesModel training, local inference, scripts on your machine or cloud VMChatbots, agents, RAG pipelines calling remote models
How it worksMeasures CPU, GPU & RAM power, applies regional grid carbon intensityEstimates impacts from request metadata (model, tokens, latency) via LCA models
Get startedpip install codecarbonpip install ecologits

They are complementary, not competing. CodeCarbon is for compute you run yourself — training, local inference, jobs on your machines or cloud VMs. EcoLogits is for when you call third-party GenAI APIs and want to estimate the impact of those requests.

When to use CodeCarbon vs EcoLogits →


Projects

CodeCarbon — local compute emissions

Track CO₂ from code running on your own hardware. Python library, CLI, cloud dashboard, and offline visualisation.

PyPIStars

fromcodecarbonimportEmissionsTrackertracker=EmissionsTracker()
tracker.start()
# your codeemissions=tracker.stop()

Documentation · Dashboard · Website


EcoLogits — GenAI API emissions

Python library that attaches environmental impact estimates to responses from official provider SDKs.

PyPIStars

fromecologitsimportEcoLogitsfromopenaiimportOpenAIEcoLogits.init(providers=["openai"])
response=OpenAI().chat.completions.create(model="gpt-4o-mini", messages=[...])
print(response.impacts.gwp.value.mean, "kgCO2eq")

Documentation · Methodology

Related EcoLogits projects:

ProjectDescription
ecologits-calculatorInteractive web calculator — no install, try at calculator.ecologits.ai
ecologits-apiREST API for impact estimates — live at api.ecologits.ai

More first-party repositories

RepositoryWhat it is
impactML paper carbon calculator & LaTeX templates
codecarbon-mcpMCP server for remote compute monitoring
vscode-extension-codecarbonVS Code extension for CodeCarbon
ecologits.jsJavaScript client for EcoLogits

Community integrations

These projects are maintained outside the mlco2 organisation but built on our open APIs and methodology. They are independent — not official releases — and we are grateful to the authors for extending the ecosystem.

ProjectAuthorWhat it does
ecologits-statuslineVincent DuarteDrop-in Claude Code status-line snippet — live session energy, CO₂eq & water from output tokens via the EcoLogits API
ecologits-vscodemarmelabVS Code status bar for Claude Code sessions (last use, workspace, or all-time totals). Adaptation of the status-line project above

EcoLogits impact shown in the VS Code status bar
VS Code status bar integration by marmelab/ecologits-vscode

Built something on CodeCarbon or EcoLogits? Open a PR to mlco2/.github or ping us on Discord — happy to list it here.


Get involved

We welcome issues, pull requests, documentation fixes, and methodology feedback — whether you have an hour or a recurring slot.


Sponsors & partners

Our tools stay free thanks to organisations that sponsor infrastructure, funding, or expertise. Community volunteers do the rest.

Infrastructure & core sponsors (CodeCarbon)

Clever CloudData For GoodGitHubMozilla

EcoLogits sponsors

ResilioTerra CognitaSophtAvanadeTheodoMinistère de la Culture

Historical & research partners:Mila, BCG GAMMA, Comet, Haverford College, Boavizta


Made with care by volunteers at Code Carbon · mlco2 on GitHub

Pinned Loading

  1. codecarboncodecarbonPublic

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

    Python 1.9k 314

  2. ecologitsecologitsPublic

    🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.

    Python 314 32

  3. ecologits-apiecologits-apiPublic

    🌱 Estimate the environmental footprint of GenAI with EcoLogits API

    Python 8 1

  4. ecologits-calculatorecologits-calculatorPublic

    🧮 EcoLogits Calculator estimate the environmental footprint of your GenAI usage

    Python 8 2

  5. codecarbon-datacodecarbon-dataPublic

    Jupyter Notebook

Repositories

Showing 10 of 14 repositories

Sponsors

  • Private Sponsor

Top languages

Loading…

Most used topics

Loading…