TwoTrim is an open-source prompt compression middleware for LLM applications.
It sits between your app and any LLM API — OpenAI, Anthropic, or any OpenAI-compatible endpoint — and removes the tokens your model doesn't need
before the request is sent. Your code doesn't change. Your costs do.
What it does:
→ Strips filler words, redundant sentences, and formatting noise (lossless)
→ Semantic sentence scoring + Lost-in-the-Middle reordering (balanced)
→ BART summarization for long documents (aggressive)
→ FAISS semantic cache — works on similar queries, not just identical ones
What makes it different:
→ CPU-only. No GPU infrastructure required.
→ Zero refactoring — drop-in base_url swap for any OpenAI-compatible client
→ Works across providers via LiteLLM, vLLM, and more
→ Honest benchmarks. The results where it fails are published too.
Works best on: document summarization, long-context tasks, and high-volume chatbot/support systems with repeated queries.
Does not work well on: extreme multi-hop RAG at aggressive compression.
Full benchmark data is public in the repo.
Open source. Apache 2.0. Free forever.
github.com/overseek944/twotrim
About TwoTrim on Product Hunt
“Cut LLM API costs by 65%. No GPU. No code changes.”
TwoTrim was submitted on Product Hunt and earned 2 upvotes and 1 comments, placing #179 on the daily leaderboard. TwoTrim — The Mathematical Prompt Compression Fabric for LLM APIs. Cut up to 65% of your AI token costs without losing accuracy.
On the analytics side, TwoTrim competes within Developer Tools, Artificial Intelligence, GitHub and Community — topics that collectively have 1M followers on Product Hunt. The dashboard above tracks how TwoTrim performed against the three products that launched closest to it on the same day.
Who hunted TwoTrim ?
TwoTrim was hunted by TwoTrim. A “hunter” on Product Hunt is the community member who submits a product to the platform — uploading the images, the link, and tagging the makers behind it. Hunters typically write the first comment explaining why a product is worth attention, and their followers are notified the moment they post. Around 79% of featured launches on Product Hunt are self-hunted by their makers, but a well-known hunter still acts as a signal of quality to the rest of the community. See the full all-time top hunters leaderboard to discover who is shaping the Product Hunt ecosystem.
For a complete overview of TwoTrim including community comment highlights and product details, visit the product overview.