Analiza el impacto ecológico de tus prompts de IA y sugiere cómo optimizarlos
Project description
eco-ai
A command-line tool to estimate the ecological impact of your AI prompts and improve how you write them.
It calculates energy consumption, CO₂ emissions, water usage, and API cost — all locally, without sending any data to external servers.
Installation
Requires Python ≥ 3.8. Pick the method that suits you:
| Method | Command | Notes |
|---|---|---|
| pipx ⭐ | pipx install eco-ai |
Recommended — isolated install, no conflicts |
| pip | pip install eco-ai |
Use inside a virtual environment |
| uv | uv tool install eco-ai |
Fastest option if you already use uv |
Don't have Python yet? Download it from python.org/downloads — no custom settings needed during install.
Manual install (for contributors)
git clone https://github.com/your-username/eco-ai.git
cd eco-ai
pip install -e .
Verify the install:
eco-ai --help
Usage
eco-ai analyze "Explain what climate change is and what its main causes are"
eco-ai will show you:
- The estimated ecological impact of your prompt (energy, CO₂, water, and API cost)
- The detected task type and its energy consumption level
- Concrete suggestions to reduce the impact by rewriting your prompt more efficiently
- The recommended AI model based on the complexity of your request
Other commands
# Compare the impact of the same prompt across all available models
eco-ai compare "your prompt here"
# List all available models and their prices
eco-ai models
# Interactive usage guide
eco-ai guide
# Change the language of suggestions (es / en)
eco-ai config --lang en
Options for analyze
| Option | Description | Default |
|---|---|---|
-m / --model |
Reference model for the calculation | Claude Sonnet 4.6 |
-f / --file |
Read the prompt from a text file | — |
-t / --output-type |
Expected output type: auto, text, image, code, pdf, artifact |
auto |
--output-ratio |
Estimated fraction of output tokens relative to input | 0.4 |
--lang |
Prompt language (es or en) |
Saved config |
--verbose |
Show bibliographic references for each suggestion | — |
--no-tips |
Show only metrics, no suggestions | — |
-y / --yes |
Skip the privacy consent screen | — |
Supported models
| Tier | Models |
|---|---|
| small | Claude Haiku 4.5, GPT-4o mini |
| medium | Claude Sonnet 4.6, Claude Sonnet 4, Gemini 1.5 Pro |
| large | Claude Opus 4.6, Claude Opus 4, GPT-4o, Llama 3 70B |
How it works
- Tokenisation — counts tokens using
tiktoken(cl100k_base) or approximates with words × 1.3 - Energy metrics — estimates kWh based on the model tier (Luccioni et al., 2023)
- CO₂ — converts energy to emissions using a cloud provider emission factor (IEA, 2023)
- Water — estimates data centre cooling consumption (Microsoft Sustainability Report, 2023)
- Prompt analysis — detects high-energy verbs, missing output limits, incomplete ROCKS structure, courtesy phrases, vague language, and more
- Model recommendation — suggests the most appropriate tier based on the prompt's complexity
Sources
- Luccioni et al. (2023) Power Hungry Processing: Scrutinizing Energy Use in NLP
- Liu et al. (2023) Lost in the Middle: How Language Models Use Long Contexts
- Min et al. (2022) Rethinking the Role of Demonstrations in Few-Shot Prompting
- Webson & Pavlick (2021) Do Prompt-Based Models Really Understand the Meaning of Their Prompts?
- Anthropic Prompt Engineering Guide (2024)
Privacy
All analysis happens on your device. Your prompt text is never sent to any external server.
License
MIT © Maria Prokhorova
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 eco_ai-0.1.0.tar.gz.
File metadata
- Download URL: eco_ai-0.1.0.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddb32ff18064fcd0595312e02fc964ca538ec9ccace0f64f206fee602875999a
|
|
| MD5 |
e31a81732d1014dda17595dc08a31bc7
|
|
| BLAKE2b-256 |
92bac13b68f4a425ca8baf75e921e7206d0d3fd594d95c001beea5bfff234034
|
File details
Details for the file eco_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: eco_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e7b398cb30a03e95c96ed02e95cfdd4b92fd0eda002a3c3b757f03db5b974cb
|
|
| MD5 |
910c85fee501dfff1f3728949294960a
|
|
| BLAKE2b-256 |
d5e07cab14c456956d21e769826d53345b05e500d0a990c61a348a8e2826d31d
|