diff --git a/site/public/docs/claude-code-models.html b/site/public/docs/claude-code-models.html index e684450d1..d6ada5905 100644 --- a/site/public/docs/claude-code-models.html +++ b/site/public/docs/claude-code-models.html @@ -251,7 +251,7 @@ magpie claude codex/gpt-5.5

The routing modes are in Get started.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

FAQ

Do I set ANTHROPIC_BASE_URL myself?

diff --git a/site/public/docs/codex-models.html b/site/public/docs/codex-models.html index 974363b9d..29aba150a 100644 --- a/site/public/docs/codex-models.html +++ b/site/public/docs/codex-models.html @@ -251,7 +251,7 @@ magpie codex claude/…

The routing modes are in Get started.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

FAQ

Do I write [model_providers] myself?

diff --git a/site/public/docs/copilot.html b/site/public/docs/copilot.html index 5f13d5f5b..0e8b616da 100644 --- a/site/public/docs/copilot.html +++ b/site/public/docs/copilot.html @@ -297,7 +297,7 @@ magpie opencode copilot/claude-opus-5.5

Why is a Copilot model missing from my list?

magpie lists what Copilot’s /models gives the account: chat models only, without the ones no model picker offers or the account can’t turn on. A model Copilot answered with “The requested model is not supported.” is left out for 6 hours, then tried again in case your plan changed.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

diff --git a/site/public/docs/gemini-cli-models.html b/site/public/docs/gemini-cli-models.html index 91479bb59..77f60f251 100644 --- a/site/public/docs/gemini-cli-models.html +++ b/site/public/docs/gemini-cli-models.html @@ -235,7 +235,7 @@ magpie gemini model codex/gpt-5.5

The routing modes and rules are in Get started.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

FAQ

Can Gemini CLI use models that aren’t Gemini?

diff --git a/site/public/docs/gemini.html b/site/public/docs/gemini.html index 70c410577..33ae7558a 100644 --- a/site/public/docs/gemini.html +++ b/site/public/docs/gemini.html @@ -310,7 +310,7 @@ magpie claude google-vertex/gemini-3.1-pro-preview

Can I use my Gemini Code Assist or Antigravity sign-in instead?

Yes. Both are subscriptions: magpie accounts add gemini or magpie accounts add antigravity, then pick a gemini/… or antigravity/… model. Code Assist needs a Standard or Enterprise account with a Google Cloud project of its own.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Grok · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

diff --git a/site/public/docs/grok.html b/site/public/docs/grok.html index 1679bf52e..d9fff0d82 100644 --- a/site/public/docs/grok.html +++ b/site/public/docs/grok.html @@ -283,7 +283,7 @@ magpie provider fallback xai deepseek/deepseek-v4-pro

Does magpie show my xAI balance?

No. The Usage tab counts tokens, cache and cost for every Grok call, priced from models.dev, but magpie reads no balance from xAI. You can type the balance in with magpie provider key-balance, and the Usage page shows it less what magpie has priced since.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Mistral · OpenRouter · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

diff --git a/site/public/docs/ja/claude-code-models.html b/site/public/docs/ja/claude-code-models.html index 334f777e7..56e15320e 100644 --- a/site/public/docs/ja/claude-code-models.html +++ b/site/public/docs/ja/claude-code-models.html @@ -251,7 +251,7 @@ magpie claude codex/gpt-5.5

ルーティングモードははじめにで説明しています。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

よくある質問

ANTHROPIC_BASE_URL は自分で設定しますか?

diff --git a/site/public/docs/ja/codex-models.html b/site/public/docs/ja/codex-models.html index 00a655d78..8ac142af2 100644 --- a/site/public/docs/ja/codex-models.html +++ b/site/public/docs/ja/codex-models.html @@ -251,7 +251,7 @@ magpie codex claude/…

ルーティングモードははじめにで説明しています。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

よくある質問

[model_providers] は自分で書きますか?

diff --git a/site/public/docs/ja/copilot.html b/site/public/docs/ja/copilot.html index be5e5ecf2..d945172b2 100644 --- a/site/public/docs/ja/copilot.html +++ b/site/public/docs/ja/copilot.html @@ -297,7 +297,7 @@ magpie opencode copilot/claude-opus-5.5

Copilot のモデルが一覧にないのはなぜですか?

magpie が並べるのは、Copilot の /models がそのアカウントに返すモデルです。チャットモデルだけで、どのモデルピッカーにも出ないものと、そのアカウントで有効にできないものは除きます。Copilot が「The requested model is not supported.」で断ったモデルは 6 時間外し、プランが変わった場合に備えてその後もう一度試します。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · Ollama

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

diff --git a/site/public/docs/ja/gemini-cli-models.html b/site/public/docs/ja/gemini-cli-models.html index 3600b1f81..c21682bf3 100644 --- a/site/public/docs/ja/gemini-cli-models.html +++ b/site/public/docs/ja/gemini-cli-models.html @@ -235,7 +235,7 @@ magpie gemini model codex/gpt-5.5

ルーティングモードとルールははじめにで説明しています。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

よくある質問

Gemini CLI で Gemini 以外のモデルを使えますか?

diff --git a/site/public/docs/ja/gemini.html b/site/public/docs/ja/gemini.html index 3d189189f..11c3b4118 100644 --- a/site/public/docs/ja/gemini.html +++ b/site/public/docs/ja/gemini.html @@ -310,7 +310,7 @@ magpie claude google-vertex/gemini-3.1-pro-preview

Gemini Code Assist や Antigravity のサインインは使えますか?

使えます。どちらもサブスクです。magpie accounts add gemini か magpie accounts add antigravity を実行し、gemini/… か antigravity/… のモデルを選びます。Code Assist には、専用の Google Cloud プロジェクトを持つ Standard または Enterprise のアカウントが必要です。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Grok · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

diff --git a/site/public/docs/ja/grok.html b/site/public/docs/ja/grok.html index 3fb9d10fb..e194134da 100644 --- a/site/public/docs/ja/grok.html +++ b/site/public/docs/ja/grok.html @@ -283,7 +283,7 @@ magpie provider fallback xai deepseek/deepseek-v4-pro

magpie で xAI の残高は見られますか?

見られません。使用量タブは Grok の呼び出しごとにトークン・キャッシュ・費用を models.dev の価格で数えますが、magpie は xAI から残高を読みません。magpie provider key-balance で残高を入力すると、使用量ページはそこから magpie がそれ以降に計算した費用を引いて表示します。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Mistral · OpenRouter · GitHub Copilot · Ollama

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

diff --git a/site/public/docs/ja/mistral.html b/site/public/docs/ja/mistral.html new file mode 100644 index 000000000..1b1a20f42 --- /dev/null +++ b/site/public/docs/ja/mistral.html @@ -0,0 +1,331 @@ + + + + + +Mistral を Claude Code・Codex・Gemini CLI・OpenCode で使う · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

ドキュメント · プロバイダ

+

Mistral を Claude Code・Codex・Gemini CLI・OpenCode で使う

+

Mistral はモデルを一つの API、api.mistral.ai の OpenAI 形式の Chat Completions で提供しています。Mistral の API キーを magpie に一度追加すれば、Claude Code・Codex・Gemini CLI・OpenCode などつないだすべてのツールが、magpie のゲートウェイ 127.0.0.1:3425 経由で Mistral を使えます。ツールごとに別のモデルを選べます。別の API を話すツールのリクエストは、途中で magpie が変換します。

+ +

Mistral を追加する

+
    +
  1. キーを取得console.mistral.ai で作ります。Le Chat プランの Vibe キーも同じプロバイダに入れます。
  2. +
  3. プロバイダを追加magpie の プロバイダ で + プロバイダを追加 を押し、Mistral を選んでキーを貼り付け、保存します。magpie がそのキーで使えるモデルを Mistral に問い合わせます。
  4. +
  5. ツールで選ぶエージェント タブで、ツールの行のモデルを押し、mistral-large-4 などの Mistral モデルを選びます。
  6. +
+
ターミナル
magpie provider add mistral <key>
+magpie provider test mistral
+

magpie のモデル ID は プロバイダ/モデル の形なので、Mistral のモデルは mistral/mistral-large-4 のようになります。前がプロバイダ、後ろが Mistral 自身の ID です。キーは magpie の設定に保存され、magpie がシェルから読むことはありません。

+

OpenCode や Alma で Mistral をもう設定してあるなら、magpie がそれらのアプリから取り込むときに Mistral プロバイダとして入ります。キーごとに一つずつ項目を持つアプリ(“Mistral #0001”、“Mistral #0002”…)からは、その数だけキーを持つ一つの Mistral プロバイダになり、どのツールのモデル選択にも一度だけ並びます。

+ +

エンドポイント

+
+ + + +
APIアドレス用途
Chat Completionshttps://api.mistral.ai/v1モデル一覧と、すべてのツールのリクエスト(OpenCode はそのまま、Claude Code・Codex・Gemini CLI は変換して)
課金https://api.mistral.ai/v1/billing/budget、/v1/billing/subscriptionキーのその月の Vibe 予算または API 予算と、加入しているプラン
+

magpie の Mistral プロバイダには Anthropic Messages や Responses のアドレスがないので、どちらかを話すツールのリクエストは Chat Completions に変換し、返答を戻します。ストリーミングとツール呼び出しも含みます。

+ +

モデル一覧

+

magpie は一覧を Mistral の https://api.mistral.ai/v1/models から取得するので、ツールにはそのキーで使えるモデルが並びます。名前・推論レベル・価格は models.dev の mistral カタログから取り、Devstral・Codestral・Magistral のモデルにはどの選択肢でも Mistral のロゴが付きます。Mistral はほかのラボのモデルも提供しています。GLM や DeepSeek の deepseek-v4.1-flash-1017 などで、同じキーで使え、下に挙げる修正もそのまま効きます。ツールに見せるモデルは、プロバイダのモデル一覧かターミナルで選べます。

+
ターミナル
magpie provider models mistral +mistral-large-4 +mistral-medium-3.5
+magpie provider refresh-every mistral 1d
+ +

ツールごとの使い方

+
ターミナル
magpie claude mistral/mistral-large-4
+magpie codex mistral/mistral-large-4
+magpie gemini model mistral/mistral-large-4
+magpie opencode mistral/mistral-large-4
+ + +

magpie が Mistral 向けに直すもの

+

Mistral の API は受け付けるものに厳しく、推論モデルの思考も独自の形で返します。magpie はそのまま渡すリクエストでも変換するリクエストでも、途中でその両方を整えます。

+ + +

推論

+ + + +

Mistral の Chat Completions API は magpie のために Web を検索しないので、どのツールでも magpie がモデルに自前の検索ツールを渡します。答えるのは設定で選んだ検索サービスで、選んでいなければ magpie が選びます。

+ +

Vibe・費用・使用量

+ + +

複数のキーとフェイルオーバー

+

一つの Mistral プロバイダに複数のキーを入れられます。その下の 別のキーを追加 を押すか、まとめて貼り付けます。リクエストはオンになっている最初のキーに行き、そのキーが尽きるかレート制限にかかると次のキーが引き継ぎます。

+ +
ターミナル
magpie provider spend-cap mistral <key> 20 month
+magpie provider key-balance mistral <key> 25
+magpie provider fallback mistral deepseek/deepseek-v4-pro
+ +

うまくいかないとき

+ + +

よくある質問

+

Claude Code で Mistral を使うには?

+

magpie に Mistral の API キーを追加し(プロバイダ、プロバイダを追加、Mistral)、Claude Code の行で mistral-large-4 などの Mistral モデルを選ぶか、magpie claude mistral/mistral-large-4 を実行します。Mistral は Chat Completions しか提供していないので、magpie が Claude Code の Anthropic Messages リクエストを変換して https://api.mistral.ai/v1 に送り、返答を戻します。思考内容も含みます。

+

Codex で Devstral などの Mistral モデルを使えますか?

+

使えます。Devstral を含め、Mistral のキーで使えるモデルならどれでも Codex から使えます。Codex が話す OpenAI Responses を Mistral は提供していないので、magpie が各リクエストを Chat Completions に変換し、apply_patch などの Codex のカスタムツールを関数としてモデルに渡し、呼び出しを Codex が実行できる形で返します。

+

OpenCode で Codestral などの Mistral モデルを使うには?

+

magpie でモデルを選ぶか、magpie opencode mistral/mistral-large-4 を実行します。キーで Codestral や Devstral が使えるなら、使い方は同じです。OpenCode は Chat Completions を話すので、リクエストはそのまま Mistral に送ります。途中で直すのは Mistral が拒否するものだけで、OpenCode の store フィールドと、reasoning_content で送り返される前のターンの思考です。

+

Gemini CLI で Mistral を使えますか?

+

使えます。Gemini CLI は Google の Gemini API を話すので、magpie がリクエストを Mistral の Chat Completions に変換し、返答を戻します。ストリーミングとツール呼び出しも含みます。magpie gemini model mistral/mistral-large-4 を実行してください。

+

Mistral が 422 extra_forbidden を返すのはなぜ?

+

Mistral は知らないフィールドをすべて拒否します。magpie は前のターンの思考を Mistral が受け付ける思考パートにして送り、一部のツールが付ける Ollama のオプションを外します。store(OpenCode)のように Mistral が名指しした省略可能なフィールドは外して問い合わせ直し、それ以降は送りません。

+

Le Chat プランの Vibe 予算を magpie で見られますか?

+

見られます。Le Chat プラン(Pro・Student・Team)の Vibe キーには、その月の Vibe 予算の使用量、Mistral が請求する通貨、リセット日、プラン名が表示されます。コンソールで作った Studio キーには、代わりに組織の API 予算が “API · Month” として表示されます。

+ +

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot · Ollama

+

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

+
+
+ + + + + + + diff --git a/site/public/docs/ja/ollama.html b/site/public/docs/ja/ollama.html new file mode 100644 index 000000000..a29984e92 --- /dev/null +++ b/site/public/docs/ja/ollama.html @@ -0,0 +1,377 @@ + + + + + +Ollama を Claude Code・Codex・Gemini CLI・OpenCode で使う · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

ドキュメント · プロバイダ

+

Ollama を Claude Code・Codex・Gemini CLI・OpenCode で使う

+

Ollama は pull したモデルを http://localhost:11434 で OpenAI Chat Completions と Anthropic Messages の二つの API で提供します。Ollama Cloud はクラウドのモデルを ollama.com で同じように提供し、API キーで使います。どちらかを magpie に一度追加すれば、Claude Code・Codex・Gemini CLI・OpenCode などつないだすべてのツールが、magpie のゲートウェイ 127.0.0.1:3425 経由で使えます。ツールごとに別のモデルを選べます。

+ +

Ollama を追加する

+
    +
  1. モデルを pull するOllama で qwen3 などのモデルを pull し、サーバーを動かしたままにします。
  2. +
  3. プロバイダを追加するmagpie の プロバイダ タブで + プロバイダを追加 を押し、このマシン上 から Ollama を選びます。キーは要りません。magpie がサーバーにモデルを問い合わせ、ollama/… として表示されます。
  4. +
  5. ツールに割り当てるエージェント タブでツールの行のモデルをクリックし、Ollama のモデルを選びます。
  6. +
+
ターミナル
ollama pull qwen3
+magpie provider add ollama
+magpie provider test ollama
+

magpie のモデル ID は プロバイダ/モデル の形なので、qwen3 として pull したモデルは ollama/qwen3 になります。タグも ID に残り、ollama/qwen3:8b のようになります。ターミナル UI で追加すると、サーバーのアドレスを聞かれます。LM Studio・oMLX・vLLM・llama.cpp のサーバーは ローカルモデル を見てください。

+ +

別のポート・別のマシン

+

Ollama が別のポートで待ち受けている場合や、GPU マシンや NAS など別のマシンで動いている場合は、プロバイダの編集画面で サーバーアドレス を変えます。変わるのはスキーム・ホスト・ポートだけで、各 API のパスはそのままです。スキームは省略でき、その場合は http になります。アドレスと一緒に貼ったパス(/v1 など)は取り除かれます。

+
ターミナル
magpie provider set ollama address=192.168.1.20:11434
+magpie provider set ollama address=     # 既定に戻す
+ + +

Ollama Cloud

+
    +
  1. キーを作るollama.com/settings/keys で作成します。
  2. +
  3. プロバイダを追加するプロバイダ タブで + プロバイダを追加 を押し、Ollama Cloud を選んでキーを貼り付け、保存します。magpie がそのキーで使えるモデルを Ollama Cloud に問い合わせます。
  4. +
  5. ツールに割り当てるツールの行で deepseek-v4-pro などの Ollama Cloud のモデルを選びます。
  6. +
+
ターミナル
magpie provider add ollama-cloud <key>
+magpie claude ollama-cloud/deepseek-v4-pro
+

モデル名・推論レベル・価格は models.dev の ollama-cloud カタログから取ります。キーは magpie の設定に保存されます。

+ +

エンドポイント

+
+ + + +
プロバイダChat CompletionsAnthropic Messages
Ollamahttp://localhost:11434/v1http://localhost:11434
Ollama Cloudhttps://ollama.com/v1https://ollama.com
+

ツールが話す API を Ollama が提供していれば、リクエストはその API にそのまま渡ります。magpie はどちらにも Responses のエンドポイントを使わないので、変換が要るときは Chat Completions を使います。Responses を優先するのは OpenAI 自身のモデルだけ、Messages を優先するのは Claude のモデルだけです。

+ +

モデル一覧

+

magpie は Chat Completions のベース URL から一覧を取ります。http://localhost:11434/v1/models、Ollama Cloud なら https://ollama.com/v1/models です。Ollama にあるモデルが magpie に表示されます。新しく pull したら、プロバイダの編集画面で モデルを取得 を押すか、magpie provider refresh ollama を実行します。ツールに見せるモデルは、プロバイダのモデル一覧かターミナルで選べます。

+
ターミナル
magpie provider refresh ollama
+magpie provider models ollama +qwen3
+

Ollama 0.35.0 以降(クラウドモデルは 0.40.5 以降)は、Nimble・Clef・Tev などの判定モデルも提供します。magpie は Ollama の /api/tags も読み、判定モデルと示されたものをそのプロバイダの インテントルーティング 用の判定モデルにします。ツールのモデルにはなりません。古い Ollama では一覧に出ません。

+ +

ツールごとの使い方

+
ターミナル
magpie claude ollama/qwen3
+magpie codex ollama/qwen3
+magpie gemini model ollama/qwen3
+magpie opencode ollama/qwen3
+ +

ツールの中でも、Claude Code と Codex の /model に magpie のモデルが並ぶので、ローカルモデルとクラウドのモデルをそこで切り替えられます。ツール本来のモデルに戻すには magpie claude default か magpie codex default を実行します。

+ +

コンテキストウィンドウと num_ctx

+

エージェントは、モデルが受け付けるリクエストの長さを前提に会話を組み立てます。Claude Code は知らないモデルを 200K とみなし、Codex は伝えられたウィンドウの 90% で会話を圧縮します。magpie は Ollama のチャットモデルのウィンドウを読まないので、実際の値を伝えてください。プロバイダの編集画面の 詳細設定 にある コンテキストウィンドウ で、全モデルにも個別のモデルにも設定できます。magpie がそれをエージェントに伝えます。

+
ターミナル
magpie provider set ollama context=32k
+magpie provider set ollama context.qwen3=128k
+ + +

推論

+ +
ターミナル
magpie model efforts ollama/qwen3 low,medium,high
+magpie model efforts ollama/qwen3 off
+ +

ツール呼び出し

+

Claude Code と OpenCode のツール呼び出しは、ツールが書いたとおりに Ollama へ届きます。Codex と Gemini CLI では、ツールの定義、モデルからの呼び出し、その結果を magpie が Chat Completions に変換して戻します。ストリーミングの返答でも同じです。

+ +

プライバシーマスク

+

magpie の プライバシーマスク は、リクエストがゲートウェイを出る前にキーやトークンなどの秘密をプレースホルダーに置き換えます。ローカルの Ollama へのリクエストも同じです。モデルが自分のマシンやネットワーク内で動いているなら、編集画面で リクエストをマスクしない をオンにするか、magpie provider set ollama unmasked=yes を実行します。

+ + +

使用量と費用

+ +
ターミナル
magpie model price ollama/qwen3 0,0,0,0
+magpie provider set ollama free=yes
+magpie provider quota-rest ollama-cloud 7d
+magpie provider fallback ollama-cloud ollama/qwen3
+ +

magpie を Ollama サーバーとして使う

+

カスタムモデルを Ollama サーバーとしてしか受け付けないアプリがあります。VS Code の Copilot の Ollama プロバイダ、Visual Studio の Copilot BYOK、Zed の Ollama プロバイダ、そして ollama CLI です。これらを magpie のゲートウェイ http://127.0.0.1:3425 に向ければ、Ollama のものだけでなく、すべてのプロバイダの magpie のモデルが見えます。

+ + +

うまくいかないとき

+ + +

よくある質問

+

Claude Code で Ollama のローカルモデルを使うには?

+

magpie に Ollama を追加し(プロバイダ → プロバイダを追加 → このマシン上の Ollama)、Claude Code の行でそのモデルを選ぶか、magpie claude ollama/qwen3 を実行します。Claude Code のリクエストは magpie のゲートウェイを通り、http://localhost:11434 にある Ollama の Anthropic Messages API へそのまま届きます。

+

Codex で Ollama は使えますか?

+

使えます。Codex は Responses API しか話さないので、magpie がリクエストを Chat Completions に変換して Ollama に送り、返答を元に戻します。ツール呼び出しも含みます。magpie codex ollama/qwen3 を実行してください。

+

Gemini CLI や OpenCode でも Ollama は使えますか?

+

使えます。Gemini CLI は Google の API を話すので、magpie がリクエストを Ollama の Chat Completions に変換し、返答を元に戻します。OpenCode は Chat Completions を話すので、リクエストはそのまま Ollama に届きます。magpie gemini model ollama/qwen3 か magpie opencode ollama/qwen3 を実行してください。

+

Ollama の qwen3-coder を Claude Code で使うには?

+

Ollama で pull してから、magpie のプロバイダ編集画面で「モデルを取得」を押し(または magpie provider refresh ollama を実行し)、Claude Code の行で選びます。magpie での ID は ollama/ に Ollama が表示する名前(タグ込み)を続けたものです。コンテキストウィンドウも設定してください。Claude Code は知らないモデルを 200K とみなします。

+

別のマシンの Ollama を使えますか?

+

使えます。プロバイダのサーバーアドレスをそのマシンに変えます。たとえば magpie provider set ollama address=192.168.1.20:11434 です。自分のネットワーク内のサーバーには、設定やシステムのプロキシを通さず直接つなぎます。

+

Ollama Cloud にも対応していますか?

+

対応しています。ollama.com/settings/keys で作ったキーで Ollama Cloud を追加すると、magpie はそのキーで使えるモデルを一覧にし、models.dev の価格で計算し、アカウントのプランに含まれる枠と購入したクレジットを表示します。

+

ローカルの Ollama に API キーは要りますか?

+

要りません。Ollama のプリセットはキーなしで使えます。Ollama Cloud にはキーが要ります。

+ +

LM Studio・oMLX・vLLM・llama.cpp など他のローカルサーバーは ローカルモデル を見てください。ローカルモデルにリクエストを分類させてルーティングを決めるには インテントルーティング を見てください。

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot

+

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

+
+
+ + + + + + + diff --git a/site/public/docs/ja/opencode-models.html b/site/public/docs/ja/opencode-models.html index 24f6e4d59..56d6e0cba 100644 --- a/site/public/docs/ja/opencode-models.html +++ b/site/public/docs/ja/opencode-models.html @@ -239,7 +239,7 @@ magpie visible opencode all # すべてに戻す
ターミナル
magpie opencode default

magpie を使う前の model と small_model が戻り、magpie プロバイダがファイルから取り除かれます。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

よくある質問

OpenCode で DeepSeek を使うには?

diff --git a/site/public/docs/ja/openrouter.html b/site/public/docs/ja/openrouter.html index b932f4d9b..02c71bf38 100644 --- a/site/public/docs/ja/openrouter.html +++ b/site/public/docs/ja/openrouter.html @@ -288,7 +288,7 @@ magpie group set opus-anywhere stays=session models+=openrouter/anthropic/claude

magpie が OpenRouter のモデル一覧を /api/v1 から取るのはなぜ?

Anthropic のベース URL で一覧を求めると、OpenRouter は anthropic/ の下に並べたカタログを返しますが、その ID では提供していません。magpie は Chat Completions のベース URL https://openrouter.ai/api/v1 から一覧を取り、OpenRouter の Anthropic のベース URL しかないプロバイダには、この Chat の URL を足すよう案内します。

-

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · GitHub Copilot

+

プロバイダ別:DeepSeek · Kimi と Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · GitHub Copilot · Ollama

ツールごとのガイド:Claude Code で他のモデル、Codex で他のモデル、Gemini CLI で他のモデル、OpenCode で他のモデル。困ったときは Discord で質問してください。

diff --git a/site/public/docs/mistral.html b/site/public/docs/mistral.html new file mode 100644 index 000000000..3de283afc --- /dev/null +++ b/site/public/docs/mistral.html @@ -0,0 +1,331 @@ + + + + + +Mistral in Claude Code, Codex, Gemini CLI and OpenCode · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Docs · Provider

+

Mistral in Claude Code, Codex, Gemini CLI and OpenCode

+

Mistral serves its models on one API, OpenAI-style Chat Completions, at api.mistral.ai. Add a Mistral API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Mistral through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own. Agents that speak another API are translated on the way.

+ +

Add Mistral

+
    +
  1. Get a keyMake one on console.mistral.ai. A Le Chat plan’s Vibe key goes in the same provider.
  2. +
  3. Add the providerIn magpie’s Providers tab, press + Add provider, pick Mistral, paste the key and save. magpie asks Mistral which models the key can use.
  4. +
  5. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose a Mistral model such as mistral-large-4.
  6. +
+
Terminal
magpie provider add mistral <key>
+magpie provider test mistral
+

Model ids in magpie are provider/model, so Mistral’s read mistral/mistral-large-4: the provider, then Mistral’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell.

+

Already set Mistral up in OpenCode or Alma? magpie’s import from those apps brings it in as the Mistral provider. An app that keeps one entry per key (“Mistral #0001”, “Mistral #0002”…) becomes one Mistral provider with that many keys, listed once in every agent’s picker.

+ +

Endpoints

+
+ + + +
APIAddressUsed for
Chat Completionshttps://api.mistral.ai/v1the model list and every agent’s requests: OpenCode’s as they are, Claude Code’s, Codex’s and Gemini CLI’s translated
Billinghttps://api.mistral.ai/v1/billing/budget, /v1/billing/subscriptiona key’s month of Vibe or API budget, and the plan it is on
+

magpie’s Mistral provider has no Anthropic Messages or Responses address, so an agent that speaks either is translated to Chat Completions and the reply translated back, streaming and tool calls included.

+ +

Model list

+

magpie fetches the list from Mistral, at https://api.mistral.ai/v1/models, so agents see the models your key can use. Names, reasoning levels and prices come from models.dev’s mistral catalog, and Devstral, Codestral and Magistral models carry Mistral’s logo in every picker. Mistral also serves models from other labs, such as GLM and DeepSeek’s deepseek-v4.1-flash-1017; they come through the same key, and the fixes below apply to them too. Pick the models agents see in the provider’s model list, or from the terminal:

+
Terminal
magpie provider models mistral +mistral-large-4 +mistral-medium-3.5
+magpie provider refresh-every mistral 1d
+ +

In each agent

+
Terminal
magpie claude mistral/mistral-large-4
+magpie codex mistral/mistral-large-4
+magpie gemini model mistral/mistral-large-4
+magpie opencode mistral/mistral-large-4
+ + +

What magpie fixes for Mistral

+

Mistral’s API is strict about what it takes and sends a reasoning model’s thinking in a shape of its own. magpie changes both on the way, on requests it passes on and on those it translates alike:

+ + +

Reasoning

+ + + +

Mistral’s Chat Completions API doesn’t search the web for magpie, so magpie gives the model its own search tool in every agent, answered by the searcher chosen in Settings, or by one magpie picks when none is chosen.

+ +

Vibe, cost and usage

+ + +

Several keys and failover

+

One Mistral provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over.

+ +
Terminal
magpie provider spend-cap mistral <key> 20 month
+magpie provider key-balance mistral <key> 25
+magpie provider fallback mistral deepseek/deepseek-v4-pro
+ +

Troubleshooting

+ + +

FAQ

+

How do I use Mistral in Claude Code?

+

Add your Mistral API key in magpie (Providers, Add provider, Mistral), then pick a Mistral model such as mistral-large-4 on Claude Code’s row, or run magpie claude mistral/mistral-large-4. Mistral serves Chat Completions only, so magpie translates Claude Code’s Anthropic Messages requests to https://api.mistral.ai/v1 and the replies back, thinking included.

+

Can Codex use Devstral and other Mistral models?

+

Yes. Codex can use any model your Mistral key lists, Devstral among them. Codex speaks OpenAI Responses, which Mistral doesn’t serve, so magpie translates each request to Chat Completions, offers Codex’s custom tools such as apply_patch as functions, and gives the calls back the way Codex runs them.

+

How do I use Codestral or other Mistral models in OpenCode?

+

Pick the model in magpie, or run magpie opencode mistral/mistral-large-4; Codestral and Devstral work the same way when your key lists them. OpenCode speaks Chat Completions, so its requests go to Mistral as they are, with what Mistral would refuse fixed on the way: OpenCode’s store field, and earlier turns’ thinking sent back in reasoning_content.

+

Can Gemini CLI use Mistral?

+

Yes. Gemini CLI speaks Google’s Gemini API, so magpie translates its requests to Mistral’s Chat Completions and the replies back, streaming and tool calls included. Run magpie gemini model mistral/mistral-large-4.

+

Why does Mistral answer 422 extra_forbidden?

+

Mistral turns away any field it doesn’t know. magpie sends an earlier turn’s thinking as the thinking part Mistral takes, leaves out Ollama options some agents add, and asks again without an optional field Mistral names, such as OpenCode’s store, then stops sending it.

+

Does magpie show my Le Chat plan’s Vibe budget?

+

Yes. A Vibe key from a Le Chat plan (Pro, Student or Team) shows how much of the month’s Vibe budget is used, in the currency Mistral bills in, and when it resets, with the plan’s name. A Studio key made in the console shows the organization’s API budget instead, as “API · Month”.

+ +

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot · Ollama

+

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

+
+
+ + + + + + + diff --git a/site/public/docs/ollama.html b/site/public/docs/ollama.html new file mode 100644 index 000000000..50f1bb1cc --- /dev/null +++ b/site/public/docs/ollama.html @@ -0,0 +1,377 @@ + + + + + +Ollama in Claude Code, Codex, Gemini CLI and OpenCode · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Docs · Provider

+

Ollama in Claude Code, Codex, Gemini CLI and OpenCode

+

Ollama serves the models you pull on two APIs, OpenAI Chat Completions and Anthropic Messages, at http://localhost:11434. Ollama Cloud serves its models the same way at ollama.com, with an API key. Add either to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use them through magpie’s local gateway at 127.0.0.1:3425, each agent with a model of its own.

+ +

Add Ollama

+
    +
  1. Pull a modelPull a model in Ollama, such as qwen3, and leave the server running.
  2. +
  3. Add the providerIn magpie’s Providers tab, press + Add provider and pick Ollama under On this machine. No key is needed. magpie asks the server which models it has, and they show as ollama/….
  4. +
  5. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose an Ollama model.
  6. +
+
Terminal
ollama pull qwen3
+magpie provider add ollama
+magpie provider test ollama
+

Model ids in magpie are provider/model, so a model you pulled as qwen3 reads ollama/qwen3. A tag stays in the id, as in ollama/qwen3:8b. In the terminal UI, magpie asks for the server’s address when you add it. LM Studio, oMLX, vLLM and llama.cpp’s server are in Local models.

+ +

Another port or another computer

+

If Ollama listens on another port, or runs on another computer such as a GPU box or a NAS, change Server address in the provider’s editor. Only the scheme, host and port change; each API keeps its path. The scheme can be left out, and http is taken; a path pasted with the address, such as /v1, is dropped.

+
Terminal
magpie provider set ollama address=192.168.1.20:11434
+magpie provider set ollama address=     # back to the default
+ + +

Ollama Cloud

+
    +
  1. Get a keyMake one at ollama.com/settings/keys.
  2. +
  3. Add the providerIn the Providers tab, press + Add provider, pick Ollama Cloud, paste the key and save. magpie asks Ollama Cloud which models the key can use.
  4. +
  5. Pick it for an agentChoose an Ollama Cloud model, such as deepseek-v4-pro, on the agent’s row.
  6. +
+
Terminal
magpie provider add ollama-cloud <key>
+magpie claude ollama-cloud/deepseek-v4-pro
+

Names, reasoning levels and prices come from models.dev’s ollama-cloud catalog. The key is kept in magpie’s settings.

+ +

Endpoints

+
+ + + +
ProviderChat CompletionsAnthropic Messages
Ollamahttp://localhost:11434/v1http://localhost:11434
Ollama Cloudhttps://ollama.com/v1https://ollama.com
+

An agent whose API Ollama serves is passed on to that API. magpie uses no Responses endpoint for either, so when it has to translate, it uses Chat Completions: it keeps Responses first only for OpenAI’s own models, and Messages first only for Claude models.

+ +

Model list

+

magpie asks the server for its list at the Chat Completions base: http://localhost:11434/v1/models, or https://ollama.com/v1/models for Ollama Cloud. A model shows in magpie once Ollama has it. After you pull another, press Fetch models in the provider’s editor, or run magpie provider refresh ollama. Pick the models agents see in the provider’s model list, or from the terminal:

+
Terminal
magpie provider refresh ollama
+magpie provider models ollama +qwen3
+

Ollama 0.35.0 and later (0.40.5 for its cloud models) also serves decision models, such as Nimble, Clef and Tev. magpie reads Ollama’s /api/tags as well, and a model marked there as a decision model becomes one of the provider’s decision models for intent routing, never an agent’s model. An older Ollama lists none.

+ +

In each agent

+
Terminal
magpie claude ollama/qwen3
+magpie codex ollama/qwen3
+magpie gemini model ollama/qwen3
+magpie opencode ollama/qwen3
+ +

Inside the agent, Claude Code’s and Codex’s /model list magpie’s models too, so you can move between a local model and a cloud one there. To go back to the agent’s own models, run magpie claude default or magpie codex default.

+ +

Context window and num_ctx

+

Agents plan around how long a request the model takes. Claude Code takes a model it doesn’t know for 200K, and Codex compacts a conversation at 90% of the window it is told. magpie doesn’t read an Ollama chat model’s window, so tell it the real one: Context window under Advanced in the provider’s editor, for every model or one of them. magpie passes it on to the agents.

+
Terminal
magpie provider set ollama context=32k
+magpie provider set ollama context.qwen3=128k
+ + +

Reasoning

+ +
Terminal
magpie model efforts ollama/qwen3 low,medium,high
+magpie model efforts ollama/qwen3 off
+ +

Tool calls

+

Claude Code’s and OpenCode’s tool calls reach Ollama as the agent wrote them. For Codex and Gemini CLI, magpie translates the tools, the model’s calls and their results to Chat Completions and back, in streamed replies too.

+ +

Privacy masking

+

magpie’s privacy masking replaces keys, tokens and other secrets with placeholders before a request leaves the gateway, a request to a local Ollama too. When the model runs on your own computer or network, you can turn on Send requests unmasked in its editor, or run magpie provider set ollama unmasked=yes.

+ + +

Usage and cost

+ +
Terminal
magpie model price ollama/qwen3 0,0,0,0
+magpie provider set ollama free=yes
+magpie provider quota-rest ollama-cloud 7d
+magpie provider fallback ollama-cloud ollama/qwen3
+ +

magpie as an Ollama server

+

Some apps take a custom model only as an Ollama server: VS Code’s Copilot Ollama provider, Visual Studio’s Copilot BYOK, Zed’s Ollama provider and the ollama CLI. Point them at magpie’s gateway, http://127.0.0.1:3425, and they see magpie’s models, from every provider, not only Ollama.

+ + +

Troubleshooting

+ + +

FAQ

+

How do I use Ollama in Claude Code?

+

Add Ollama in magpie (Providers, Add provider, Ollama under On this machine), then pick one of its models on Claude Code’s row, or run magpie claude ollama/qwen3. Claude Code’s requests go through magpie’s gateway to Ollama’s Anthropic Messages API at http://localhost:11434 as they are.

+

Can Codex use Ollama?

+

Yes. Codex speaks only the Responses API, so magpie turns its requests into Chat Completions for Ollama, and the replies back, tool calls included. Run magpie codex ollama/qwen3.

+

Can Gemini CLI and OpenCode use Ollama?

+

Yes. Gemini CLI speaks Google’s API, so magpie translates its requests to Ollama’s Chat Completions and the replies back. OpenCode speaks Chat Completions, so its requests go to Ollama as they are. Run magpie gemini model ollama/qwen3 or magpie opencode ollama/qwen3.

+

How do I run qwen3-coder from Ollama in Claude Code?

+

Pull it in Ollama, press Fetch models in the provider’s editor in magpie (or run magpie provider refresh ollama), and pick it on Claude Code’s row. Its id in magpie is ollama/ and the name Ollama lists it under, tag included. Set its Context window too: Claude Code takes a model it doesn’t know for 200K.

+

Can magpie use Ollama on another computer?

+

Yes. Set the provider’s Server address to that computer, such as magpie provider set ollama address=192.168.1.20:11434. A server on your own network is reached directly, not through a proxy set in Settings or the system.

+

Does magpie work with Ollama Cloud?

+

Yes. Add Ollama Cloud with a key from ollama.com/settings/keys. magpie lists the models the key can use, prices them from models.dev, and shows the account’s included allowance and the credits you bought.

+

Do I need an API key for a local Ollama?

+

No. The Ollama preset takes none. Ollama Cloud needs one.

+ +

Other local servers, such as LM Studio, oMLX, vLLM and llama.cpp’s server, are in Local models. To let a local model classify each request for routing, see Intent routing.

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot

+

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

+
+
+ + + + + + + diff --git a/site/public/docs/opencode-models.html b/site/public/docs/opencode-models.html index 4f7545823..f10b4999a 100644 --- a/site/public/docs/opencode-models.html +++ b/site/public/docs/opencode-models.html @@ -239,7 +239,7 @@ magpie visible opencode all # every model again
Terminal
magpie opencode default

It puts back the model and small_model OpenCode had before magpie, and takes the magpie provider out of the file.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

FAQ

How do I use DeepSeek in OpenCode?

diff --git a/site/public/docs/openrouter.html b/site/public/docs/openrouter.html index d70d1eb02..277039826 100644 --- a/site/public/docs/openrouter.html +++ b/site/public/docs/openrouter.html @@ -288,7 +288,7 @@ magpie group set opus-anywhere stays=session models+=openrouter/anthropic/claude

Why does magpie fetch OpenRouter’s model list from /api/v1?

Asked at the Anthropic base, OpenRouter answers with its catalog under anthropic/ names it doesn’t serve. magpie fetches the list from the Chat Completions base, https://openrouter.ai/api/v1, and a provider given only OpenRouter’s Anthropic base is told to add that Chat base.

-

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · GitHub Copilot

+

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Qwen · MiniMax · Gemini · Grok · Mistral · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.

diff --git a/site/public/docs/zh/claude-code-models.html b/site/public/docs/zh/claude-code-models.html index ac64d6c5b..a4ed28a07 100644 --- a/site/public/docs/zh/claude-code-models.html +++ b/site/public/docs/zh/claude-code-models.html @@ -251,7 +251,7 @@ magpie claude codex/gpt-5.5

各种路由方式见 快速上手。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

常见问题

需要自己设置 ANTHROPIC_BASE_URL 吗?

diff --git a/site/public/docs/zh/codex-models.html b/site/public/docs/zh/codex-models.html index 964ae07ac..c8b12f275 100644 --- a/site/public/docs/zh/codex-models.html +++ b/site/public/docs/zh/codex-models.html @@ -251,7 +251,7 @@ magpie codex claude/…

各种路由方式见 快速上手。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

常见问题

需要自己写 [model_providers] 吗?

diff --git a/site/public/docs/zh/copilot.html b/site/public/docs/zh/copilot.html index 786b77fea..f7c76e152 100644 --- a/site/public/docs/zh/copilot.html +++ b/site/public/docs/zh/copilot.html @@ -297,7 +297,7 @@ magpie opencode copilot/claude-opus-5.5

为什么我的列表里少了某个 Copilot 模型?

magpie 列出的是 Copilot 的 /models 给这个账号的模型:只有对话模型,不含任何模型选择器都不提供的,也不含这个账号无法开启的。被 Copilot 用“The requested model is not supported.”拒绝的模型会被隐藏 6 小时,之后再试,以防你的套餐已经变了。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · Ollama

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

diff --git a/site/public/docs/zh/gemini-cli-models.html b/site/public/docs/zh/gemini-cli-models.html index 06f40157c..cda03c2cd 100644 --- a/site/public/docs/zh/gemini-cli-models.html +++ b/site/public/docs/zh/gemini-cli-models.html @@ -235,7 +235,7 @@ magpie gemini model codex/gpt-5.5

路由方式和规则详见 快速上手。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

常见问题

Gemini CLI 能用 Gemini 以外的模型吗?

diff --git a/site/public/docs/zh/gemini.html b/site/public/docs/zh/gemini.html index 62b6d8d97..313f55ddf 100644 --- a/site/public/docs/zh/gemini.html +++ b/site/public/docs/zh/gemini.html @@ -310,7 +310,7 @@ magpie claude google-vertex/gemini-3.1-pro-preview

能用 Gemini Code Assist 或 Antigravity 的登录吗?

能。两者都是订阅:运行 magpie accounts add gemini 或 magpie accounts add antigravity,然后选 gemini/… 或 antigravity/… 模型。Code Assist 需要有自己 Google Cloud 项目的 Standard 或 Enterprise 账号。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Grok · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

diff --git a/site/public/docs/zh/grok.html b/site/public/docs/zh/grok.html index aaa77d33f..3022a2e2f 100644 --- a/site/public/docs/zh/grok.html +++ b/site/public/docs/zh/grok.html @@ -283,7 +283,7 @@ magpie provider fallback xai deepseek/deepseek-v4-pro

magpie 能显示 xAI 的余额吗?

不能。用量页会统计每次 Grok 调用的 token、缓存和费用,按 models.dev 的价格计价,但 magpie 不会从 xAI 读取余额。你可以用 magpie provider key-balance 自己填上余额,用量页会显示它减去 magpie 此后算出的费用。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Mistral · OpenRouter · GitHub Copilot · Ollama

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

diff --git a/site/public/docs/zh/mistral.html b/site/public/docs/zh/mistral.html new file mode 100644 index 000000000..2e98aa2a3 --- /dev/null +++ b/site/public/docs/zh/mistral.html @@ -0,0 +1,331 @@ + + + + + +Mistral 接入 Claude Code、Codex、Gemini CLI 和 OpenCode · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

文档 · 供应商

+

Mistral 接入 Claude Code、Codex、Gemini CLI 和 OpenCode

+

Mistral 的模型只通过一种接口提供:api.mistral.ai 上的 OpenAI 风格 Chat Completions。把 Mistral 的 API Key 添加到 magpie 一次,Claude Code、Codex、Gemini CLI、OpenCode 以及你接入的其他工具,都能通过 magpie 的本地网关 127.0.0.1:3425 使用 Mistral,每个工具各用各的模型。说其他接口的工具,magpie 会在路上替它转换。

+ +

添加 Mistral

+
    +
  1. 拿到 Key在 console.mistral.ai 创建。Le Chat 套餐的 Vibe Key 也加在同一个供应商里。
  2. +
  3. 添加供应商在 magpie 的 供应商 页点 + 添加供应商,选 Mistral,粘贴 Key 并保存。magpie 会向 Mistral 查询这个 Key 能用哪些模型。
  4. +
  5. 给工具选上在 Agent 页点工具那一行的模型,选一个 Mistral 模型,比如 mistral-large-4。
  6. +
+
终端
magpie provider add mistral <key>
+magpie provider test mistral
+

magpie 里的模型 id 是 供应商/模型,所以 Mistral 的模型写作 mistral/mistral-large-4:前面是供应商,后面是 Mistral 自己的 id。Key 保存在 magpie 的设置里,magpie 不会从 shell 里读取它。

+

已经在 OpenCode 或 Alma 里配好了 Mistral?magpie 从这些应用导入时,会把它变成 Mistral 供应商。有的应用一个 Key 存一条(“Mistral #0001”“Mistral #0002”……),导入后会合并成一个 Mistral 供应商,里面放着同样多的 Key,在每个工具的模型选择器里只出现一次。

+ +

接口地址

+
+ + + +
接口地址用途
Chat Completionshttps://api.mistral.ai/v1模型列表和所有工具的请求:OpenCode 的原样发送,Claude Code、Codex 和 Gemini CLI 的转换后发送
计费https://api.mistral.ai/v1/billing/budget、/v1/billing/subscriptionKey 当月的 Vibe 或 API 额度,以及所在的套餐
+

magpie 的 Mistral 供应商没有 Anthropic Messages 或 Responses 地址,所以说这两种接口的工具,请求都会转换成 Chat Completions,回复再转换回去,流式输出和工具调用都包括在内。

+ +

模型列表

+

magpie 从 Mistral 的 https://api.mistral.ai/v1/models 拉取列表,所以工具里看到的就是这个 Key 能用的模型。名称、推理档位和价格来自 models.dev 的 mistral 目录;Devstral、Codestral 和 Magistral 模型在每个选择器里都带着 Mistral 的图标。Mistral 也提供其他厂商的模型,比如 GLM 和 DeepSeek 的 deepseek-v4.1-flash-1017,它们走同一个 Key,下面的修正对它们同样有效。工具能看到哪些模型,可以在供应商的模型列表里挑,也可以在终端里设置:

+
终端
magpie provider models mistral +mistral-large-4 +mistral-medium-3.5
+magpie provider refresh-every mistral 1d
+ +

在各个工具里用

+
终端
magpie claude mistral/mistral-large-4
+magpie codex mistral/mistral-large-4
+magpie gemini model mistral/mistral-large-4
+magpie opencode mistral/mistral-large-4
+ + +

magpie 替你修正的请求

+

Mistral 的接口对收到的内容很严格,推理模型的思考也用它自己的格式返回。magpie 在路上把两边都调整好,原样转发的请求和转换过的请求都一样:

+ + +

推理

+ + + +

Mistral 的 Chat Completions 接口不会替 magpie 联网搜索,所以在每个工具里,magpie 都给模型提供自己的搜索工具,由设置里指定的搜索服务回答;没指定时,由 magpie 自己挑一个。

+ +

Vibe、费用与用量

+ + +

多个 Key 与故障切换

+

一个 Mistral 供应商可以放多个 Key:在它下面点 添加另一个密钥,也可以一次粘贴好几个。请求先走第一个开着的 Key,它用完或被限流时由下一个接替。

+ +
终端
magpie provider spend-cap mistral <key> 20 month
+magpie provider key-balance mistral <key> 25
+magpie provider fallback mistral deepseek/deepseek-v4-pro
+ +

常见报错

+ + +

常见问题

+

怎么在 Claude Code 里用 Mistral?

+

在 magpie 里添加 Mistral API Key(供应商、添加供应商、Mistral),然后在 Claude Code 那一行选一个 Mistral 模型,比如 mistral-large-4,或者运行 magpie claude mistral/mistral-large-4。Mistral 只提供 Chat Completions 接口,所以 magpie 把 Claude Code 的 Anthropic Messages 请求转换后发到 https://api.mistral.ai/v1,再把回复转换回来,思考内容也一样。

+

Codex 能用 Devstral 等 Mistral 模型吗?

+

能。你的 Mistral Key 列出的模型,包括 Devstral,Codex 都能用。Codex 说的是 OpenAI Responses 接口,Mistral 不提供,所以 magpie 把每个请求转换成 Chat Completions,把 apply_patch 这类 Codex 自定义工具当作函数交给模型,再把调用按 Codex 能执行的方式还回去。

+

怎么在 OpenCode 里用 Codestral 等 Mistral 模型?

+

在 magpie 里选好模型,或者运行 magpie opencode mistral/mistral-large-4;只要你的 Key 列出了 Codestral 或 Devstral,用法完全一样。OpenCode 说的是 Chat Completions,请求原样发给 Mistral,只在路上修掉 Mistral 会拒绝的内容:OpenCode 的 store 字段,以及放在 reasoning_content 里回传的上一轮思考。

+

Gemini CLI 能用 Mistral 吗?

+

能。Gemini CLI 说的是 Google 的 Gemini 接口,magpie 会把它的请求转换成 Mistral 的 Chat Completions,再把回复转换回来,流式输出和工具调用都包括在内。运行 magpie gemini model mistral/mistral-large-4 即可。

+

Mistral 为什么回 422 extra_forbidden?

+

Mistral 会拒绝它不认识的任何字段。magpie 会把上一轮的思考改成 Mistral 接受的思考片段,去掉部分工具附带的 Ollama 参数;遇到 Mistral 点名的可选字段(比如 OpenCode 的 store),就去掉它重新请求,之后也不再发送。

+

magpie 能显示 Le Chat 套餐的 Vibe 额度吗?

+

能。Le Chat 套餐(Pro、Student 或 Team)的 Vibe Key 会显示本月 Vibe 额度用了多少、按 Mistral 计费的币种计、什么时候重置,以及套餐名称。在控制台创建的 Studio Key 则显示组织的 API 额度,名为 “API · Month”。

+ +

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot · Ollama

+

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

+
+
+ + + + + + + diff --git a/site/public/docs/zh/ollama.html b/site/public/docs/zh/ollama.html new file mode 100644 index 000000000..2cb1edf87 --- /dev/null +++ b/site/public/docs/zh/ollama.html @@ -0,0 +1,377 @@ + + + + + +Ollama 接入 Claude Code、Codex、Gemini CLI 和 OpenCode · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

文档 · 供应商

+

Ollama 接入 Claude Code、Codex、Gemini CLI 和 OpenCode

+

Ollama 在 http://localhost:11434 上用两种接口提供你拉取的模型:OpenAI Chat Completions 和 Anthropic Messages。Ollama Cloud 在 ollama.com 上以同样的方式提供云端模型,需要 API Key。把其中任意一个添加到 magpie 一次,Claude Code、Codex、Gemini CLI、OpenCode 以及你接入的其他工具,就都能通过 magpie 的本地网关 127.0.0.1:3425 使用它们,每个工具各用各的模型。

+ +

添加 Ollama

+
    +
  1. 拉取模型在 Ollama 里拉取一个模型,比如 qwen3,并保持服务运行。
  2. +
  3. 添加供应商在 magpie 的 供应商 页点 + 添加供应商,在 本机 下选 Ollama。不需要 Key。magpie 会向服务询问有哪些模型,它们显示为 ollama/…。
  4. +
  5. 给工具选模型在 Agent 页点工具那一行的模型,选一个 Ollama 模型。
  6. +
+
终端
ollama pull qwen3
+magpie provider add ollama
+magpie provider test ollama
+

magpie 里的模型 ID 写作 供应商/模型,所以拉取的 qwen3 就是 ollama/qwen3。标签也留在 ID 里,比如 ollama/qwen3:8b。在终端界面里添加时,magpie 会问你服务器地址。LM Studio、oMLX、vLLM 和 llama.cpp 的服务见 本地模型。

+ +

换端口或换电脑

+

如果 Ollama 监听的是别的端口,或者跑在另一台电脑上(比如 GPU 主机或 NAS),在供应商编辑页修改 服务器地址。只有协议、主机和端口会变,每个接口的路径保持不变。协议可以省略,默认按 http;地址后面带的路径(比如 /v1)会被去掉。

+
终端
magpie provider set ollama address=192.168.1.20:11434
+magpie provider set ollama address=     # 恢复默认地址
+ + +

Ollama Cloud

+
    +
  1. 创建 Key在 ollama.com/settings/keys 创建一个。
  2. +
  3. 添加供应商在 供应商 页点 + 添加供应商,选 Ollama Cloud,粘贴 Key 并保存。magpie 会向 Ollama Cloud 询问这个 Key 能用哪些模型。
  4. +
  5. 给工具选模型在工具那一行选一个 Ollama Cloud 模型,比如 deepseek-v4-pro。
  6. +
+
终端
magpie provider add ollama-cloud <key>
+magpie claude ollama-cloud/deepseek-v4-pro
+

模型名称、推理档位和价格来自 models.dev 的 ollama-cloud 目录。Key 保存在 magpie 的设置里。

+ +

接口地址

+
+ + + +
供应商Chat CompletionsAnthropic Messages
Ollamahttp://localhost:11434/v1http://localhost:11434
Ollama Cloudhttps://ollama.com/v1https://ollama.com
+

工具说的接口 Ollama 本身就支持时,请求直接交给那个接口。两者在 magpie 里都没有 Responses 接口,所以需要翻译时,magpie 用 Chat Completions:只有 OpenAI 自家的模型优先用 Responses,只有 Claude 模型优先用 Messages。

+ +

模型列表

+

magpie 从 Chat Completions 的地址获取模型列表:http://localhost:11434/v1/models,Ollama Cloud 则是 https://ollama.com/v1/models。Ollama 里有了某个模型,magpie 里才会出现它。拉取新模型后,在供应商编辑页点 获取模型,或运行 magpie provider refresh ollama。工具能看到哪些模型,可以在供应商的模型列表里勾选,也可以在终端里设置:

+
终端
magpie provider refresh ollama
+magpie provider models ollama +qwen3
+

Ollama 0.35.0 及以后的版本(云端模型要 0.40.5)还提供决策模型,比如 Nimble、Clef 和 Tev。magpie 也会读取 Ollama 的 /api/tags,其中标为决策模型的,会成为这个供应商用于 意图路由 的决策模型,不会作为工具的模型。更早的 Ollama 不会列出这类模型。

+ +

在各个工具里用

+
终端
magpie claude ollama/qwen3
+magpie codex ollama/qwen3
+magpie gemini model ollama/qwen3
+magpie opencode ollama/qwen3
+ +

在工具里面,Claude Code 和 Codex 的 /model 也会列出 magpie 的模型,可以在本地模型和云端模型之间切换。想换回工具自带的模型,运行 magpie claude default 或 magpie codex default。

+ +

上下文窗口与 num_ctx

+

工具会按模型能接受多长的请求来安排对话。Claude Code 把不认识的模型当作 200K,Codex 在被告知的窗口用到 90% 时压缩对话。magpie 不会读取 Ollama 聊天模型的窗口,所以要把真实的窗口告诉它:供应商编辑页 高级 里的 上下文窗口,可以给全部模型设,也可以单独给某个模型设。magpie 会告知各个工具。

+
终端
magpie provider set ollama context=32k
+magpie provider set ollama context.qwen3=128k
+ + +

推理

+ +
终端
magpie model efforts ollama/qwen3 low,medium,high
+magpie model efforts ollama/qwen3 off
+ +

工具调用

+

Claude Code 和 OpenCode 的工具调用按工具写的原样到达 Ollama。Codex 和 Gemini CLI 的工具定义、模型发起的调用和调用结果,magpie 都会翻译成 Chat Completions 再翻译回来,流式回复也一样。

+ +

脱敏

+

magpie 的 本地脱敏 会在请求离开网关前把 Key、Token 等敏感信息换成占位符,发给本地 Ollama 的请求也一样。模型就跑在你自己的电脑或局域网里时,可以在编辑页打开 请求不脱敏,或运行 magpie provider set ollama unmasked=yes。

+ + +

用量与费用

+ +
终端
magpie model price ollama/qwen3 0,0,0,0
+magpie provider set ollama free=yes
+magpie provider quota-rest ollama-cloud 7d
+magpie provider fallback ollama-cloud ollama/qwen3
+ +

把 magpie 当作 Ollama 服务

+

有些应用只能以 Ollama 服务的形式接入自定义模型:VS Code Copilot 的 Ollama 供应商、Visual Studio Copilot 的 BYOK、Zed 的 Ollama 供应商,还有 ollama 命令行。把它们指向 magpie 的网关 http://127.0.0.1:3425,就能看到 magpie 的模型,而且是所有供应商的,不只是 Ollama 的。

+ + +

常见报错

+ + +

常见问题

+

Claude Code 怎么用 Ollama 的本地模型?

+

在 magpie 里添加 Ollama(供应商 → 添加供应商 → 本机下的 Ollama),然后在 Claude Code 那一行选它的模型,或者运行 magpie claude ollama/qwen3。Claude Code 的请求经过 magpie 网关,原样发到 Ollama 在 http://localhost:11434 的 Anthropic Messages 接口。

+

Codex 能用 Ollama 吗?

+

能。Codex 只会说 Responses 接口,magpie 会把它的请求转成 Chat Completions 发给 Ollama,再把回复转回来,工具调用也一样。运行 magpie codex ollama/qwen3 即可。

+

Gemini CLI 和 OpenCode 能用 Ollama 吗?

+

能。Gemini CLI 说的是 Google 的接口,magpie 把它的请求翻译成 Ollama 的 Chat Completions,再把回复翻译回去。OpenCode 本身说 Chat Completions,请求原样发给 Ollama。运行 magpie gemini model ollama/qwen3 或 magpie opencode ollama/qwen3。

+

怎么在 Claude Code 里用 Ollama 的 qwen3-coder?

+

先在 Ollama 里拉取它,再在 magpie 的供应商编辑页点「获取模型」(或运行 magpie provider refresh ollama),然后在 Claude Code 那一行选中它。它在 magpie 里的 ID 是 ollama/ 加上 Ollama 列出的名字,标签也算在内。记得同时设好它的上下文窗口:Claude Code 会把不认识的模型当作 200K。

+

magpie 能用另一台电脑上的 Ollama 吗?

+

能。把供应商的服务器地址改成那台电脑,比如 magpie provider set ollama address=192.168.1.20:11434。局域网里的服务器会直接连接,不走设置或系统里的代理。

+

magpie 支持 Ollama Cloud 吗?

+

支持。用 ollama.com/settings/keys 上创建的 Key 添加 Ollama Cloud,magpie 会列出这个 Key 能用的模型,按 models.dev 的价格计费,并显示账户套餐内的额度和你购买的余额。

+

本地 Ollama 需要 API Key 吗?

+

不需要,Ollama 预设不用 Key。Ollama Cloud 需要。

+ +

LM Studio、oMLX、vLLM、llama.cpp 等其他本地服务见 本地模型。想让本地模型给每个请求分类、决定路由,见 意图路由。

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot

+

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

+
+
+ + + + + + + diff --git a/site/public/docs/zh/opencode-models.html b/site/public/docs/zh/opencode-models.html index 3e1d5880f..2b36bc4b5 100644 --- a/site/public/docs/zh/opencode-models.html +++ b/site/public/docs/zh/opencode-models.html @@ -239,7 +239,7 @@ magpie visible opencode all # 恢复显示全部
终端
magpie opencode default

它会恢复接入 magpie 之前的 model 和 small_model,并把 magpie 供应商从文件里删掉。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · OpenRouter · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · OpenRouter · GitHub Copilot · Ollama

常见问题

OpenCode 怎么用 DeepSeek?

diff --git a/site/public/docs/zh/openrouter.html b/site/public/docs/zh/openrouter.html index a4c886f47..925d1f59a 100644 --- a/site/public/docs/zh/openrouter.html +++ b/site/public/docs/zh/openrouter.html @@ -288,7 +288,7 @@ magpie group set opus-anywhere stays=session models+=openrouter/anthropic/claude

为什么 magpie 从 /api/v1 拉取 OpenRouter 的模型列表?

在 Anthropic 地址上拉列表,OpenRouter 返回的是挂在 anthropic/ 前缀下的目录,里面的 id 它并不提供服务。magpie 从 Chat Completions 地址 https://openrouter.ai/api/v1 拉列表;只填了 OpenRouter Anthropic 地址的供应商,会提示你补上这个 Chat 地址。

-

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · GitHub Copilot

+

按供应商:DeepSeek · Kimi 与 Kimi Code · GLM 编程套餐 · 通义千问 · MiniMax · Gemini · Grok · Mistral · GitHub Copilot · Ollama

各个工具的指南:Claude Code 接入其他模型、Codex 接入其他模型、Gemini CLI 接入其他模型、OpenCode 接入其他模型。遇到问题可以在 Discord 提问。

diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index 50ef965e2..d610baaaa 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -413,7 +413,7 @@ With several keys or accounts, magpie can spread Claude Code’s requests over t The routing modes are in [Get started](https://usemagpie.ai/docs/start#routing). -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) ## FAQ @@ -545,7 +545,7 @@ Requests on a Claude subscription run through the Claude Code installed on your The routing modes are in [Get started](https://usemagpie.ai/docs/start#routing). -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) ## FAQ @@ -662,7 +662,7 @@ Gemini CLI still speaks the Gemini API; magpie translates each request for the m The routing modes and rules are in [Get started](https://usemagpie.ai/docs/start#routing). -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) ## FAQ @@ -995,7 +995,7 @@ magpie opencode default It puts back the `model` and `small_model` OpenCode had before magpie, and takes the `magpie` provider out of the file. -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) ## FAQ @@ -1667,7 +1667,7 @@ Yes. magpie reads OpenRouter’s credits endpoint and shows what is left in doll Asked at the Anthropic base, OpenRouter answers with its catalog under `anthropic/` names it doesn’t serve. magpie fetches the list from the Chat Completions base, `https://openrouter.ai/api/v1`, and a provider given only OpenRouter’s Anthropic base is told to add that Chat base. -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. @@ -1814,7 +1814,7 @@ Yes. magpie reads the plan from GitHub: Free, Pro, Pro+, Max, Education, Busines magpie lists what Copilot’s `/models` gives the account: chat models only, without the ones no model picker offers or the account can’t turn on. A model Copilot answered with “The requested model is not supported.” is left out for 6 hours, then tried again in case your plan changed. -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [Ollama](https://usemagpie.ai/docs/ollama) Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. @@ -1970,7 +1970,7 @@ Yes. Add the Google Vertex AI preset with your project’s id, for example `magp Yes. Both are subscriptions: `magpie accounts add gemini` or `magpie accounts add antigravity`, then pick a `gemini/…` or `antigravity/…` model. Code Assist needs a Standard or Enterprise account with a Google Cloud project of its own. -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. @@ -2108,7 +2108,324 @@ xAI can’t read reasoning that another vendor sealed, and answers “Could not No. The Usage tab counts tokens, cache and cost for every Grok call, priced from models.dev, but magpie reads no balance from xAI. You can type the balance in with `magpie provider key-balance`, and the Usage page shows it less what magpie has priced since. -**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) + +Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. + +--- + +Source: https://usemagpie.ai/docs/mistral + +# Mistral in Claude Code, Codex, Gemini CLI and OpenCode + +Mistral serves its models on one API, OpenAI-style Chat Completions, at `api.mistral.ai`. Add a Mistral API key to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use Mistral through magpie’s local gateway at `127.0.0.1:3425`, each agent with a model of its own. Agents that speak another API are translated on the way. + +## Add Mistral + +1. **Get a key.** Make one on [console.mistral.ai](https://console.mistral.ai/api-keys). A Le Chat plan’s Vibe key goes in the same provider. +2. **Add the provider.** In magpie’s Providers tab, press + Add provider, pick Mistral, paste the key and save. magpie asks Mistral which models the key can use. +3. **Pick it for an agent.** In the Agents tab, click the model on the agent’s row and choose a Mistral model such as `mistral-large-4`. + +``` +magpie provider add mistral +magpie provider test mistral +``` + +Model ids in magpie are `provider/model`, so Mistral’s read `mistral/mistral-large-4`: the provider, then Mistral’s own id. The key is kept in magpie’s settings; magpie doesn’t take it from your shell. + +Already set Mistral up in OpenCode or Alma? magpie’s import from those apps brings it in as the Mistral provider. An app that keeps one entry per key (“Mistral #0001”, “Mistral #0002”…) becomes one Mistral provider with that many keys, listed once in every agent’s picker. + +## Endpoints + +| API | Address | Used for | +| --- | --- | --- | +| Chat Completions | `https://api.mistral.ai/v1` | the model list and every agent’s requests: OpenCode’s as they are, Claude Code’s, Codex’s and Gemini CLI’s translated | +| Billing | `https://api.mistral.ai/v1/billing/budget`, `/v1/billing/subscription` | a key’s month of Vibe or API budget, and the plan it is on | + +magpie’s Mistral provider has no Anthropic Messages or Responses address, so an agent that speaks either is translated to Chat Completions and the reply translated back, streaming and tool calls included. + +## Model list + +magpie fetches the list from Mistral, at `https://api.mistral.ai/v1/models`, so agents see the models your key can use. Names, reasoning levels and prices come from models.dev’s `mistral` catalog, and Devstral, Codestral and Magistral models carry Mistral’s logo in every picker. Mistral also serves models from other labs, such as GLM and DeepSeek’s `deepseek-v4.1-flash-1017`; they come through the same key, and the fixes below apply to them too. Pick the models agents see in the provider’s model list, or from the terminal: + +``` +magpie provider models mistral +mistral-large-4 +mistral-medium-3.5 +magpie provider refresh-every mistral 1d +``` + +## In each agent + +``` +magpie claude mistral/mistral-large-4 +magpie codex mistral/mistral-large-4 +magpie gemini model mistral/mistral-large-4 +magpie opencode mistral/mistral-large-4 +``` + +- **Claude Code.** speaks Anthropic Messages, which Mistral doesn’t serve. magpie translates each request to Chat Completions and the reply back; a reasoning model’s thinking reaches Claude Code as thinking, then the text. [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models). +- **Codex.** speaks OpenAI Responses, which Mistral doesn’t serve either, so its requests are translated too. Codex’s custom tools, such as `apply_patch`, are offered to the model as functions, and its calls come back as the custom tool calls Codex runs. [Models in Codex](https://usemagpie.ai/docs/codex-models). +- **Gemini CLI.** speaks Google’s Gemini API. magpie translates each request to Chat Completions and the reply back. [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models). +- **OpenCode.** speaks Chat Completions, so its requests go to Mistral as they are, with the fixes below. [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). + +## What magpie fixes for Mistral + +Mistral’s API is strict about what it takes and sends a reasoning model’s thinking in a shape of its own. magpie changes both on the way, on requests it passes on and on those it translates alike: + +- **Thinking in typed parts..** Mistral sends a reasoning model’s thinking as typed parts in `content`, thinking and text sometimes in one chunk, where the Chat contract has a string. OpenCode turned the first such chunk away (“Invalid … stream event”). magpie moves the thinking to `reasoning_content` and the text to a plain string, streamed or not. +- **Thinking sent back..** OpenCode sends an earlier turn’s thinking back in `reasoning_content`, which Mistral refuses with 422 `extra_forbidden`. magpie puts it in the thinking part Mistral itself returns, ahead of the turn’s text, so the thinking stays in context. Translated requests get the same, so a Codex tool loop keeps going on a DeepSeek model served by Mistral. +- **Fields Mistral doesn’t know..** OpenCode’s `store` and Kimi Code’s thinking switch got 422 `extra_forbidden`. magpie asks again without the optional fields Mistral named, and doesn’t send them to it again once that works. +- **Ollama options..** An agent that took the gateway for an Ollama server, such as Hermes Agent, sends Ollama’s `options` (its `num_ctx`) beside the Chat fields. magpie leaves them out, so Mistral never sees them. + +## Reasoning + +- **Effort..** The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels aren’t known is asked as the agent asked. +- **Reasoning off..** When an agent whose requests magpie translates, such as Gemini CLI, turns reasoning off and the model lists `none` among its levels, magpie asks for none. +- **Thinking across turns..** Each agent sees a reasoning model’s thinking in its own shape: `reasoning_content` for OpenCode, thinking blocks for Claude Code, reasoning for Codex. When it comes back in a later turn, Mistral gets it as a thinking part; see What magpie fixes. + +## Web search + +Mistral’s Chat Completions API doesn’t search the web for magpie, so magpie gives the model its own search tool in every agent, answered by the searcher chosen in Settings, or by one magpie picks when none is chosen. + +## Vibe, cost and usage + +- **Vibe month..** A Le Chat plan (Pro, Student or Team) comes with a month of Mistral Vibe. Its Vibe key’s row shows how much of the month’s budget is used, in the currency Mistral bills in, when it resets, and the plan’s name. +- **API month..** A Studio key made in the console shows the organization’s API budget, as “API · Month”, apart from a Vibe month. The budget is the organization’s, so every key of one organization shows the same numbers. A key with no budget has no card. +- **Pay as you go..** With pay-as-you-go on, what goes past the budget is billed rather than stopped, so a used-up month doesn’t stop the key’s models. +- **Cache tokens..** When a reply reports cached prompt tokens, the Usage tab counts them apart from the rest of the prompt. +- **Keeping the cache..** With several keys, a conversation stays on its key while its cache is worth keeping, 1,024 tokens or more, and still warm, read within the last five minutes. +- **Cost..** The Usage tab prices each call with Mistral’s prices from models.dev. magpie reads no balance from Mistral; type it in with `key-balance`, and the Usage page shows it less what magpie has priced the key’s calls at since. + +## Several keys and failover + +One Mistral provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. + +- **Spend caps..** `spend-cap` stops a key at a dollar amount a day, a month or in all, as the Usage tab prices its calls; routing then goes on to the other keys and the fallbacks. +- **Fallbacks..** `fallback` names where requests go when Mistral is out of quota or down: another provider’s model or a routing group. + +``` +magpie provider spend-cap mistral 20 month +magpie provider key-balance mistral 25 +magpie provider fallback mistral deepseek/deepseek-v4-pro +``` + +## Troubleshooting + +- **422 `extra_forbidden`, “Extra inputs are not permitted”..** Mistral turned away a field it doesn’t know. magpie fixes the ones agents are known to send and asks again without an optional field Mistral names; see What magpie fixes. +- **“Invalid … stream event” in OpenCode..** That was Mistral’s thinking in typed parts. magpie sends OpenCode the thinking in `reasoning_content` and the text as a string. +- **No Vibe card..** magpie shows the month only for a key Mistral says is a Vibe key or a Studio key, and only when its budget is more than zero. +- **Checking a key..** `magpie provider test mistral` sends a tiny request through each endpoint, or to each model you name. Add `--as codex` or `--as claude-code` to send it the way that agent would. + +## FAQ + +### How do I use Mistral in Claude Code? + +Add your Mistral API key in magpie (Providers, Add provider, Mistral), then pick a Mistral model such as `mistral-large-4` on Claude Code’s row, or run `magpie claude mistral/mistral-large-4`. Mistral serves Chat Completions only, so magpie translates Claude Code’s Anthropic Messages requests to `https://api.mistral.ai/v1` and the replies back, thinking included. + +### Can Codex use Devstral and other Mistral models? + +Yes. Codex can use any model your Mistral key lists, Devstral among them. Codex speaks OpenAI Responses, which Mistral doesn’t serve, so magpie translates each request to Chat Completions, offers Codex’s custom tools such as apply_patch as functions, and gives the calls back the way Codex runs them. + +### How do I use Codestral or other Mistral models in OpenCode? + +Pick the model in magpie, or run `magpie opencode mistral/mistral-large-4`; Codestral and Devstral work the same way when your key lists them. OpenCode speaks Chat Completions, so its requests go to Mistral as they are, with what Mistral would refuse fixed on the way: OpenCode’s `store` field, and earlier turns’ thinking sent back in `reasoning_content`. + +### Can Gemini CLI use Mistral? + +Yes. Gemini CLI speaks Google’s Gemini API, so magpie translates its requests to Mistral’s Chat Completions and the replies back, streaming and tool calls included. Run `magpie gemini model mistral/mistral-large-4`. + +### Why does Mistral answer 422 extra_forbidden? + +Mistral turns away any field it doesn’t know. magpie sends an earlier turn’s thinking as the thinking part Mistral takes, leaves out Ollama options some agents add, and asks again without an optional field Mistral names, such as OpenCode’s `store`, then stops sending it. + +### Does magpie show my Le Chat plan’s Vibe budget? + +Yes. A Vibe key from a Le Chat plan (Pro, Student or Team) shows how much of the month’s Vibe budget is used, in the currency Mistral bills in, and when it resets, with the plan’s name. A Studio key made in the console shows the organization’s API budget instead, as “API · Month”. + +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) · [Ollama](https://usemagpie.ai/docs/ollama) + +Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. + +--- + +Source: https://usemagpie.ai/docs/ollama + +# Ollama in Claude Code, Codex, Gemini CLI and OpenCode + +Ollama serves the models you pull on two APIs, OpenAI Chat Completions and Anthropic Messages, at `http://localhost:11434`. Ollama Cloud serves its models the same way at `ollama.com`, with an API key. Add either to magpie once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use them through magpie’s local gateway at `127.0.0.1:3425`, each agent with a model of its own. + +## Add Ollama + +1. **Pull a model.** Pull a model in Ollama, such as `qwen3`, and leave the server running. +2. **Add the provider.** In magpie’s Providers tab, press + Add provider and pick Ollama under On this machine. No key is needed. magpie asks the server which models it has, and they show as `ollama/…`. +3. **Pick it for an agent.** In the Agents tab, click the model on the agent’s row and choose an Ollama model. + +``` +ollama pull qwen3 +magpie provider add ollama +magpie provider test ollama +``` + +Model ids in magpie are `provider/model`, so a model you pulled as `qwen3` reads `ollama/qwen3`. A tag stays in the id, as in `ollama/qwen3:8b`. In the terminal UI, magpie asks for the server’s address when you add it. LM Studio, oMLX, vLLM and llama.cpp’s server are in [Local models](https://usemagpie.ai/docs/local-models). + +## Another port or another computer + +If Ollama listens on another port, or runs on another computer such as a GPU box or a NAS, change Server address in the provider’s editor. Only the scheme, host and port change; each API keeps its path. The scheme can be left out, and `http` is taken; a path pasted with the address, such as `/v1`, is dropped. + +``` +magpie provider set ollama address=192.168.1.20:11434 +magpie provider set ollama address= # back to the default +``` + +- **Proxies..** A server on your own network is reached directly, whatever proxy Settings or the system name. A proxy you set on the provider itself is still used. +- **HTTPS..** An Ollama behind HTTPS with a self-signed certificate can be reached with Don't check its certificate in the editor. It applies to that provider’s own hosts only. + +## Ollama Cloud + +1. **Get a key.** Make one at [ollama.com/settings/keys](https://ollama.com/settings/keys). +2. **Add the provider.** In the Providers tab, press + Add provider, pick Ollama Cloud, paste the key and save. magpie asks Ollama Cloud which models the key can use. +3. **Pick it for an agent.** Choose an Ollama Cloud model, such as `deepseek-v4-pro`, on the agent’s row. + +``` +magpie provider add ollama-cloud +magpie claude ollama-cloud/deepseek-v4-pro +``` + +Names, reasoning levels and prices come from models.dev’s `ollama-cloud` catalog. The key is kept in magpie’s settings. + +## Endpoints + +| Provider | Chat Completions | Anthropic Messages | +| --- | --- | --- | +| Ollama | `http://localhost:11434/v1` | `http://localhost:11434` | +| Ollama Cloud | `https://ollama.com/v1` | `https://ollama.com` | + +An agent whose API Ollama serves is passed on to that API. magpie uses no Responses endpoint for either, so when it has to translate, it uses Chat Completions: it keeps Responses first only for OpenAI’s own models, and Messages first only for Claude models. + +## Model list + +magpie asks the server for its list at the Chat Completions base: `http://localhost:11434/v1/models`, or `https://ollama.com/v1/models` for Ollama Cloud. A model shows in magpie once Ollama has it. After you pull another, press Fetch models in the provider’s editor, or run `magpie provider refresh ollama`. Pick the models agents see in the provider’s model list, or from the terminal: + +``` +magpie provider refresh ollama +magpie provider models ollama +qwen3 +``` + +Ollama 0.35.0 and later (0.40.5 for its cloud models) also serves decision models, such as Nimble, Clef and Tev. magpie reads Ollama’s `/api/tags` as well, and a model marked there as a decision model becomes one of the provider’s decision models for [intent routing](https://usemagpie.ai/docs/intent), never an agent’s model. An older Ollama lists none. + +## In each agent + +``` +magpie claude ollama/qwen3 +magpie codex ollama/qwen3 +magpie gemini model ollama/qwen3 +magpie opencode ollama/qwen3 +``` + +- **Claude Code.** speaks Anthropic Messages, and so does Ollama at `http://localhost:11434`, so its requests go there as they are. [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models). +- **Codex.** speaks OpenAI Responses, which magpie doesn’t send to Ollama. magpie turns each request into Chat Completions and the reply back, streaming and tool calls included. [Models in Codex](https://usemagpie.ai/docs/codex-models). +- **Gemini CLI.** speaks Google’s Gemini API. magpie translates each request to Chat Completions and the reply back. [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models). +- **OpenCode.** speaks Chat Completions, so its requests go to Ollama’s `/v1` as they are. [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). + +Inside the agent, Claude Code’s and Codex’s `/model` list magpie’s models too, so you can move between a local model and a cloud one there. To go back to the agent’s own models, run `magpie claude default` or `magpie codex default`. + +## Context window and num_ctx + +Agents plan around how long a request the model takes. Claude Code takes a model it doesn’t know for 200K, and Codex compacts a conversation at 90% of the window it is told. magpie doesn’t read an Ollama chat model’s window, so tell it the real one: Context window under Advanced in the provider’s editor, for every model or one of them. magpie passes it on to the agents. + +``` +magpie provider set ollama context=32k +magpie provider set ollama context.qwen3=128k +``` + +- **`num_ctx`..** Some clients send Ollama’s per-request options, such as `{"num_ctx": …}`, beside the Chat Completions fields. magpie leaves them out of every request it sends on: no Chat Completions API reads them, Ollama’s own `/v1` included. The window the model runs with is Ollama’s to set; give magpie the same number. +- **Too long..** When a conversation outgrows the window, Ollama answers “exceeded max context length”. magpie tells the agent so the way it understands, `context_length_exceeded` or Anthropic’s “prompt is too long”, so the agent compacts and tries again. + +## Reasoning + +- **Effort..** The effort an agent asks for is fitted to the nearest level the model has, as the catalog lists them. A model whose levels magpie doesn’t know is asked as the agent asked. +- **Reasoning off..** When an agent whose requests magpie translates, such as Codex or Gemini CLI, turns reasoning off and the model lists `none` among its levels, magpie asks for none. +- **Your own levels..** `magpie model efforts` offers only the levels you name, or sends a model no reasoning field at all. + +``` +magpie model efforts ollama/qwen3 low,medium,high +magpie model efforts ollama/qwen3 off +``` + +## Tool calls + +Claude Code’s and OpenCode’s tool calls reach Ollama as the agent wrote them. For Codex and Gemini CLI, magpie translates the tools, the model’s calls and their results to Chat Completions and back, in streamed replies too. + +## Privacy masking + +magpie’s [privacy masking](https://usemagpie.ai/docs/masking) replaces keys, tokens and other secrets with placeholders before a request leaves the gateway, a request to a local Ollama too. When the model runs on your own computer or network, you can turn on Send requests unmasked in its editor, or run `magpie provider set ollama unmasked=yes`. + +- **Cloud models..** Ollama’s cloud models pass a request on to a vendor whatever the address, so it is your call. The editor warns you while it is on for a provider that isn’t local, such as Ollama Cloud. +- **Tool arguments..** In a request in Ollama’s own format, a tool call’s arguments are masked as tool arguments, as in every other API. +- **Anonymous stats..** magpie’s daily stats name an Ollama model only when models.dev knows it; any other counts as “other”. See [Privacy](https://usemagpie.ai/docs/privacy). + +## Usage and cost + +- **Usage..** The Usage tab counts the tokens of every Ollama call. A model is priced at the price magpie finds for its id, which for a local model can be its maker’s list price. To count a local model at nothing, give it your own price. +- **Free first..** `free=yes` counts every model of the provider as free, so a Free first routing spends it before paid ones. Prices and Usage’s costs stay as listed. +- **Ollama Cloud’s allowance..** magpie reads the account’s balance from Ollama Cloud. The included allowance shows as a plan, in dollars used, with when it resets; an older plan shows its session and weekly limits instead. Credits you bought show as a balance. Past the allowance Ollama Cloud draws on those credits, so a spent allowance with credits left doesn’t stop the key. +- **Peak hours..** On Ollama Cloud, `deepseek-v4.1-flash` and `deepseek-v4-pro` (with their tags) cost double from 12:00 to 18:00 UTC, Monday to Friday. models.dev lists the off-peak price; the Usage tab doubles it in those hours, and a Cheapest first routing counts it. +- **Out of allowance..** When Ollama Cloud says a key is out without saying when it comes back, as its weekly limit does, magpie rests the key for 15 minutes. `quota-rest` sets how long, up to 8 days. With several keys (Add another key) the next one takes over; when every key is out, the gateway answers at once with Retry-After. + +``` +magpie model price ollama/qwen3 0,0,0,0 +magpie provider set ollama free=yes +magpie provider quota-rest ollama-cloud 7d +magpie provider fallback ollama-cloud ollama/qwen3 +``` + +## magpie as an Ollama server + +Some apps take a custom model only as an Ollama server: VS Code’s Copilot Ollama provider, Visual Studio’s Copilot BYOK, Zed’s Ollama provider and the `ollama` CLI. Point them at magpie’s gateway, `http://127.0.0.1:3425`, and they see magpie’s models, from every provider, not only Ollama. + +- **Routes..** magpie answers `/api/version`, `/api/tags`, `/api/show`, `/api/chat` and `/api/generate`. +- **The same path..** A chat there is served as `/v1/chat/completions` is, so key limits, routing, fallbacks and usage are the same. A gateway key held to some models lists only those. +- **What it tells..** `/api/tags` and `/api/show` mark tools, vision when the model reads images, and thinking when it reasons. `/api/show` also gives the model’s window, or 32768 for one magpie doesn’t know. The `ollama` CLI’s `name:latest` finds a model called `name`. + +## Troubleshooting + +- **A model you pulled isn’t listed..** The list comes from the server. Press Fetch models, or run `magpie provider refresh ollama`, and pick it in the provider’s model list. Use the name Ollama lists, tag included. +- **Ollama isn’t running..** `magpie provider test ollama` sends a tiny request through each endpoint, or to each model you name; add `--as codex` or `--as claude-code` to send it the way that agent would. Start Ollama, or check Server address. `fallback` names where requests go while it is down. +- **“exceeded max context length”..** The conversation is longer than the model was loaded for. Set the real Context window on the provider, and the agents compact before they reach it. +- **Another computer can’t be reached..** Check the address and port in Server address; for HTTPS with a self-signed certificate, turn on Don't check its certificate. + +## FAQ + +### How do I use Ollama in Claude Code? + +Add Ollama in magpie (Providers, Add provider, Ollama under On this machine), then pick one of its models on Claude Code’s row, or run `magpie claude ollama/qwen3`. Claude Code’s requests go through magpie’s gateway to Ollama’s Anthropic Messages API at `http://localhost:11434` as they are. + +### Can Codex use Ollama? + +Yes. Codex speaks only the Responses API, so magpie turns its requests into Chat Completions for Ollama, and the replies back, tool calls included. Run `magpie codex ollama/qwen3`. + +### Can Gemini CLI and OpenCode use Ollama? + +Yes. Gemini CLI speaks Google’s API, so magpie translates its requests to Ollama’s Chat Completions and the replies back. OpenCode speaks Chat Completions, so its requests go to Ollama as they are. Run `magpie gemini model ollama/qwen3` or `magpie opencode ollama/qwen3`. + +### How do I run qwen3-coder from Ollama in Claude Code? + +Pull it in Ollama, press Fetch models in the provider’s editor in magpie (or run `magpie provider refresh ollama`), and pick it on Claude Code’s row. Its id in magpie is `ollama/` and the name Ollama lists it under, tag included. Set its Context window too: Claude Code takes a model it doesn’t know for 200K. + +### Can magpie use Ollama on another computer? + +Yes. Set the provider’s Server address to that computer, such as `magpie provider set ollama address=192.168.1.20:11434`. A server on your own network is reached directly, not through a proxy set in Settings or the system. + +### Does magpie work with Ollama Cloud? + +Yes. Add Ollama Cloud with a key from `ollama.com/settings/keys`. magpie lists the models the key can use, prices them from models.dev, and shows the account’s included allowance and the credits you bought. + +### Do I need an API key for a local Ollama? + +No. The Ollama preset takes none. Ollama Cloud needs one. + +Other local servers, such as LM Studio, oMLX, vLLM and llama.cpp’s server, are in [Local models](https://usemagpie.ai/docs/local-models). To let a local model classify each request for routing, see [Intent routing](https://usemagpie.ai/docs/intent). + +**By provider:** [DeepSeek](https://usemagpie.ai/docs/deepseek) · [Kimi and Kimi Code](https://usemagpie.ai/docs/kimi) · [GLM Coding Plan](https://usemagpie.ai/docs/glm) · [Qwen](https://usemagpie.ai/docs/qwen) · [MiniMax](https://usemagpie.ai/docs/minimax) · [Gemini](https://usemagpie.ai/docs/gemini) · [Grok](https://usemagpie.ai/docs/grok) · [Mistral](https://usemagpie.ai/docs/mistral) · [OpenRouter](https://usemagpie.ai/docs/openrouter) · [GitHub Copilot](https://usemagpie.ai/docs/copilot) Every agent: [Models in Claude Code](https://usemagpie.ai/docs/claude-code-models), [Models in Codex](https://usemagpie.ai/docs/codex-models), [Models in Gemini CLI](https://usemagpie.ai/docs/gemini-cli-models), [Models in OpenCode](https://usemagpie.ai/docs/opencode-models). Ask on [Discord](https://discord.gg/vGSnD3ZKQF) if you get stuck. diff --git a/site/public/llms.txt b/site/public/llms.txt index db21a1877..6629e229f 100644 --- a/site/public/llms.txt +++ b/site/public/llms.txt @@ -53,6 +53,8 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA - [GitHub Copilot in every agent](https://usemagpie.ai/docs/copilot): a Copilot seat's models in Claude Code, Codex, Gemini CLI and OpenCode; signing in (editors, Copilot CLI, GHE.com), Copilot Auto, premium requests, several accounts and errors. - [Gemini in every agent](https://usemagpie.ai/docs/gemini): a Google AI Studio key (or Vertex AI) in Claude Code, Codex, Gemini CLI and OpenCode; endpoints, thinking levels, thought signatures across tool calls, tool schemas, search and rate limits. - [Grok in every agent](https://usemagpie.ai/docs/grok): an xAI API key in Claude Code, Codex, Gemini CLI and OpenCode; which API each agent's requests use, what magpie fixes for xAI, reasoning effort, web search, prompt cache and several keys. +- [Mistral in every agent](https://usemagpie.ai/docs/mistral): a Mistral API key in Claude Code, Codex, Gemini CLI and OpenCode; the model list, what magpie fixes for Mistral (thinking parts, refused fields), effort, search, cache and the plan card. +- [Ollama in every agent](https://usemagpie.ai/docs/ollama): local Ollama, Ollama on another computer and Ollama Cloud in Claude Code, Codex, Gemini CLI and OpenCode; addresses, model list, context window, reasoning, tools, masking, pricing, and magpie as an Ollama server. - [Intent routing](https://usemagpie.ai/docs/intent): how a turn is routed by what the user asks for. - [Privacy masking](https://usemagpie.ai/docs/masking): what is masked before a request leaves the computer and how values come back. - [Library](https://usemagpie.ai/docs/library): instructions, MCP servers, skills, hooks and subagents for each agent. diff --git a/site/public/sitemap.xml b/site/public/sitemap.xml index 91dbd4f58..6b5186c1d 100644 --- a/site/public/sitemap.xml +++ b/site/public/sitemap.xml @@ -32,6 +32,8 @@ https://usemagpie.ai/docs/copilot https://usemagpie.ai/docs/gemini https://usemagpie.ai/docs/grok +https://usemagpie.ai/docs/mistral +https://usemagpie.ai/docs/ollama https://usemagpie.ai/docs/zh/claude-code-models https://usemagpie.ai/docs/zh/codex-models https://usemagpie.ai/docs/zh/contributors @@ -60,6 +62,8 @@ https://usemagpie.ai/docs/zh/copilot https://usemagpie.ai/docs/zh/gemini https://usemagpie.ai/docs/zh/grok +https://usemagpie.ai/docs/zh/mistral +https://usemagpie.ai/docs/zh/ollama https://usemagpie.ai/docs/ja/claude-code-models https://usemagpie.ai/docs/ja/codex-models https://usemagpie.ai/docs/ja/contributors @@ -87,4 +91,6 @@ https://usemagpie.ai/docs/ja/copilot https://usemagpie.ai/docs/ja/gemini https://usemagpie.ai/docs/ja/grok +https://usemagpie.ai/docs/ja/mistral +https://usemagpie.ai/docs/ja/ollama