Costs compound by default
A long session resends the same stale tokens hundreds of times. Cache fees quietly become 80%+ of your inference bill.


Compressius Maximus intelligently reduces the context sent by your AI agents, lowering token usage and API costs while preserving essential meaning, instructions, and information.
curl -fsSL https://cmx.llm.kiwi/install.sh | bashirm https://cmx.llm.kiwi/install.ps1 | iexPoint any OpenAI- or Anthropic-compatible harness at the gateway:
{ "provider": { "options": { "baseURL": "http://127.0.0.1:17322", "headers": { "cmx-provider": "openai", "cmx-harness": "opencode" } } }}cmx speaks the OpenAI and Anthropic chat protocols — if your harness can hit a base URL, it works.
Agents resend their entire history on every single turn. Old tool output, dead ends and logs ride along forever — and you pay for all of it.
Costs compound by default
A long session resends the same stale tokens hundreds of times. Cache fees quietly become 80%+ of your inference bill.
cmx compresses in the background
Stable message IDs let the model crystallize stale spans into dense summaries. The gateway rewrites requests on the fly.
Nothing about your setup changes
Same harness, same provider keys, same model. Your stored session history is never touched — only the proxied request is.
A local gateway. One hop. Zero config on the provider side.
┌──────────┐ ① every turn ┌─────────────────┐ ② only what's needed ┌──────────┐│ agent │ ───────────────▶ │ cmx gateway │ ───────────────────────▶ │ provider ││ harness │ ◀─────────────── │ 127.0.0.1:17322 │ ◀─────────────────────── │ model │└──────────┘ ③ same reply └─────────────────┘ ④ compressed req. └──────────┘ │ ▼ ⑤ summaries stored locally in SQLiteMeasured end-to-end on real sessions with the production gateway — not lab conditions.
46% context cut
Live end-to-end smoke test: a 1,164-token context rewritten down to 628 tokens on the compressed turn — and larger sessions save more.
Cache-aware
Compression only fires when projected savings repay the one-time cache-rewrite cost — usually within 2–3 turns.
Private by default
Conversations and summaries stay in SQLite on your machine. Optional cloud features use only documented aggregate counters; only your provider sees your prompts.
The things people ask before pointing their agent at a gateway.
Getting cmx running with your stack.
What gets compressed and when.
Where your data lives and what it costs.
Everything else you need to run cmx day to day.
How it works
Message IDs, the compress tool, summary nesting and cache economics — the full mechanics. Read the mechanics →
Configuration
Thresholds, summarizer models, protected tools, retention — every knob explained. Configure cmx →
Dashboard
Terminal UI plus optional hosted dashboard: savings, sessions, summaries and cache stats at a glance. See the dashboards →
One command installs the gateway. Your harness, provider and model all stay the same.