Skip to main content

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

  • collab_dispatch — Send a task to a model and get structured results
    • provider: "auto" / "codex" / "gemini" / "claude"
    • task: The prompt to send
    • workdir, sandbox, session_id, timeout, model, profile, reasoning_effort
  • collab_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)

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
}

collab_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelmux-0.4.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelmux-0.4.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file modelmux-0.4.0.tar.gz.

File metadata

  • Download URL: modelmux-0.4.0.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for modelmux-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2ee83eb0d6bb4aee75e9704665aa4f1c30cbdee09526d7280e517ec8f9d1c689
MD5 d388f044ddde0db8111e072ca809f019
BLAKE2b-256 96dccefb8e1d8d7d5b72d8796da8d88e7aab3fb36a50f6813ed30c29efe8bddc

See more details on using hashes here.

File details

Details for the file modelmux-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: modelmux-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for modelmux-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14bdc11b9fee5eea66b13881ea3c5bb54f540cde8f8e97906eb43166b8aaa33b
MD5 771a21787d89cb1345f3c2a6c1d0bbdd
BLAKE2b-256 061aa7461b177176555f60093c7ca1e4de724134226fb9bfc4bc45a12f61aaad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page