Model multiplexer — unified MCP server for cross-platform multi-model AI collaboration
Project description
modelmux
Model multiplexer — unified MCP server for cross-platform multi-model AI collaboration.
Route tasks to Codex CLI, Gemini CLI, and Claude Code CLI through a single MCP interface with smart routing and caller auto-detection.
Install
# One-command install for Claude Code
claude mcp add modelmux -s user -- uvx modelmux
# Codex CLI (~/.codex/config.toml)
# [mcp_servers.modelmux]
# command = "uvx"
# args = ["modelmux"]
# Gemini CLI (~/.gemini/settings.json)
# {"mcpServers": {"modelmux": {"command": "uvx", "args": ["modelmux"]}}}
Tools
mux_dispatch— Send a task to a model and get structured resultsprovider:"auto"/"codex"/"gemini"/"claude"/"ollama"task: The prompt to sendworkdir,sandbox,session_id,timeout,model,profile,reasoning_effort,failover
mux_check— Check which CLIs are available, show detected caller and config
Smart Routing
provider="auto" routes tasks by keyword analysis and auto-excludes the calling platform:
From Claude Code → routes to Codex or Gemini (never back to Claude)
From Codex CLI → routes to Claude or Gemini (never back to Codex)
Failover
When a provider fails at execution time, modelmux automatically retries with the next available provider (enabled by default, failover=True). Failover is skipped for session-based requests since sessions are provider-specific.
Audit & Policy
Every dispatch call is logged to ~/.config/modelmux/audit.jsonl for debugging and cost tracking.
Policy enforcement via ~/.config/modelmux/policy.json:
{
"blocked_providers": ["gemini"],
"blocked_sandboxes": ["full"],
"max_timeout": 600,
"max_calls_per_hour": 30,
"max_calls_per_day": 200
}
mux_check() now shows policy summary and audit stats.
User Configuration
Create .modelmux/profiles.toml or ~/.config/modelmux/profiles.toml:
[routing]
default_provider = "codex"
[[routing.rules]]
provider = "gemini"
[routing.rules.match]
keywords = ["frontend", "react", "css"]
[profiles.budget]
[profiles.budget.providers.codex]
model = "gpt-4.1-mini"
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modelmux-0.29.0.tar.gz.
File metadata
- Download URL: modelmux-0.29.0.tar.gz
- Upload date:
- Size: 198.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e65cd921fd7d2634e3b272d6acdf2f30dc0783ba8f0a0584ab9b18f33dd208c1
|
|
| MD5 |
47a3930c14de89d5d7e86735a590ffbd
|
|
| BLAKE2b-256 |
9d8c9cf130501f8c72f60fb0453cd024280a9773e2335f69520be3d0703374e3
|
Provenance
The following attestation bundles were made for modelmux-0.29.0.tar.gz:
Publisher:
publish.yml on pure-maple/modelmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelmux-0.29.0.tar.gz -
Subject digest:
e65cd921fd7d2634e3b272d6acdf2f30dc0783ba8f0a0584ab9b18f33dd208c1 - Sigstore transparency entry: 1054167034
- Sigstore integration time:
-
Permalink:
pure-maple/modelmux@16e8f03906f28546d8bdfc80f870aaa102212344 -
Branch / Tag:
refs/tags/v0.29.0 - Owner: https://github.com/pure-maple
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16e8f03906f28546d8bdfc80f870aaa102212344 -
Trigger Event:
push
-
Statement type:
File details
Details for the file modelmux-0.29.0-py3-none-any.whl.
File metadata
- Download URL: modelmux-0.29.0-py3-none-any.whl
- Upload date:
- Size: 116.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3aa45133dba1a3d6f562ea1c09225476f84a762b109b5970b57b8020367fbdb
|
|
| MD5 |
03ae890799e93e4371b43c4d18e7ee65
|
|
| BLAKE2b-256 |
cb5035928de5704e71be72c1ff3f2581d9eda93dc4f6762886618de8497f54cb
|
Provenance
The following attestation bundles were made for modelmux-0.29.0-py3-none-any.whl:
Publisher:
publish.yml on pure-maple/modelmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modelmux-0.29.0-py3-none-any.whl -
Subject digest:
e3aa45133dba1a3d6f562ea1c09225476f84a762b109b5970b57b8020367fbdb - Sigstore transparency entry: 1054167103
- Sigstore integration time:
-
Permalink:
pure-maple/modelmux@16e8f03906f28546d8bdfc80f870aaa102212344 -
Branch / Tag:
refs/tags/v0.29.0 - Owner: https://github.com/pure-maple
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16e8f03906f28546d8bdfc80f870aaa102212344 -
Trigger Event:
push
-
Statement type: