Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>The Lean Prompt – Local Prompt OptimizerNew to Visual Studio Code? Get it now.
The Lean Prompt – Local Prompt Optimizer

The Lean Prompt – Local Prompt Optimizer

Zulkarnain Shah

|
14 installs
| (0) | Free
Optimize prompts 100% on-device using local Ollama LLMs. Save tokens, reduce AI costs, stay private.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

✂️ 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

  1. Install Ollama
  2. Pull a compact model (recommended):
    ollama pull qwen2.5:3b
    
  3. Start the Ollama server (it runs automatically after install)
  4. Open LeanPrompt from the Activity Bar — it auto-detects Ollama

🎮 How to Use

  1. Open the LeanPrompt panel from the Activity Bar (scissors icon)
  2. Paste your prompt into the text box (or type @filename to reference a workspace file)
  3. Choose Aggressiveness: 🛡 Conservative | ⚖️ Balanced | 🔥 Aggressive
  4. Enable Safe Zone to protect code blocks, URLs, and file paths
  5. Click Optimize Prompt
  6. Review the Before/After comparison and token savings
  7. 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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft