Skip to main content

ML-EcoLyzer

Python 3.8+ License: MIT PyPI version arXiv

A framework for measuring the environmental impact of ML inference. Tracks CO2 emissions, energy consumption, and water usage across different hardware setups.

ML-EcoLyzer Overview

Why?

Training gets all the attention, but inference runs 24/7 in production. We built this to answer: "How much does running this model actually cost the environment?"

Install

Available on PyPI:

pip install ml-ecolyzer

With framework-specific dependencies:

pip install ml-ecolyzer[huggingface]  # transformers, diffusers
pip install ml-ecolyzer[pytorch]       # torchvision, torchaudio
pip install ml-ecolyzer[all]           # everything

Quick Start

from mlecolyzer import EcoLyzer

config = {
    "project": "my_analysis",
    "models": [{"name": "gpt2", "task": "text"}],
    "datasets": [{"name": "wikitext", "task": "text", "limit": 100}]
}

eco = EcoLyzer(config)
results = eco.run()

print(f"CO2: {results['final_report']['analysis_summary']['total_co2_emissions_kg']:.6f} kg")
print(f"Energy: {results['final_report']['analysis_summary']['total_energy_kwh']:.6f} kWh")

What it measures

  • CO2 emissions - Based on power draw and regional carbon intensity
  • Energy usage - Via NVIDIA-SMI, psutil, or RAPL
  • Water footprint - Cooling overhead varies by hardware tier
  • ESS (Environmental Sustainability Score) - Parameters per gram of CO2, useful for comparing models
ESS = Effective Parameters (M) / CO2 (g)

Higher ESS = more efficient. INT8 models typically score ~74% higher than FP32.

Supported setups

  • GPUs: A100, T4, RTX series, GTX series
  • CPU-only works too
  • Frameworks: HuggingFace, PyTorch, scikit-learn

Config file

project: "benchmark_run"

models:
  - name: "facebook/opt-350m"
    task: "text"
    quantization:
      enabled: true
      target_dtype: "int8"

datasets:
  - name: "wikitext"
    task: "text"
    limit: 500

hardware:
  device_profile: "auto"

output:
  output_dir: "./results"
  export_formats: ["json", "csv"]

CLI

# Single run
mlecolyzer analyze --model gpt2 --dataset wikitext --task text

# System info
mlecolyzer info

Benchmarks

Ran 1,500+ inference configs across:

  • Hardware: GTX 1650, RTX 4090, Tesla T4, A100
  • Models: GPT-2, OPT, Qwen, LLaMA, Phi, Whisper, ViT
  • Precisions: FP32, FP16, INT8

Key findings:

  • A100 has poor ESS when underutilized (overkill for small batches)
  • Consumer GPUs (RTX/T4) often more efficient for single-batch inference
  • Quantization helps a lot, especially INT8

Contributing

See CONTRIBUTING.md. PRs welcome.

# Dev setup
pip install -e ".[dev]"
pytest

Citation

@misc{mlecolyzer2026,
  title={ML-EcoLyzer: A Framework for Quantifying the Environmental Impact of Machine Learning Inference},
  author={Minoza, Jose Marie Antonio and Laylo, Rex Gregor and Villarin, Christian and Ibanez, Sebastian},
  year={2026},
  note={AAAI Workshop on AI for Environmental Science},
  eprint={2511.06694},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  doi={10.48550/arXiv.2511.06694}
}

License

MIT

Metadata

Release files for ml-ecolyzer 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml-ecolyzer 1.1.2
File Size Uploaded Provenance
ml_ecolyzer-1.1.2.tar.gz 279.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ml-ecolyzer 1.1.2
File Interpreter ABI Platform
ml_ecolyzer-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 401.0 kB

Release files / ml_ecolyzer-1.1.2.tar.gz

Download URL ml_ecolyzer-1.1.2.tar.gz
Size 279.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e575e59e0eef2f548c1054a2f690e6a57cfc2ce5ba60ac1c5f9761ad206d6fc1
BLAKE2b-256 checksum
How to use checksums
15a69341b7ed7dc27020467e35e8f941779a969df8d147ac7e8ed28dc7a4551a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Release files / ml_ecolyzer-1.1.2-py3-none-any.whl

Download URL ml_ecolyzer-1.1.2-py3-none-any.whl
Size 121.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c2426a5f1a878e6fa693c3a1441ff4ec43868cc001f7be592f48efb4bea68a6
BLAKE2b-256 checksum
How to use checksums
9e86f20cbb0d7e9fb99d57f282882b77a27c676e47acd334e54ce1fdf8d856ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.9

Security for ml-ecolyzer 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page