Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🌱 EcoLogits tracks the energy consumption and environmental footprint of using generative AI models through APIs.

License

NotificationsYou must be signed in to change notification settings

genai-impact/ecologits

Repository files navigation

EcoLogits

🌱EcoLogits tracks the energy consumption and environmental impacts of using generative AI models through APIs.

PyPI versionPyPI downloadsPython versionOpen In Colab

EcoLogits was created and is actively maintained by theGenAI Impact non-profit.

Read the fulldocumentation onecologits.ai.

⚙️ Installation

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.

🚀 Usage

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

💪 Contributing

To get started with setting up a development environment and making a contribution to EcoLogits, seeContributing to EcoLogits.

⚖️ License

This project is licensed under the terms of theMozilla Public License Version 2.0 (MPL-2.0).


[8]ページ先頭

©2009-2025 Movatter.jp