Configuration
Config lives at ~/.config/cmx/config.json (Windows:
%AppData%\cmx\config.json). It is created with defaults on first run; edit
and run cmx restart to apply.
{ "gateway": { "host": "127.0.0.1", "port": 17322 }, "web": { "enabled": true, "port": 17323 }, "providers": { "openai": { "base_url": "https://api.openai.com/v1" }, "anthropic": { "base_url": "https://api.anthropic.com" }, "openrouter":{ "base_url": "https://openrouter.ai/api/v1" }, "groq": { "base_url": "https://api.groq.com/openai/v1" }, "deepseek": { "base_url": "https://api.deepseek.com/v1" }, "moonshot": { "base_url": "https://api.moonshot.cn/v1" }, "zai": { "base_url": "https://api.z.ai/api/paas/v4" } }, "compression": { "enabled": true, "min_context_tokens": 60000, "keep_recent_tokens": 24000, "summarizer_model": "", "nudge_frequency": 5, "protected_tools": ["task", "skill", "todowrite", "todoread", "write", "edit"] }, "logging": { "enabled": true, "retention_days": 14 }}gateway
Section titled “gateway”| Key | Default | Meaning |
|---|---|---|
host |
127.0.0.1 |
bind address — keep it local |
port |
17322 |
gateway port |
| Key | Default | Meaning |
|---|---|---|
enabled |
true |
serve the web dashboard |
port |
17323 |
dashboard port |
providers
Section titled “providers”Map of cmx-provider header values → upstream base_url. The dialect is
detected per request from the path (/v1/messages → Anthropic-style,
/v1/chat/completions → OpenAI-style), so one provider entry can serve
either. If the header is missing, cmx guesses from the Authorization
scheme and host.
compression
Section titled “compression”| Key | Default | Meaning |
|---|---|---|
enabled |
true |
master switch — when off, cmx is a pure transparent proxy |
min_context_tokens |
60000 |
context size above which nudges are appended |
keep_recent_tokens |
24000 |
tail of recent context never compressed or ID-tagged |
summarizer_model |
"" |
model for summary calls; empty = same model as the session. Set a cheap one (e.g. gpt-4o-mini) to minimize summarization cost |
nudge_frequency |
5 |
append a compress reminder every N requests while above threshold |
protected_tools |
see above | messages using these tools are never compressed |
logging
Section titled “logging”| Key | Default | Meaning |
|---|---|---|
enabled |
true |
store full request payloads (original bodies) locally in SQLite for stats and debugging |
retention_days |
14 |
payloads older than this are purged hourly; stats aggregates are kept |
