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.
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 metricsGPUtil— GPU utilisation & temperaturepandas— CSV loggingscikit-learn— ML-based hardware predictoripython— Jupyter cell hookspython-dotenv—.envkey loadinggoogle-generativeai— Gemini AI advisor
License
MIT © EcoML Team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecoml-0.3.0.tar.gz.
File metadata
- Download URL: ecoml-0.3.0.tar.gz
- Upload date:
- Size: 22.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20479299af1d1839e6922504ac7a5d11940a523cc09912b049493d03267f3f92
|
|
| MD5 |
18d902ffad224953655e593395776239
|
|
| BLAKE2b-256 |
f0d0a92b5260d93bdc33b146e44355b7f70e3d9c7df027b22817bba83048591f
|
File details
Details for the file ecoml-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ecoml-0.3.0-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ddb4267dcff5f7b50c5b9618c013aebcef9cdc18300cb5b929ba313613d6a9a
|
|
| MD5 |
5325cf849afaf9f73cf9d317acb76809
|
|
| BLAKE2b-256 |
764fb617191514d6b3e5aa1ddd804ac70d839a2ee123685bd14e9997a60ad90e
|