Skip to main content

EcoML – Track, analyse and reduce ML carbon emissions inside Jupyter notebooks.

Project description

EcoML 🌿

Track, analyse and reduce the carbon footprint of your ML experiments — directly inside Jupyter.

PyPI version Python License: MIT


Install

pip install ecoml

To also enable Gemini AI tips (recommended):

pip install "ecoml[gpu]"   # + WMI GPU temp on Windows

Quick Start

import sys, pathlib
ROOT = pathlib.Path().resolve().parent
sys.path.insert(0, str(ROOT))

from ecoml import EcoTracker, CellHook, RecommendationEngine, GeminiAdvisor

tracker    = EcoTracker(log_path=str(ROOT / "data" / "emissions_log.csv"))
gemini     = GeminiAdvisor()                   # needs GEMINI_API_KEY in .env
recommender = RecommendationEngine(gemini=gemini)

hook = CellHook(tracker, recommender)
hook.register()
print("🌿 EcoML Ready")

After hook.register() every subsequent cell automatically shows:

  • 🌿 CO₂ produced (grams)
  • ⚙️ Hardware recommendation with confidence score
  • 💡 AI-powered tips via Gemini
  • 📊 Eco Score (0–100)

What's New in v0.2.0

Area Improvement
Recommender 12 intelligent rules (RAM, vRAM, temps, runtime, CO₂, GPU/CPU bottlenecks)
Confidence Score Dynamic 0–1 score based on how many issues are detected
RAM Monitoring System RAM % and GPU VRAM % tracked per cell
Gemini Prompts Rich context-aware prompts with all metrics for targeted advice
Eco Score Physics-inspired formula penalising load, heat, runtime & carbon
UI RAM/VRAM rows, colour-coded confidence badge, both CPU + GPU temps

Environment Setup

Create a .env file in your project root:

GEMINI_API_KEY=your_key_here

Get a free key at aistudio.google.com.


Dependencies

Automatically installed with pip install ecoml:

  • psutil — CPU / RAM metrics
  • GPUtil — GPU utilisation & temperature
  • pandas — CSV logging
  • scikit-learn — ML-based hardware predictor
  • ipython — Jupyter cell hooks
  • python-dotenv.env key loading
  • google-generativeai — Gemini AI advisor

License

MIT © EcoML Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecoml-0.2.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecoml-0.2.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file ecoml-0.2.0.tar.gz.

File metadata

  • Download URL: ecoml-0.2.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for ecoml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1632478ba379e3019af2b328a6104de2ecd8cc26079f30abaa00a60fa9757a5d
MD5 9a30614d02c802967f052bf1b48b56d3
BLAKE2b-256 ef6d5cff7d80c217add300f54ebe135d67a61efb2f4f3df4a6cccaf5e3417a3d

See more details on using hashes here.

File details

Details for the file ecoml-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ecoml-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for ecoml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39c36e6c27d4e3c928fe6c939123b155480305369a2054b3d137f8fc5b769952
MD5 3908ffe22251d729d6e6921cac8a5aac
BLAKE2b-256 e2226f35f78a9dad1e59f07ef66c655c517019104f9928d81969ec87cf3fe9d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page