← Back to directory
L

llmtrim

Community
Compress LLM requests to reduce token use.
Category
Dev Tools #478 of 751
Stars
★ 280 Very popular
Transport
stdio (local process)
Runtime
Node.js · Prebuilt binary
Credentials
No credential needed
License
MPL-2.0
Last commit
Tools
3
48FMRS · D

The supplied material describes llmtrim as a local LLM request compression tool with an MCP interface. It suits development workflows seeking lower token use; savings and answer quality depend on the request and configuration.

Strongest · Documentation 12/20 Weakest · Maintenance 7/20

Reliability
8/20
Security and permissions
10/20
Maintenance
7/20
Documentation
12/20
Setup experience
11/20
Why each score
Reliability 8/20
The README names three stdio MCP tools—llmtrim_compress, llmtrim_compress_text, and llmtrim_stats—and shows a client configuration. The supplied material contains no evidence of an executed MCP initialization or tool-list handshake, CI workflow, or tests covering key server paths; the manifest version is also 0.0.0. Startup and error handling therefore remain unverified. The happy path is plausible but thinly evidenced, so the score stays below 12 under the static calibration.
Security and permissions 10/20
The README claims the proxy runs locally, does not store API keys, and does not write prompts to disk; it also describes a private name-constrained CA, bounded in-memory retention, and an upstream proxy. It additionally describes TLS interception, cached tool results, an optional capture directory, and subscription routing. The supplied material does not independently verify these data boundaries or specify MCP tool permissions and confirmation for dangerous operations. Main risks are disclosed, but least privilege and confirmation are not established. No red-line evidence is present.
Maintenance 7/20
The repository is marked MPL-2.0 and not archived; the README displays a CI badge and describes multiple installation channels and an update command. The supplied material does not verify recent releases, commit cadence, issue response, dependency updates, or a security-response channel. The manifest version is 0.0.0, leaving maintenance continuity and version governance unclear, so the score is limited.
Documentation 12/20
The README provides several installation options, MCP configuration and tool names, configuration settings, limitations, benchmark methodology, and troubleshooting commands. Deductions reflect the absence of MCP tool parameter and return schemas, a clear authentication boundary, and reviewable server tests in the supplied material. Some performance and quality claims appear only as README assertions and cannot be independently verified from the supplied sources.
Setup experience 11/20
The README gives a short global npm installation and llmtrim setup path, a stdio MCP configuration for any client, and other installation channels. Deductions reflect missing complete runtime requirements, no step-by-step verified connection in a specific mainstream client, a manifest version of 0.0.0, and no execution evidence in the supplied material. Configuration appears straightforward, but cross-platform success is uncertain.

Static review · not runReviewed 2026-11-29

Read the FMRS scoring method →

Fit and risk

What it can accessUses the networkConnects to a database

Best for

  • Developers who want to compress LLM requests locally.
  • Users who want to call compression features or view statistics through an MCP client.

Not for

  • Users who need guaranteed token savings or unchanged answers for every workload.
  • Users who need model replies to be restored or reverse-transformed.

Required permissions

  • The example configuration launches the local `llmtrim mcp` command over stdio; specific runtime file or system permissions are not stated in the supplied material.
  • The supplied MCP configuration shows no credential or additional permission settings.

Risks and side effects

  • The README says the default automatic configuration can enable lossy compression; the `safe` preset is available for lossless input compression only.
  • According to the README, compression stages remeasure token counts and revert transformations that do not save tokens; if an upstream provider rejects a compressed request, the original is resent.
  • The README says Anthropic and Gemini token counts are approximate. Its reported output savings come from offline A/B benchmarks, not live proxy statistics.

Setup

Before you start

Runtime:Node.js · Prebuilt binary

