返回目录
开源项目自动化与 Agent 类新手

magpie:把所有 AI Agent 的模型选择集中到菜单栏的开源工具

magpie 是一个跨平台的小体积程序(菜单栏应用 / 窗口 / TUI / 纯 CLI / Docker 服务),把机器上每个 AI Agent(Codex、Claude Code、Gemini CLI、OpenCode、Goose、Copilot CLI 等二十余种)及其当前模型列在同一屏,点击即可换模型;同时内置本地网关(127.0.0.1:3425),把 OpenAI Chat Completions、OpenAI Responses、Anthropic Messages、Google Gemini 等 API 统一成 provider/model,让多个 Agent 共用一个模型目录与一份订阅登录。MIT 许可。

0 次阅读2026/10/03 发布
magpie:把所有 AI Agent 的模型选择集中到菜单栏的开源工具 来源图片

社区作者 · zZz

它解决什么问题

magpie 的官方描述是「One place to pick every agent's model: Codex on DeepSeek, Claude Code on Kimi, Gemini CLI on GLM, from the menu bar」,官网为 usemagpie.ai。它本质上是一块「单一屏幕」:列出你机器上的每个 AI Agent 以及它当前被设定的模型,点一个值、选一个模型,这就是整个应用。

【形态】 常驻菜单栏(点击图标下拉面板),同一屏幕也能以普通窗口打开(magpie,或托盘菜单里的 Open magpie),另有终端版本(magpie tui)和纯 CLI。macOS/Linux/Windows 三平台。

【体积与写入方式】

  • 只有一个极小的二进制:含桌面应用时小于 15 MB

— 本文由 AI 根据公开来源辅助整理,命令、版本与许可证请在使用前到原始页面复核。

安装 / 开始使用

Only agents that are installed or configured are shown. Providers and the gateway Every model an agent can pick is spelled provider/model and served by magpie's gateway, so agents never hold vendor keys or vendor URLs.

Add a provider, and its models appear in every agent's picker: magpie presets # the vendors magpie knows, grouped: vendors, relays, local magpie provider add deepseek sk-… # a preset needs only the key magpie provider add ollama # local servers need none magpie provider add " My Relay " url=https://relay.

example.com/v1 key=sk-… models=gpt-5.

5,claude-sonnet-5 magpie providers # host, key, exposed models, who uses what magpie provider deepseek # one provider in detail magpie provider models deepseek # re-fetch the vendor's list (add ids to choose which to expose) magpie provider test deepseek # one tiny request per API, with latency magpie provider key deepseek sk-… # replace the key magpie provider rm deepseek magpie models # the catalog agents see magpie claude deepseek/deepseek-chat # use it Custom providers take url= (an OpenAI-compatible base), anthropic= (an Anthropic-compatible base), or both, plus responses= when the vendor has a separate Responses endpoint, catalog= to borrow a models.

dev list, and models= to name the models to expose. Anything a preset does not know can be overridden the same way.

Baidu Qianfan's Token Plans are available as baidu-qianfan : a personal (个人版) and an enterprise (企业版) plan and pay as you go, each with its own Chat Completions, Responses and Anthropic Messages endpoints, and a key that works only on its own plan.

Add it with magpie provider add baidu-qianfan <api-key> — the id it carried its first day, qianfan-token-plan , is taken too. The plans serve no model list, so the preset carries their documented models; pay as you go serves its own at /v2/models .

Routing groups A routing group is several models, from one provider or many, that an agent picks as one: group/<id> . The gateway routes each request over every member's keys and accounts together.

A model two of your providers serve under the same name becomes a group on its own; the Routing view in the app and magpie group make any other: magpie groups # yours, then those magpie found magpie group add " Opus anywhere " models=claude/claude-opus-5-5,copilot/claude-opus-5.

5 routing=order stays=session magpie group opus-anywhere # one group, its models in order magpie group set opus-anywhere models+=openrouter/anthropic/claude-opus-5.5 routing=usage magpie group set opus-anywhere models-=copilot/claude-opus-5.

5 magpie group rm opus-anywhere # one magpie found is hidden; magpie group restore <id> brings it back magpie claude group/opus-anywhere # use it routing= is smart (the default: of the subscriptions with quota to spare, the one whose allowance renews soonest first), order (the first model until it can't answer, then the next), rotate (each turn to the next member) or usage (least used first).

stays= is how long a conversation stays with the key or account that answered it: auto (the default, while the vendor's cache of it is worth keeping), session , turn or off .

models= replaces the whole list, in order; a bare model id works when only one provider serves it. The app's Import from other apps dialog can copy providers from Claude Code's settings.json ( CLAUDE_CONFIG_DIR when set) and Codex's config.

toml ( CODEX_HOME when set) into magpie. Codex imports custom [model_providers.*] entries with an inline experimental_bearer_token , including fixed headers for custom providers in [model_providers.*.http_headers] and models from [profiles.

*] or model_catalog_json . Review the entries before importing; subsequent changes to agent settings are not automatically copied to magpie. Entries that point back to magpie or only name an env_key are skipped.

Signed-in agents as providers An agent you have signed in to is a subscription with models behind it, so magpie offers it as a provider too. Claude Code (an OAuth login in the macOS Keychain or ~/.claude/.credentials.json ), Codex (a ChatGPT login in ~/.

codex/auth.json ), Copilot (a GitHub login in ~/.config/github-copilot/apps.json ), Devin ( devin auth login , kept in ~/.local/share/devin/credentials.

toml ), Qoder (signed in from magpie with its OAuth device flow) and DimAgent (signed in from magpie with its OAuth code and PKCE, on the callback its desktop client registers) — the last two kept in magpie's own config — appear in magpie providers and in the Providers tab as signed in as … , with their models spelled claude/claude-sonnet-5 , codex/gpt-5.

5 , copilot/claude-sonnet-4.5 or devin/swe-2-max in every other agent's picker.

magpie reads the agent's own credentials each time, refreshes tokens the way the agent does — writing a rotated token back where the agent will find it — and stores nothing but your model picks; sign out of the agent and the provider is gone.

The model list is the vendor's own too: magpie asks Anthropic's, Copilot's or Codex's API with that same sign-in, so a model added upstream appears on the next refresh.

The ChatGPT backend only streams and rejects a few parameters, so magpie translates non-streaming requests and drops what it would refuse.

Claude subscriptions are different: Anthropic classifies another agent's system prompt as third-party traffic even when the OAuth request otherwise looks like Claude Code.

magpie therefore drives the genuine local claude binary for every Claude subscription generation.

The caller's tools are bridged into that live turn over MCP, and tool results resume the same Claude Code process; Pi, OpenCode and every other agent use this path automatically.

The generated harness stays out of Anthropic's system-prompt classifier while its instructions remain part of the user context. This requires Claude Code to be installed and signed in. A Grok subscription (SuperGrok, signed in with Grok Build) talks straight

适用场景

学习研究
开源项目实践