How genai-impact/ecologits works
Main Components
a. Core Components:
• Impact Tracking Engine (ecologits/_ecologits.py)
• Model Repository System (ecologits/model_repository.py)
• Electricity Mix Repository (ecologits/electricity_mix_repository.py)
• Impact Calculation System (ecologits/impacts/)
b. Provider Integration Layer:
• API Tracers for different providers (ecologits/tracers/)
• Provider-specific implementations
• OpenAI
• Anthropic
• Cohere
• HuggingFace Hub
• MistralAI
• LiteLLM
c. Data Storage:
• Model specifications (ecologits/data/models.json)
• Electricity mix data (ecologits/data/electricity_mixes.csv)
[Client Applications]
• ↓
[EcoLogits Main Interface]
• ↓
[Provider Integration Layer] ←→ [External AI Providers]
• ↓
[Impact Calculation Engine]
• ↓
[Data Repositories] ←→ [Static Data Files]
Key Relationships to Highlight
• How the main EcoLogits interface connects to various provider tracers
• Data flow from API calls through the impact calculation system
• Demonstrate how the model and electricity mix repositories feed into the impact calculations
Implementation Details
• The modular architecture allowing for easy provider additions
• The separation between tracing logic and impact calculations
• The data flow for both streaming and non-streaming API calls
• The relationship between model specifications and impact calculations
Technical Elements
• Python package dependencies
• API integration points
• Data storage formats (JSON, CSV)
• Configuration options
• Monitoring and logging components