Skip to content

CLI can be called in offline mode without and API endpoint #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 15, 2025

Conversation

EvanKomp
Copy link
Contributor

I was having trouble getting codecarbon monitor to work in an offline environment. It seems like OfflineEmissionsTracker is only accessible in the python api. I changed the main CLI script to allow the user to start an offline mode.

Side note, I also could not use codecarbon config in this environment - the second prompt, for the api endpoint gave me FiefAuthNotAuthenticatedError

The tool could be pretty useful for researchers using HPC clusters and submitting jobs for training/and or other non deep learning hgh compute jobs like simulations, if a clear offline CLI was available

@inimaz
Copy link
Collaborator

inimaz commented Feb 12, 2025

Hello @EvanKomp, thanks for using codecarbon!

there is the option of running codecarbon monitor --no-api that launches codecarbon in offline mode. Have you tried it/Does that not work for you?

@EvanKomp
Copy link
Contributor Author

EvanKomp commented Mar 3, 2025

@inimaz It probably could with a few changes - when using the no-api flag it still uses the EmissionTracker class, which defaults to global emissions when it cannot figure out the geo metadata. A mechanism to explicitly pass a country/region would be helpful, like in the pull.

Even more ideal would be a way to configure for a particular energy mix. That may be too niche a problem. I am on a campus which is mostly solar and differs from my local grid, so being able to modify the config file to overwrite this somehow would be super.

benoit-cty added 2 commits June 15, 2025 12:11
@benoit-cty benoit-cty merged commit 865809a into mlco2:master Jun 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants