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

  • mux_dispatch — Send a task to a model and get structured results
    • provider: "auto" / "codex" / "gemini" / "claude" / "ollama"
    • task: The prompt to send
    • workdir, 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


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.26.1.tar.gz (156.5 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.26.1-py3-none-any.whl (107.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: modelmux-0.26.1.tar.gz
  • Upload date:
  • Size: 156.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for modelmux-0.26.1.tar.gz
Algorithm Hash digest
SHA256 565a080754c8a99c56f277420d2f89a6ec7a193849550f357217c0eac9d273f4
MD5 92f5fc91d0d0c5e9d65467ef36aa6ff4
BLAKE2b-256 f7db9f80829fcdf8ba98ce7f6d27efabd7ef55af83473f1fddd6f2ccec6888bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelmux-0.26.1.tar.gz:

Publisher: publish.yml on pure-maple/modelmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: modelmux-0.26.1-py3-none-any.whl
  • Upload date:
  • Size: 107.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for modelmux-0.26.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19db929b4e02576f1fb023b57ab6b2b1068d98d1ac023c4f0f058dcf3d8d5a84
MD5 d49b289ef6c4a83a7a27ad006a46a2e6
BLAKE2b-256 102c32d84d60e9f0894e8dd9e130080ac27d34934f8cee1b157d459fc1588fa3

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelmux-0.26.1-py3-none-any.whl:

Publisher: publish.yml on pure-maple/modelmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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