- Notifications
You must be signed in to change notification settings - Fork11
🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.
License
genai-impact/ecologits
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
🌱EcoLogits tracks the energy consumption and environmental impacts of using generative AI models through APIs.
EcoLogits was created and is actively maintained by theGenAI Impact non-profit.
Read the fulldocumentation onecologits.ai.
pip install ecologits
For integration with a specific provider, usepip install ecologits[openai]
. We are currently supporting the following providers:anthropic
,cohere
,google-generativeai
,huggingface-hub
,mistralai
andopenai
. See the fulllist of providers.
fromecologitsimportEcoLogitsfromopenaiimportOpenAI# Initialize EcoLogitsEcoLogits.init()client=OpenAI(api_key="<OPENAI_API_KEY>")response=client.chat.completions.create(model="gpt-4o-mini",messages=[ {"role":"user","content":"Tell me a funny joke!"} ])# Get estimated environmental impacts of the inferenceprint(f"Energy consumption:{response.impacts.energy.value} kWh")print(f"GHG emissions:{response.impacts.gwp.value} kgCO2eq")
See package documentation onEcoLogits
To get started with setting up a development environment and making a contribution to EcoLogits, seeContributing to EcoLogits.
This project is licensed under the terms of theMozilla Public License Version 2.0 (MPL-2.0).
About
🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.