AI Energy Usage Tracker
A Chrome extension that tracks and optimizes energy usage of AI conversations, providing insights and recommendations to reduce the environmental impact of AI interactions.
Features
- Prompt Input & Optimization: Enter your AI prompts and get optimization suggestions to reduce energy consumption
- On-Demand Model Recommendations: The extension analyzes your prompt when you click "Optimize" and suggests the most energy-efficient AI model for your specific task
- Energy Usage Metrics: Track energy consumption, water usage, cost, and carbon footprint
- Integrated Energy-Saving Tips: Receive a new energy-saving tip each time you optimize your prompt
- Streamlined Workflow: Single-button interface that optimizes prompts, recommends models, and records conversations
- AWS Bedrock Integration: Connect to AWS Bedrock to use Claude 3.7 Sonnet for real AI-powered prompt optimization and model recommendations
Installation
Development Mode
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the
ai-energy-trackerfolder - The extension should now appear in your Chrome toolbar
From Chrome Web Store (Future)
Once published:
- Visit the Chrome Web Store page for AI Energy Usage Tracker
- Click "Add to Chrome"
- Confirm the installation when prompted
How to Use
Configure AWS Bedrock (Optional):
- Click the extension's options page (right-click the extension icon and select "Options")
- Enter your AWS Access Key ID, Secret Access Key, and select your AWS Region
- The extension will use Claude 3.7 Sonnet for prompt optimization and model recommendations
- If not configured, the extension will fall back to using dummy data
Enter a Prompt:
- Click the extension icon in your Chrome toolbar
- Type your AI prompt in the text area
- See SAMPLE_PROMPTS.md for examples of prompts that work well with different models
Optimize Your Prompt:
- Click "Optimize" to analyze your prompt
- If AWS Bedrock is configured, Claude 3.7 Sonnet will optimize your prompt and recommend the best model
- If not, the extension will use built-in algorithms for optimization
- Review the optimized prompt suggestion
- See the recommended model for your task type
- Get a new energy-saving tip with each optimization
- Click "Use Optimized" to apply the suggestions and record the conversation
View Energy Metrics:
- Switch between "Last Conversation" and "Total Usage" tabs
- See detailed metrics on energy usage, water consumption, cost, and carbon footprint
Current Limitations
This is a prototype version with the following limitations:
- Uses dummy data for energy calculations (not real-time API data)
- Prompt optimization uses simple heuristics rather than advanced NLP
- No integration with actual AI services (Claude, etc.)
- Local storage only (no cloud sync of usage statistics)
Future Development
Short-term Improvements
- Add actual icon files (replacing placeholders)
- Implement more sophisticated prompt analysis
- Add visual charts for usage statistics
- Improve UI/UX with animations and better visual feedback
Medium-term Goals
- Integrate with AI provider APIs for real usage data
- Implement more accurate energy usage calculations
- Add export functionality for usage reports
- Create user profiles and customization options
Long-term Vision
- Develop API integrations with major AI providers (Anthropic, Amazon, etc.)
- Create a backend service for more accurate calculations and data storage
- Implement machine learning to improve optimization suggestions
- Add comparative analysis between different AI providers
Technical Details
- Built with vanilla JavaScript, HTML, and CSS
- Uses Chrome Extension Manifest V3
- Leverages Chrome Storage API for data persistence
- Implements a background service worker for tracking
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Log in or sign up for Devpost to join the conversation.