Best for
- Developers who want to compress LLM requests locally.
- Users who want to call compression features or view statistics through an MCP client.
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
Static review · not runReviewed 2026-11-29
Read the FMRS scoring method →Runtime:Node.js · Prebuilt binary
LLMTRIM_UPSTREAM_PROXY
Optional upstream proxy address; credentials can be included in the address if needed.
LLMTRIM_CLIPROXY_KEY
Optional CLIProxyAPI key; obtain it from the existing instance's configuration.
LLMTRIM_PRESET
Optional compression preset; can be set to auto, safe, or aggressive.
LLMTRIM_CONFIG
Optional path to the configuration file.
LLMTRIM_EXTRA_HOSTS
Optional exact LLM API hostnames to intercept.
LLMTRIM_EXCLUDE_PROVIDERS
Optional provider shapes to skip compressing, such as openai, anthropic, or google.
LLMTRIM_EXCLUDE_HOSTS
Optional exact hostnames to skip compressing.
LLMTRIM_DB_PATH
Optional location for the usage ledger.
LLMTRIM_CAPTURE_DIR
Optional directory for before-and-after QA captures.
LLMTRIM_CAPTURE_MAX_MB
Optional capture size limit; set to 0 to disable captures.
LLMTRIM_FIRST_ARRIVAL_RECALL
Optionally enables recoverable first-arrival tool-output shaping; off by default.
LLMTRIM_TOOL_OUTPUT
Optionally skips tool-output compression for matching commands; accepts passthrough or command globs.
LLMTRIM_FIRST_ARRIVAL_RECALL_TTL_SECS
Optional in-memory lifetime for raw results, defaulting to 18000 seconds.
LLMTRIM_BIND
Optional listening IP; defaults to loopback.
LLMTRIM_BREAKDOWN_WINDOW
Optional context-window override for the cost breakdown.
LLMTRIM_RETENTION_DAYS
Optional number of days to retain ledger data.
LLMTRIM_NO_UPDATE_CHECK
Optionally disables the passive update check.
LLMTRIM_SUB
Optional configuration for Claude Code subscription rerouting.
LLMTRIM_SUB_MODE
Optional subscription rerouting mode.
LLMTRIM_CLIPROXY_URL
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.
{"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.
{
"servers": {
"llmtrim": {
"command": "llmtrim",
"args": [
"mcp"
]
}
}
}
Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).
[mcp_servers.llmtrim] command = "llmtrim" args = ["mcp"]
Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).
claude mcp add llmtrim -- llmtrim mcp
Run it in a terminal; replace any <…> placeholders with your own values first.
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.
Once connected, you can ask your AI assistant things like:
No matching tools
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.
Connect code, docs, and infrastructure in a local knowledge graph.
Docker's official MCP gateway CLI plugin for managing and running MCP servers.
Fast, low-cost structured judgments for agents.
Local call graphs and structural analysis for Go repositories.
Source revision 20edd00aecaf Data synced 2026-12-05 Read the FMRS scoring method Markdown