yetone/magpie

GITHUB中文整理

主语言 Go · 18,669 星 · MIT · 创建于 2026-09-24

模型路由本地网关智能体账号管理用量统计
打开 GitHub 仓库

一个本地 AI 模型路由与账号管理工具,通过菜单栏应用和本地网关,让多种编程智能体(Agent)统一使用不同厂商的模型与订阅账号。

Stars 18,669 累计 star,越多说明被认可得越广
Watching — 订阅该仓库变动的人数
Forks 1,371 被派生出去的仓库数
Issues 0 当前开放的 Issue 数
语言 Go GitHub 自动判定的主语言
许可证 MIT 开源协议,用之前先确认能不能商用
24h 增长 +0 1 天前 18,669 星
7 日增长 +0 7 天前 18,669 星
30 日增长 — 数据积累中

仓库健康度

5 个维度
只看客观信号,不构成安全性结论
维护活跃度 数据完整
2026-10-21 19:59 最近推送

最近推送 2026-10-21 19:59(10 天前),属于活跃维护

社区响应 部分数据
— 开放 Issue

Fork 1,371 个;开放 Issue 数本轮没采到

增长趋势 部分数据
+0 7 日新增

24 小时 +0 · 7 日 +0 · 30 日 积累中

项目规范 数据完整
MIT 许可证

许可证 MIT · 6 个 topics

版本发布 证据不足
— 发布次数

这一项暂无数据,不代表项目没有发布

「证据不足」表示这项数据暂时没有取到,不能读成「项目有问题」;「部分数据」表示只拿到一部分信号。版本发布要额外调 Releases 接口,下一版补。

Star 趋势

10 天记录
最近 90 天站内记录的星数
18,669当前 Star +0首尾差值 2026-10-23最早记录 2026-11-01最近记录

横轴 2026-10-23 → 2026-11-01,纵轴按这段时间的最小/最大值拉伸。趋势来自站内每天记录一次的星数,页面打开时不会实时请求 GitHub。

它解决什么问题

据 README 归纳
没有它会怎样

每个编程智能体各自在独立配置文件里保存模型、密钥和接入地址,付费订阅往往只能在一个工具里使用,换模型要逐个改配置,额度用尽还会直接报错中断。没有它,多智能体、多供应商、多账号的用户只能手动维护一堆配置,成本与额度也难以集中查看。

核心能力

7 条
归纳自 README,不是功能列表照抄
  1. 1从统一列表中为任意智能体挑选模型,自动改写其自身配置中的关键项
  2. 2把同一账号或密钥复用到多个工具,覆盖 API、本地模型和已登录订阅
  3. 3额度耗尽时按路由组自动切换到下一个账号或模型,对智能体隐藏报错
  4. 4统计 token、缓存读写、推理与调用次数,并按标价或自定价格核算成本
  5. 5查看各密钥、套餐与账号的余额和额度窗口,并在额度将浪费时提醒
  6. 6列出每次对话的花费与标题,可一键在终端中重新打开该会话
  7. 7展示请求上下文窗口占用、缓存命中占比,并支持导出到自有观测系统

项目画像

6 个角度
决定要不要用之前,先看这六条

项目定位

一个本地 AI 模型路由与账号管理工具,通过菜单栏应用和本地网关,让多种编程智能体(Agent)统一使用不同厂商的模型与订阅账号。

适合谁

同时使用多个编程智能体、多个模型供应商或多个账号的开发者,以及在额度受限环境下需要持续运行智能体的人群;只用一个工具加厂商自带套餐的用户不需要。

典型场景

在同一台机器上让 Claude Code 使用 Kimi、Codex 使用 DeepSeek 等,把不同智能体绑定到不同模型;为编程智能体接入已付费的订阅账号,避免重复购买 API 额度;在某个账号额度耗尽时自动切换到备用账号或模型,保持会话不中断;集中查看各账号余额、会话花费与上下文占用,控制使用成本。

部署难度

安装方式包括签名并自动更新的 macOS 构建、go install、Docker 镜像和安装脚本;装好后添加供应商(选预设并填密钥或登录订阅),再到 Agents 页为每个智能体选择模型即可,前置依赖和目标智能体需已安装。

风险限制

需要本机安装目标智能体才能识别;读取订阅登录信息涉及 Claude Code 与 Codex 的配置文件及钥匙串,可在设置、命令行开关或环境变量中关闭,关闭后 API 密钥方式仍可用;防火墙环境需配置代理或镜像。

最近维护

最近一次推送是 2026-10-21 19:59。 实现方式:在本机 127.0.0.1 上运行一个网关,统一对外提供 OpenAI 兼容接口,各智能体把接入地址指向它;网关再按配置把请求转发到对应供应商,并能在额度不足时切换账号或模型。应用同时读取各智能体自身的配置和登录信息来发现订阅。

README 原文细节

3 个板块
项目自己写的功能与用法,原文照录

怎么安装从零跑起来的步骤

Quick start

Mac builds are signed and notarised, and every build updates itself. Behind a firewall, use --proxy or --mirror. Or go install github.com/yetone/magpie@latest, or the Docker image.

2 · Add a provider. Open magpie and go to Providers → Add provider. Pick a preset and paste a key, or sign in with a subscription.

3 · Pick a model for each agent on the Agents page. Start a new session and it's on the new model.

magpie finds the subscriptions your agents are signed in to by reading their sign-ins (Claude Code's and Codex's files, the Keychain). To keep it from reading them, turn off Settings → Privacy → Subscription accounts, or run magpie accounts discovery off (on turns it back on). MAGPIENOACCOUNTS=1 turns it off for one run without changing the saved setting. API-key providers work either way.

