EcoLogits tracks and estimates the energy consumption and environmental impacts of using generative AI models through APIs.
Coming soon...
from ecologits import EcoLogits
from openai import OpenAI
EcoLogits.init()
client = OpenAI(
api_key="<OPENAI_API_KEY>",
)
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Hello, can you explain what is the GenAI Impact project?"}
]
)
# Get estimated environmental impacts for that inference.
print(response.impacts) # Impacts(energy=0.025, energy_unit='Wh', ...)
See package documentation on EcoLogits
Have poetry installed on your system.
Easy install using a virtualenv:
Create a venv:
python3 -m venv .venv
source .venv/bin/activate
Install poetry:
pip install poetry
poetry install --all-extras --with dev,docs
poetry run pytest
pre-commit run --all-files