✂️ LeanPrompt — Local Prompt Optimizer
Optimize AI prompts 100% on your device. Reduce token usage, cut AI costs, and keep your data completely private — zero cloud calls, ever.
✨ Features
- 🦙 Ollama-Exclusive — Connects to your local Ollama server for high-quality, LLM-powered prompt optimization with full context awareness
- 💰 Cost Tracker — Tracks tokens saved and estimated USD savings per session
- 📁 File References — Type
@ in the prompt box to search and reference workspace files inline
- 🔒 100% Private — Your prompts never leave your machine. No telemetry, no API keys, no cloud
- ⚡ Live Status — Automatically detects when Ollama starts or stops and updates the UI in real-time
🚀 Getting Started
- Install Ollama
- Pull a compact model (recommended):
ollama pull qwen2.5:3b
- Start the Ollama server (it runs automatically after install)
- Open LeanPrompt from the Activity Bar — it auto-detects Ollama
🎮 How to Use
- Open the LeanPrompt panel from the Activity Bar (scissors icon)
- Paste your prompt into the text box (or type
@filename to reference a workspace file)
- Choose Aggressiveness: 🛡 Conservative | ⚖️ Balanced | 🔥 Aggressive
- Enable Safe Zone to protect code blocks, URLs, and file paths
- Click Optimize Prompt
- Review the Before/After comparison and token savings
- Click Copy or Send to Chat to use your optimized prompt
⌨️ Keyboard Shortcut
You can quickly optimize your current selection using the keyboard:
- Mac:
Shift + Cmd + L
- Windows/Linux:
Shift + Ctrl + L
⚙️ Settings
| Setting |
Default |
Description |
leanPrompt.compressionAggressiveness |
aggressive |
How aggressively to compress (conservative, balanced, aggressive) |
leanPrompt.preserveCodeBlocks |
true |
Protect code blocks, URLs, and file paths from compression |
leanPrompt.costPerMillionTokens |
2.5 |
Reference cost (USD) per 1M tokens for savings calculations |
🔒 Privacy Guarantee
LeanPrompt is designed from the ground up to be 100% offline and private:
- No API keys required — works entirely with local models
- No network calls for inference — all optimization runs on your CPU
- No telemetry — your prompts, files, and savings data never leave your machine
- Your data is yours. Always.
☕ Support & Donations
If you find LeanPrompt useful and want to support its development, you can buy me a coffee!
☕ Buy me a coffee via AirTM
🤝 Contributing
Found a bug or have a feature idea? Open an issue on GitLab.
📄 License
MIT © Zulkarnain Shah
| |