curl -fsSL https://usemagpie.ai/install.sh | sh

怎么用最典型的用法与示例

Usage and cost

  • Tokens and cost — Tokens, cache reads and writes, reasoning and calls, with cost at list price in dollars or yuan; set your own price for any model
  • Quota — Balances and quota windows for every key, plan and account (magpie quota), and a reminder before a window renews with much of it unused
  • Sessions — Every agent conversation with its cost and title, reopened in your terminal with one click
  • Context — How full each request's context window is, how much came from the cache, and what fills it
  • Bills — By account and by upstream key, and OTLP export to your own observability stack

其它说明README 里剩下的内容

Is magpie for you?

Each agent keeps its model in its own file, in its own format, with its own keys and base URLs. A subscription you pay for works in one agent and nowhere else. magpie puts all of that behind one app and one local gateway:

It's for you if you use more than one agent, more than one provider, or more than one account. If you use one agent on its vendor's own plan and that's enough, you don't need it.

Runs on macOS, Windows and Linux (menu bar app, window, TUI, web UI and CLI), in Docker, and on Termux.

  • Pick any model for any agent from one list. magpie edits the one key that matters in the agent's own config.
  • Use one provider everywhere: an API key, a local model, or the Claude, ChatGPT, Copilot, Gemini or Grok plan you're signed in to.
  • Keep going when a quota runs out: a routing group moves to the next account or model, and the agent never sees the error.

Subscriptions

An agent you're signed in to is a subscription with models behind it, so magpie offers it as a provider to every other agent. Add several accounts per subscription and magpie fails over between them.

Daily warm-up starts each Claude and ChatGPT account's 5-hour window at the times you choose, or the moment the last one resets.

  • Claude: drives the real local claude binary and bridges your agent's tools over MCP
  • Codex / ChatGPT: your ChatGPT plan's models, in every other agent
  • GitHub Copilot, Gemini (Code Assist), Antigravity, Grok (SuperGrok) and more
  • Any OpenCode auth plugin or pi package from npm

Every agent's model. One place.

Claude Code on Kimi. Codex on DeepSeek. Gemini CLI on GLM. OpenCode on your ChatGPT plan. Switch any of them from the menu bar. One local gateway serves them all, and when a quota runs out, it quietly moves on to the next account.

关于 magpie 的常见问题

7 个问题
答案来自 README 归纳与 GitHub 实时数据
magpie 是做什么的?

一个本地 AI 模型路由与账号管理工具,通过菜单栏应用和本地网关,让多种编程智能体(Agent)统一使用不同厂商的模型与订阅账号。 每个编程智能体各自在独立配置文件里保存模型、密钥和接入地址,付费订阅往往只能在一个工具里使用,换模型要逐个改配置,额度用尽还会直接报错中断。没有它,多智能体、多供应商、多账号的用户只能手动维护一堆配置,成本与额度也难以集中查看。

magpie 有哪些功能?

核心能力:从统一列表中为任意智能体挑选模型,自动改写其自身配置中的关键项;把同一账号或密钥复用到多个工具,覆盖 API、本地模型和已登录订阅;额度耗尽时按路由组自动切换到下一个账号或模型,对智能体隐藏报错;统计 token、缓存读写、推理与调用次数,并按标价或自定价格核算成本;查看各密钥、套餐与账号的余额和额度窗口,并在额度将浪费时提醒;列出每次对话的花费与标题,可一键在终端中重新打开该会话;展示请求上下文窗口占用、缓存命中占比,并支持导出到自有观测系统。

magpie 适合谁用?

同时使用多个编程智能体、多个模型供应商或多个账号的开发者,以及在额度受限环境下需要持续运行智能体的人群;只用一个工具加厂商自带套餐的用户不需要。

magpie 是怎么工作的?

在本机 127.0.0.1 上运行一个网关,统一对外提供 OpenAI 兼容接口,各智能体把接入地址指向它;网关再按配置把请求转发到对应供应商,并能在额度不足时切换账号或模型。应用同时读取各智能体自身的配置和登录信息来发现订阅。

怎么安装 magpie?

按项目 README 的说明:Mac builds are signed and notarised, and every build updates itself. Behind a firewall, use --proxy or --mirror. Or go install github.com/ye;2 · Add a provider. Open magpie and go to Providers → Add provider. Pick a preset and paste a key, or sign in with a subscription.。完整命令见下方「怎么安装」一节或 GitHub 仓库的 README。

用 magpie 有什么门槛或限制?

需要本机安装目标智能体才能识别;读取订阅登录信息涉及 Claude Code 与 Codex 的配置文件及钥匙串,可在设置、命令行开关或环境变量中关闭,关闭后 API 密钥方式仍可用;防火墙环境需配置代理或镜像。

magpie 现在还在维护吗?数据怎么样?

目前 18,669 星,1,371 个 Fork,主语言 Go,创建于 2026-09-24,最近一次推送 2026-10-21 19:59,许可证 MIT。星数、Fork、推送时间都是 GitHub 返回的实时数据,「最近推送」离现在越近说明越活跃;长期不动要留意是否已停止维护。

这些内容来自哪

读法说明
中文整理据 README 归纳,数据取自 GitHub
中文说明据项目 README 归纳只写 README 能确认的内容,不替作者补功能与数字
关键数据与 GitHub 页面一致星数、Fork、语言与时间都不做二次加工
数据日期2026-10-22 10:13星数与介绍这份数据是哪一天的

项目数据取自 GitHub 官方接口与项目 README;星数、Fork、语言与时间以 GitHub 页面为准,档案更新于 2026-10-22 10:13。