LLMTRIM_UPSTREAM_PROXY optionalsecret Optional upstream proxy address; credentials can be included in the address if needed.
LLMTRIM_CLIPROXY_KEY optionalsecret Optional CLIProxyAPI key; obtain it from the existing instance's configuration.
Other optional settings (18)
LLMTRIM_PRESET optional Optional compression preset; can be set to auto, safe, or aggressive.
LLMTRIM_CONFIG optional Optional path to the configuration file.
LLMTRIM_EXTRA_HOSTS optional Optional exact LLM API hostnames to intercept.
LLMTRIM_EXCLUDE_PROVIDERS optional Optional provider shapes to skip compressing, such as openai, anthropic, or google.
LLMTRIM_EXCLUDE_HOSTS optional Optional exact hostnames to skip compressing.
LLMTRIM_DB_PATH optional Optional location for the usage ledger.
LLMTRIM_CAPTURE_DIR optional Optional directory for before-and-after QA captures.
LLMTRIM_CAPTURE_MAX_MB optional Optional capture size limit; set to 0 to disable captures.
LLMTRIM_FIRST_ARRIVAL_RECALL optional Optionally enables recoverable first-arrival tool-output shaping; off by default.
LLMTRIM_TOOL_OUTPUT optional Optionally skips tool-output compression for matching commands; accepts passthrough or command globs.
LLMTRIM_FIRST_ARRIVAL_RECALL_TTL_SECS optional Optional in-memory lifetime for raw results, defaulting to 18000 seconds.
LLMTRIM_BIND optional Optional listening IP; defaults to loopback.
LLMTRIM_BREAKDOWN_WINDOW optional Optional context-window override for the cost breakdown.
LLMTRIM_RETENTION_DAYS optional Optional number of days to retain ledger data.
LLMTRIM_NO_UPDATE_CHECK optional Optionally disables the passive update check.
LLMTRIM_SUB optional Optional configuration for Claude Code subscription rerouting.
LLMTRIM_SUB_MODE optional Optional subscription rerouting mode.
LLMTRIM_CLIPROXY_URL optional Optional URL of an existing CLIProxyAPI instance.

Install the llmtrim CLI, add the example JSON configuration to an MCP-capable client, and ensure the client can find the llmtrim command. The README also offers llmtrim mcp install and llmtrim mcp install --print as configuration methods.

MCP config · JSON
{"mcpServers":{"llmtrim":{"command":"llmtrim","args":["mcp"]}}}

Works in clients that read an "mcpServers" key. For clients such as VS Code that use a different key, the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "llmtrim": {
      "command": "llmtrim",
      "args": [
        "mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

~/.codex/config.toml
[mcp_servers.llmtrim]
command = "llmtrim"
args = ["mcp"]

Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).

Terminal
claude mcp add llmtrim -- llmtrim mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Confirm llmtrim_compress, llmtrim_compress_text, and llmtrim_stats appear in your MCP client's tool list. Calling llmtrim_stats should confirm the connection and statistics tool are working.

Troubleshooting

  1. Check that the client can find the `llmtrim` executable and is passing the `mcp` argument.
  2. The README suggests running `llmtrim doctor` for diagnostics or `llmtrim status` to check health and statistics.

Things to try

Once connected, you can ask your AI assistant things like:

  • Compress this LLM request to reduce tokens: …
  • Shorten this text while preserving useful information: …
  • Show me the llmtrim savings statistics.

Tools 3

llmtrim_compress read-only
Compress an LLM request.
llmtrim_compress_text read-only
Compress text.
llmtrim_stats read-only
View token savings statistics; it uses the same ledger as the status command.

Use cases

Reduce token use by compressing prompts and tool output.
Call compression or statistics tools from an MCP client.

Overview

llmtrim is an MCP server that also provides a CLI, libraries, and a local proxy for compressing LLM prompts, tool output, and replies to reduce token use. The README reports measurements from 112 live A/B cases; results depend on the request and configuration.

Similar servers

Source revision 20edd00aecaf Data synced 2026-12-05 Read the FMRS scoring method Markdown

Maintainer badge: embed FMRS score

Paste this Markdown into your repository README to display a live score badge:

README.md
[![FollowMCP](https://followmcp.com/badges/llmtrim.svg)](https://followmcp.com/en/servers/llmtrim)