{"slug": "promptshrink", "title": "PromptShrink", "summary": "Developer Heloisa Pe Garcia has released PromptShrink, an open-source prompt pre-processor that cuts LLM token usage by up to 60% in production. The tool minifies code, strips comments, and trims verbose prompts before they reach APIs like OpenAI, Anthropic, and Gemini, with a dashboard to visualize savings and a browser extension for ChatGPT, Claude.ai, Google AI Studio, and Poe.", "body_md": "**How I Cut LLM Token Usage by Up to 60% in Production**\n\nIf you work with LLM APIs (OpenAI, Anthropic, Gemini), you know the pain: every call costs money, and a big chunk of that cost is pure waste — verbose prompts, code pasted with no filtering, repeated context the model doesn't even need to understand the task.\n\nThat's why I built PromptShrink: a prompt pre-processor that trims the excess before it ever hits the API, without losing what actually matters for the model to understand.\n\nThe real problem\n\nEvery time you feed a code snippet or a long prompt to an LLM, you're paying per token, not per character. Comments, whitespace, formatting meant for humans — all of that is dead weight the model doesn't need to do its job. At scale (thousands of calls per month), that adds up to a real bill.\n\nWhat PromptShrink does\n\nPackages entire repositories, minifying code and stripping comments, ready to paste as context into any LLM\n\nSimulates real dollar savings, comparing your current spend against the optimized version\n\nVisualizes everything on a dashboard — tokens saved, % reduction, active rules\n\nPlugs straight into your code via a Python SDK\n\nBecomes a browser extension, adding a \"Shrink\" button directly on ChatGPT, Claude.ai, Google AI Studio, and Poe\n\nIn practice\n\nbash\n\npromptshrink repo --path ./src --save-to-file context.txt\n\npromptshrink calc --calls 100000 --tokens 800 --model gpt-4o\n\nRunning calc on a scenario of [insert your real number here, e.g. \"100k calls/month with gpt-4o\"], the estimated savings came out to [$X per month] — just by trimming what's unnecessary before it reaches the model.\n\nTry it out\n\nThe project is open source, with a CLI, a FastAPI backend, and a Python SDK. If you're running LLMs in production and want to stop paying for tokens that add zero value, check it out:\n\n🔗 github.com/HeloisaPeGarcia/PromptShrink\n\nFeedback and PRs are very welcome — this is my first published project like this, so every contribution helps make it better.", "url": "https://wpnews.pro/news/promptshrink", "canonical_source": "https://dev.to/heloisapegarcia/promptshrink-5hh0", "published_at": "2026-08-17 21:23:38+00:00", "updated_at": "2026-08-17 21:42:47.500793+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-products", "ai-tools", "mlops"], "entities": ["PromptShrink", "Heloisa Pe Garcia", "OpenAI", "Anthropic", "Gemini", "ChatGPT", "Claude.ai", "Google AI Studio"], "alternates": {"html": "https://wpnews.pro/news/promptshrink", "markdown": "https://wpnews.pro/news/promptshrink.md", "text": "https://wpnews.pro/news/promptshrink.txt", "jsonld": "https://wpnews.pro/news/promptshrink.jsonld"}}