TEST 001 · tested 2026-10-27

llmtrim: the full test

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.

github.com/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.

Reel frame: one request from your agent, squeezed by llmtrim

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.

MeasureWithoutWith llmtrim
Input tokens251,703210,108 (−16.5%)
AnswersSame on all 3 tasks
Extra latencyAbout 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. Work out your saving →

Reel frame: why I switched it off

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.
    export LLMTRIM_PRESET=safe
    Or add preset = "safe" to ~/.config/llmtrim/config.toml.
  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).

The TEST 001 reel. Watch it on Instagram