π Eco Prompt Compressor
π Overview
Eco Prompt Compressor is a smart Chrome extension designed to shrink your AI prompts and your carbon footprint. By using AI to strip away redundant tokens, we help users save significant amounts of energy and water used by data centers with every request.
β¨ Features
-
π Eco Mode Toggle: Quickly switch compression on or off whenever you need it.
-
π€ AI-Powered Compression: Uses Google Gemini 1.5 Flash to remove filler phrases while keeping 100% of your prompt's meaning.
-
π Token Analytics: See exactly how many tokens you saved and the percentage of efficiency gained.
-
π§ Eco-Impact Tracking: Real-time estimates of energy (
$0.001$ kWh) and water ($0.5$ ml) saved per token reduction.
π File Structure eco-prompt-compressor βββ src β βββ manifest.json β βββ popup.html β βββ popup.css β βββ popup.js β βββ content-script.js β βββ service-worker.js β βββ config.example.js β βββ config.js (User Created) π β βββ utils.js βββ README.md
π Installation Follow these exact commands in your terminal to get started:
- git clone https://github.com/rehanptl/EcoCompressor.git
- cd EcoCompressor/src
- cp config.example.js config.js
- open -e config.js
- will need your own gemini api key
- Load in Chrome: π
- Open chrome://extensions/
- Enable Developer mode (toggle in the top right).
- Click Load unpacked (top left).
- Select the src folder inside the EcoCompressor directory.
π οΈ How It Works Selection: Highlight any text on a page and right-click to "Optimize Selection."
Processing: Our service worker sends the text to Gemini to be compressed into a "Green Prompt."
Results: The popup displays your savings in milliliters of water and watts of energy, making the invisible cost of AI visible.
Heuristics: Token savings are calculated based on standard LLM average costs.