TEST 001 · comment TRIM · 2026-11-02

llmtrim: −16.5% tokens, still off

A free, open-source local proxy that compresses every request before it reaches the AI API. I ran it on my own agent to see if it's worth keeping.

fkiene/llmtrim · MPL-2.0

VERDICT

LATER
Sameanswers
−16.5%input tokens
+12 msper call

What it is

llmtrim sits between your AI tool (Claude Code, Codex, Cursor, your own app) and the provider’s API. Before each request goes out, it compresses the bulky parts: tool output, chat history, code and JSON. Then it forwards the smaller request, and the reply comes back unchanged.

How I tested it

I routed my own AI agent through it on a direct Anthropic API key and ran the same three read-only, real-world tasks with and without it: 9 API calls in all.

Measure Without With llmtrim
Input tokens 251,703 210,108 (−16.5%)
Answers Same on all 3 tasks
Extra latency About 12 ms per call

Token counts through a proxy are estimates, and savings swing a lot by session, so measure on your own fixed set of tasks. The author reports −31% input tokens across 112 A/B cases; those are the author’s numbers, on a different mix of requests.

Why it’s LATER for me

  1. Every call runs through it, API key included. It doesn’t store keys, but it installs a private certificate so it can read requests in transit (scoped to AI API hosts only).
  2. It’s a single point of failure. If the proxy breaks, every call breaks.
  3. Most of my tokens were already cached. Cached input is billed at a fraction of the price, so my real money saved was small.

Worth trying if you pay full price per token and don’t use prompt caching much, for example a custom app or agent calling the API directly.

Safe setup, step by step

Start in safe mode: lossless compression only. The default auto mode saves more, but some of its stages are lossy. In the author’s own benchmark, one maths test dropped from 100% to 92%.

  1. Measure first. Pick 3 real tasks you run often and note the tokens each one uses today.
  2. Install it.
    npm install -g @llmtrim/cli@latest
  3. Set it up. llmtrim setup adds a private certificate in ~/.llmtrim/, your shell’s HTTPS_PROXY setting and a login service. To keep it to one app, set the proxy only in that app’s environment.
    llmtrim setup
  4. Switch to safe mode. Or add preset = "safe" to ~/.config/llmtrim/config.toml.
    export LLMTRIM_PRESET=safe
  5. Check it’s capturing traffic.
    llmtrim doctor
  6. Re-run your 3 tasks and compare tokens and answers. llmtrim status shows the savings.
  7. Keep it only if the saving is clear. Otherwise remove everything in one command:
    llmtrim uninstall

Commands checked against the project’s README on 2026-11-02. GitHub Copilot doesn’t work through it (certificate pinning).

From the reel

Reel frame: one request from your agent, squeezed by llmtrimReel frame: the results, same answers and −16.5% input tokensReel frame: why I switched it offReel frame: the LATER verdict

Would it pay off for you?

My test cut 16.5% of input tokens. Cached tokens barely cost anything, so the saving only counts on the rest. Put in your numbers.

ESTIMATED SAVING

$9.90

a month. Small, but measurable.