mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.11k stars 173 forks source link

feat(cli): use api-token to save emissions in API #664

Closed inimaz closed 2 weeks ago

inimaz commented 2 weeks ago

How to use this

  1. Create a .codecarbon.config file with
    [codecarbon]
    ...
    experiment_id=your_experiment_id
    api_key=your_project_token
  2. Install this
    pip install -e .
  3. Launch the cli in monitor mode to create some data
    python codecarbon/cli/main.py monitor

You should see some log like

[codecarbon INFO @ 18:13:14] ApiClient Successfully registered your run on the API.

Run ID: e14306a5-caa0-4c0d-a4b7-1b58124d6c8f
Experiment ID: bc1637d4-2066-412d-9ac8-0cb060402f22