Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyAI, memory and agents

llmtrim

Lets your AI tools send smaller LLM requests through a local proxy that compresses prompts and tool output to cut token cost.

267 stars on GitHubby fkieneLicense MPL-2.0Updated 21 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add llmtrim -- npx -y @llmtrim/cli mcp

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Show my token savings this week.
Check that llmtrim is working and fix anything broken.

What it is

llmtrim runs as a local proxy that trims wasted tokens from prompts, history, tool output and code before they reach the provider, then forwards a smaller request. The answers stay the same. It is also an MCP server, a command-line tool and an embeddable library.

What it can do

  • llmtrim setup: start the local proxy and wire your shell
  • llmtrim status: savings and health
  • llmtrim compress: compress a request body
  • llmtrim doctor: diagnose and repair
  • llmtrim recall: restore omitted tool results
  • /sub for Claude Code through CLIProxyAPI

When to use

  • β€ΊWhen you use Claude Code, Codex or Cursor and want a smaller token bill
  • β€ΊWhen tool output such as long build logs fills your context
  • β€ΊWhen you want to measure how many tokens you save per day

What you need

Node.js with npm (npm install -g @llmtrim/cli, then llmtrim setup), or Homebrew, curl, Scoop, Cargo or Docker. It sets a private CA, shell proxy variables and a login service.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free?

The readme shows an open license badge and does not list any fee. It runs on your machine and nothing is sent to the project.

Can it break my requests?

The readme says each stage is re-measured with the provider's tokenizer and undone if it does not save tokens, and the original is resent if the provider rejects the compressed body.

Which tools work with it?

Anything that honors HTTPS_PROXY, such as Claude Code, Codex, Cursor and Aider. GitHub Copilot does not work.

What does setup change?

A private name-constrained CA in ~/.llmtrim/, shell variables for the proxy, and a login service. llmtrim uninstall reverses all three.

Does it store my prompts?

Prompts never touch disk, only anonymous token counts. Recoverable tool results stay in daemon memory for five hours by default.

What savings does it claim?

About 31 percent less input and 74 percent less output in 112 live A/B cases, according to its own measurements.

If it does not work

  • β€ΊOpen a new terminal after setup so the proxy variables apply.
  • β€ΊRun llmtrim doctor --fix or llmtrim ensure if something stops working after an upgrade.
  • β€ΊUse llmtrim wrap claude to force a single session through llmtrim.

5 new skills a week. 1 minute to read.