muxlayer v2.0.0
muxlayer --status
running on 127.0.0.1:9090 · v2.0.0 · 25+ model providers

The local model control
layer for coding agents.

Coding Agent 的本地模型控制层。

Formerly AgentGate

MuxLayer is a local AI gateway for AI apps and clients, including Codex, Claude Code, Gemini CLI, OpenCode, AtomCode, and apps compatible with OpenAI, Anthropic, or Gemini protocols. It routes each request to the model you choose, fails over automatically when a provider breaks, traces everything locally, and bridges protocol differences across OpenAI-compatible providers. On macOS and Windows, it also prevents long-running AI tasks from being interrupted by automatic sleep.

$ AI apps Codex · Claude Code · Gemini CLI · OpenCode · AtomCode
$ upstream OpenAI · Anthropic · DeepSeek · Kimi · GLM · Copilot 25+ total
muxlayer · demo
MuxLayer demo
man muxlayer

What it does.

// 它到底做了什么。

# original experience intact

Codex / Claude Code / OpenCode / Gemini CLI / AtomCode keep their original behavior. Codex Desktop plugins, Claude Code settings, Copilot quota — none get broken. One-click restore to official config.

Codex 的插件、Claude Code 的设置、Copilot 的额度都不会乱。一键恢复官方。

# your model entry

Model requests enter MuxLayer. You decide protocol conversion, passthrough, provider, and model — 25+ model providers, multi-key rotation, automatic failover. All locally.

官方接口进 MuxLayer,本地决定转换 / 直连 / 选 provider / 选模型。25+ 家模型供应商、多 key 轮询、故障自动切换。

# every request observable

Routing decisions, protocol conversion, errors, token counts, cost, failover — all auditable in the local dashboard. Which request went where, cost how much, why it failed over — all on record.

路由、转换、错误、token、成本、故障转移 —— 都在本地面板可追踪。

# long tasks stay running

On macOS and Windows, MuxLayer prevents automatic system sleep by default while still allowing the display to turn off. Switch to request-aware control or use the system tray for quick toggles.

macOS 和 Windows 默认防休眠,也可按 AI 请求智能控制,并从托盘快速切换。

# automatic legacy adoption · v2.0.0

Existing desktop installations keep their update identity and application data. New headless installs use ~/.muxlayer, while an existing ~/.agentgate database or token is adopted automatically.

MUXLAYER_DB_PATH and MUXLAYER_TOKEN are preferred, while the legacy AGENTGATE_* aliases continue to work for rollback-safe upgrades.

// 新版本自动接管老数据,旧目录和环境变量仍可回滚使用。

MuxLayer is not a hosted API reseller. It is a local-first desktop entry point for AI model requests. It gives you provider flexibility without breaking client-specific behavior.

不是托管 API 分发平台,是 AI 模型请求的本地桌面入口。要 provider 自由,又不愿客户端原有能力被破坏。

muxlayer --download

Download for your OS.

// 选你的系统。免费、开源,跑在你自己的机器上。

# latest v2.0.0 · recently

macOS Apple Silicon aarch64.dmg
macOS Intel x64.dmg
Windows 10 / 11 x64-setup.exe
Linux Debian / Ubuntu amd64.deb
Linux other distros amd64.AppImage

macOS via Homebrew: brew install --cask dengmengmian/tap/muxlayer

# headless CLI (agentgate-serve) 与历史版本: releases ↗

muxlayer --help

Get started.