Magpie: Switch Models for Claude Code and Codex from Your Menu Bar, with a Local Gateway for DeepSeek and Kimi

27 Views
No Comments

When you have Claude Code, Codex and Gemini CLI open at the same time, the annoying part isn’t the coding. It’s that every agent has its own model configuration. Want Claude Code on Kimi and Codex on DeepSeek? That usually means editing config files in different formats, pasting different API keys and keeping track of which subscription is about to hit its limit.

Magpie moves all of that into your menu bar. Add a provider once, let a local gateway translate between protocols, and switch any agent to a different model with one click. When a quota runs out, it can quietly fail over to the next account. Details checked on October 16, 2026.

A quick note for readers outside China: DeepSeek, Kimi (from Moonshot AI), GLM (from Zhipu) and Qwen (from Alibaba) are popular Chinese model providers, often much cheaper than Western flagships, which is a big reason a tool like this took off.

What Magpie is

Magpie is an open-source local “model gateway plus switcher” for coding agents. The repo is yetone/magpie, with about 13,400 stars at the time of writing, an MIT license, and Go as the main language. Website: usemagpie.ai. Builds are published through yetone/magpie-releases; the current version is around v0.1.1263 (October 15, 2026).

It does three things:

  1. A local gateway, by default on 127.0.0.1:3425, that speaks OpenAI Chat and Responses, Anthropic Messages and Gemini, and translates streaming, tool calls and reasoning between them. That’s how Codex can talk to DeepSeek and Claude Code can talk to Kimi.
  2. A menu bar app, window, TUI and CLI for picking a provider/model for every installed agent. It changes only the one key that needs changing in each config file and tries to preserve comments and formatting.
  3. Routing groups and multiple accounts: strategies like smart, order and rotate fail over between subscription quotas, rate limits and billing problems, ideally before the agent ever sees an error.

The project draws its own line: if you only use one agent with its own subscription and that’s enough, you don’t need Magpie. It shines with multiple agents, multiple keys and multiple subscriptions.

Installing and using it

It runs on Mac, Windows and Linux. The Mac build is signed and notarized, and it’s a native app of around 15 MB (not Electron). One-line install:

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

You can also download a package from the website or run go install github.com/yetone/magpie@latest. Once installed, go to Providers and add a preset (DeepSeek, Kimi, GLM, Qwen, OpenRouter, Ollama and more) with your key, or reuse a Claude, ChatGPT or Copilot subscription you’re already signed into. Then pick a model for each agent on the Agents page; it takes effect in new sessions.

Terminal examples:

magpie provider add deepseek sk-…
magpie claude deepseek/deepseek-v4-pro
magpie codex moonshot/kimi-k2.5
magpie group add "Opus anywhere" models=claude/claude-opus-5-5,copilot/claude-opus-5.5 routing=smart
magpie claude group/opus-anywhere
magpie save work && magpie use work
magpie quota
magpie tui

Any client that just takes a base URL can point straight at the gateway, for example:

export OPENAI_BASE_URL=http://127.0.0.1:3425/v1
export OPENAI_API_KEY=magpie

The list of supported agents is long (Claude Code, Codex, Gemini CLI, OpenCode, Cursor CLI, Goose, Cline and more), and the UI only shows the ones installed on your machine.

How it differs from CC Switch, LiteLLM and OpenRouter

Magpie CC Switch and similar LiteLLM OpenRouter
Form Local menu bar app + gateway Mostly config/UI switchers Usually a server-side proxy Cloud aggregator API
Protocol translation Multi-protocol, on your machine Usually tied to one ecosystem Strong, ops-oriented Unified OpenAI-style API in the cloud
Reusing subscriptions Can use local sign-ins as providers Depends on the tool Generally doesn’t touch desktop sign-ins No
Best for Desktop users juggling several agents Heavy Claude users who want quick config swaps Team gateways and observability People who’d rather not self-host and accept a cloud relay

In short: Magpie is a control panel on the developer’s own computer. LiteLLM is a proxy you deploy for a team, OpenRouter is buying models through someone else’s service, and CC Switch-style tools (CC Switch is a popular open-source config switcher for Claude Code) tend to be narrower and focused on one agent. Magpie can import providers from CC Switch and similar tools, so migrating is fairly painless.

What’s good

  • The pain is real: multiple agents times multiple models times multiple subscriptions really is config hell.
  • A local gateway with protocol translation means agents aren’t locked to their vendor’s own API.
  • Routing groups and quota awareness are genuinely useful if you’re paying for several Max or Plus plans at once.
  • MIT-licensed, small and cross-platform, with an auto-update path on Mac.

What’s lacking

  • Subscription discovery reads agent sign-in state and the Keychain (you can turn it off in settings or with magpie accounts discovery off). In sensitive environments, weigh that yourself.
  • Plugging one vendor’s subscription into another vendor’s client may run into those vendors’ terms of service. Magpie can’t help you there; that’s on you.
  • It’s still at 0.1.x with a lot of open issues (about 800+ at the time of writing). Keep it updated, and don’t treat it as zero-maintenance infrastructure.
  • It’s packed with features (plugins, intent routing, nested routing), and newcomers can easily turn on too much at once. Start with “add a provider, pick a model”.

Related reading

Who it’s for

  • People who switch between Claude Code, Codex, Gemini CLI and OpenCode on the same machine.
  • Anyone who wants DeepSeek, Kimi, GLM, local Ollama models and their existing subscriptions under one switching workflow.
  • Developers happy to run a small local gateway in exchange for editing far fewer config files.

If you only use one official agent and pay one vendor, the stock settings are simpler. Once your tools start fighting over models, install Magpie and you’ll understand right away why it’s racking up stars.

Links

END
 0
liujiana
Copyright Notice: Our original article was published by liujiana on 2026-10-16, total 5433 words.
Reproduction Note: Compiled by baffox.com from official project pages, open-source communities and public sources. Features, pricing, licenses and terms can change over time, so check the official pages for the latest. If you quote this post, please credit the source and link back here. Spotted an error or a copyright issue? Email us and we will look into it right away.
SponsoredRecommended by Baffox: Bandwagon Host VPS with CN2 GIA routesSponsoredRecommended by Baffox: DMIT premium VPS in Hong Kong, Tokyo and Los Angeles
Comments(No Comments)
Captcha