Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

docs: point dsh's own DeepSeek row at magpie by hand (#3298)

yetonee3491e2bb0a3
diff --git a/docs/reference.md b/docs/reference.md
index dd151289c..7c8ff54ce 100644
--- a/docs/reference.md
+++ b/docs/reference.md
@@ -191,6 +191,76 @@ The released-client stream/tool contract test is run with
'^TestReasonixStudioCLIIntegration$' -count=1`. It uses isolated settings and
a local test upstream, with no vendor credentials.
+#### DeepSeek Harness: the DeepSeek row by hand
+
+Connecting dsh gives it magpie's own routes on dsh's pi-ai adapter
+(`magpie`, `magpie-responses`, `magpie-anthropic`). dsh's DeepSeek row
+(`llm-deepseek`, the `deepseek-official` route) is dsh's: magpie never
+points it anywhere, and Disconnect leaves an entry of yours there alone.
+That row does more for DeepSeek's own models than pi-ai does: when dsh's
+prompt or tools change mid-session it adds the change to the history
+(`systemPromptUpdate: in-history`, `toolUpdate: addition-only`), so
+DeepSeek keeps its cache of what came before, and it uploads images
+through the Files API (#3298). To keep that and still go through magpie
+(usage, sessions, the accounts behind `deepseek/…`), point the row at
+the gateway yourself, in `~/.dsh/profiles/<profile>/cordis.patch.yml`
+(`desktop` for the app, `web` for `dsh web`, `headless`):
+
+```yaml
+- id: llm-deepseek
+ config:
+ baseURL: http://127.0.0.1:3425
+ apiKeyEnv: MAGPIE_DS_KEY
+ models:
+ - id: deepseek/deepseek-flash
+ name: DeepSeek V4.1 Flash (magpie)
+ contextWindow: 1000000
+ inputModalities: [text, image]
+ systemPromptUpdate: in-history
+ toolUpdate: addition-only
+ - id: deepseek/deepseek-v4-pro
+ name: DeepSeek V4 Pro (magpie)
+ contextWindow: 1000000
+```
+
+- `baseURL` is the gateway's root, with no `/anthropic`: llm-deepseek adds
+ `/v1/messages` itself (`http://127.0.0.1:3425/v1` works too).
+- The model ids are magpie's (`magpie models`); dsh sends them as written and
+ magpie asks DeepSeek for its own name (`deepseek-flash`). A `models` list
+ replaces llm-deepseek's defaults, which give the in-history updates to its
+ own `deepseek-flash` entry only, so name them again on yours.
+- The key is the gateway's, not DeepSeek's: `magpie` on this computer, the
+ sharing key from another one. magpie sends DeepSeek your DeepSeek key from
+ the provider, as for any agent. Keep it under a name of your own
+ (`MAGPIE_DS_KEY`): `DEEPSEEK_API_KEY` is your DeepSeek key's, and magpie
+ takes `MAGPIE_GATEWAY_KEY` out on Disconnect. Export it, put it in
+ `~/.dsh/.env` (the CLI reads that), or enter it on the DeepSeek row in dsh's
+ Models page (dsh's own key store, the one the desktop app reads).
+- Start sessions on the row's model in dsh. Picking a model for dsh in magpie
+ sets dsh's start on one of magpie's routes again.
+
+What goes through, tried with dsh 0.2.1-rc.2 (`dsh --profile headless`) and
+a DeepSeek API key: llm-deepseek's request reaches DeepSeek's Anthropic
+endpoint as dsh wrote it, its effort (`output_config.effort`), a system
+message in the history, `tool_addition` blocks, the `anthropic-beta` header
+and its `dsh_session_log` and `dsh_plugin_packages` fields included. A system
+message added after two turns was followed and the turns before it were read
+from DeepSeek's cache. The session (`x-deepseek-harness-session-id`) and a
+compaction (`x-deepseek-harness-compact`) are recorded as on magpie's own
+routes. Neither header, nor `x-deepseek-harness-user-id`, goes on to DeepSeek.
+
+What doesn't:
+- magpie has no Files API. llm-deepseek's upload to `/v1/files` is answered
+ 404, and it sends that request's images inline as base64 instead, every
+ turn, up to `maxInlineRequestImageBytes` (20 MiB by default; past it dsh
+ takes the oldest images out of the request), where Files would take
+ 128 MiB (`maxRequestFilesBytes`). Raise it in
+ your entry for long sessions with many images, as in
+ `maxInlineRequestImageBytes: 67108864`.
+- Keep the row on DeepSeek's own models. magpie passes llm-deepseek's fields
+ on as they are, `dsh_session_log` (dsh's log of the session) among them, so
+ another provider's model on this row would be sent them too.
+
#### VSCodium Chat
VSCodium's Chat features are disabled by default. To use the Chat model
diff --git a/site/public/docs/ja/start.html b/site/public/docs/ja/start.html
index dc90a4793..0abc15e0d 100644
--- a/site/public/docs/ja/start.html
+++ b/site/public/docs/ja/start.html
@@ -290,6 +290,28 @@ magpie claude group/opus-anywhere <span class="c"># これを使う</span></p
IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</div>
<p>Clash / mihomo の設定では、同じ行を <code>rules:</code> の下に、それぞれ先頭に <code>- </code> を付けて書きます。そのあと、エージェントからもう一度リクエストを送ってください。</p>
+ <h3 id="dsh-deepseek">DeepSeek Harness の DeepSeek 行をそのまま使い、magpie を通せますか?</h3>
+ <p>手で設定すればできます。dsh を接続すると magpie は自分のルートを足すだけで、dsh の DeepSeek 行(<code>llm-deepseek</code>)は dsh に任せます。この行は、セッションの途中でプロンプトやツールが変わっても DeepSeek のキャッシュを保ちます。magpie を通すには <code>~/.dsh/profiles/&lt;profile&gt;/cordis.patch.yml</code> に次を足します:</p>
+ <div class="code">
+ <span class="lang">cordis.patch.yml</span>
+ <button class="copy" data-copy="ex-dsh-deepseek">コピー</button>
+ <pre id="ex-dsh-deepseek">- id: llm-deepseek
+ config:
+ baseURL: http://127.0.0.1:3425
+ apiKeyEnv: MAGPIE_DS_KEY
+ maxInlineRequestImageBytes: 67108864
+ models:
+ - id: deepseek/deepseek-flash
+ name: DeepSeek V4.1 Flash (magpie)
+ contextWindow: 1000000
+ inputModalities: [text, image]
+ systemPromptUpdate: in-history
+ toolUpdate: addition-only
+ - id: deepseek/deepseek-v4-pro
+ name: DeepSeek V4 Pro (magpie)
+ contextWindow: 1000000</pre>
+ </div>
+ <p><code>baseURL</code> に <code>/anthropic</code> は付けません。モデル id は magpie のもの(<code>magpie models</code>)で、<code>models</code> を書くと dsh の既定の一覧が置き換わるので、更新方法の 2 行も残してください。<code>MAGPIE_DS_KEY</code> には DeepSeek のキーではなくゲートウェイのキー(このコンピュータでは <code>magpie</code>)を入れます。export するか、<code>~/.dsh/.env</code> に書くか、dsh のモデルページの DeepSeek 行に入力します。モデルは dsh で選びます。magpie で接続を解除してもこの設定は残ります。magpie には Files API がないため、dsh は画像を毎ターン base64 でインライン送信します。上限は <code>maxInlineRequestImageBytes</code>(既定 20 MiB、上の例では 64 MiB)です。この行では DeepSeek 自身のモデルだけを使ってください。<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#deepseek-harness-the-deepseek-row-by-hand">詳しくはリファレンスへ</a>。</p>
<p style="margin-top:48px">困ったときや、共有したい構成があるときは <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> でどうぞ。ユーザーにすぐ使えるプロバイダを配りたいベンダーの方は <a href="/docs/ja/import">magpie に追加</a> をご覧ください。</p>
</article>
</main>
diff --git a/site/public/docs/start.html b/site/public/docs/start.html
index 6c1d1b4ae..5d31995b0 100644
--- a/site/public/docs/start.html
+++ b/site/public/docs/start.html
@@ -290,6 +290,28 @@ magpie claude group/opus-anywhere <span class="c"># use it</span></pre>
IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</div>
<p>In a Clash or mihomo config the same lines go under <code>rules:</code>, each starting with <code>- </code>. Then send the agent a new request.</p>
+ <h3 id="dsh-deepseek">Can DeepSeek Harness keep its own DeepSeek row and go through magpie?</h3>
+ <p>Yes, by hand. Connecting dsh adds magpie’s routes and leaves dsh’s DeepSeek row (<code>llm-deepseek</code>) to dsh. That row keeps DeepSeek’s cache when dsh’s prompt or tools change mid-session. To send it through magpie, add this to <code>~/.dsh/profiles/&lt;profile&gt;/cordis.patch.yml</code>:</p>
+ <div class="code">
+ <span class="lang">cordis.patch.yml</span>
+ <button class="copy" data-copy="ex-dsh-deepseek">Copy</button>
+ <pre id="ex-dsh-deepseek">- id: llm-deepseek
+ config:
+ baseURL: http://127.0.0.1:3425
+ apiKeyEnv: MAGPIE_DS_KEY
+ maxInlineRequestImageBytes: 67108864
+ models:
+ - id: deepseek/deepseek-flash
+ name: DeepSeek V4.1 Flash (magpie)
+ contextWindow: 1000000
+ inputModalities: [text, image]
+ systemPromptUpdate: in-history
+ toolUpdate: addition-only
+ - id: deepseek/deepseek-v4-pro
+ name: DeepSeek V4 Pro (magpie)
+ contextWindow: 1000000</pre>
+ </div>
+ <p><code>baseURL</code> has no <code>/anthropic</code>. The model ids are magpie’s (<code>magpie models</code>), and a <code>models</code> list replaces dsh’s defaults, so keep the two update lines. <code>MAGPIE_DS_KEY</code> holds the gateway key (<code>magpie</code> on this computer), not your DeepSeek key: export it, put it in <code>~/.dsh/.env</code>, or enter it on the DeepSeek row in dsh’s Models page. Pick the model in dsh; Disconnect leaves the entry alone. magpie has no Files API, so dsh sends images inline as base64 each turn, up to <code>maxInlineRequestImageBytes</code> (20 MiB by default, 64 MiB above). Keep the row on DeepSeek’s own models. <a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#deepseek-harness-the-deepseek-row-by-hand">More in the reference</a>.</p>
<p style="margin-top:48px">Stuck, or have a setup worth sharing? Ask on <a href="https://discord.gg/vGSnD3ZKQF">Discord</a>. Vendors who want to hand their users a ready-made provider: see <a href="/docs/import">Add to magpie</a>.</p>
</article>
</main>
diff --git a/site/public/docs/zh/start.html b/site/public/docs/zh/start.html
index 69e788aef..bb2363fed 100644
--- a/site/public/docs/zh/start.html
+++ b/site/public/docs/zh/start.html
@@ -290,6 +290,28 @@ magpie claude group/opus-anywhere <span class="c"># 使用它</span></pre>
IP-CIDR6,::1/128,DIRECT,no-resolve</pre>
</div>
<p>Clash / mihomo 的配置里把这两行写在 <code>rules:</code> 下,每行前面加 <code>- </code>。改完让 Agent 重新发一次请求即可。</p>
+ <h3 id="dsh-deepseek">DeepSeek Harness 能保留自己的 DeepSeek 行,同时走 magpie 吗?</h3>
+ <p>可以,手动配置。连接 dsh 时 magpie 只加自己的路由,dsh 的 DeepSeek 行(<code>llm-deepseek</code>)留给 dsh。这一行在会话中途改提示词或工具时能保住 DeepSeek 的缓存。要让它经过 magpie,在 <code>~/.dsh/profiles/&lt;profile&gt;/cordis.patch.yml</code> 里加上:</p>
+ <div class="code">
+ <span class="lang">cordis.patch.yml</span>
+ <button class="copy" data-copy="ex-dsh-deepseek">复制</button>
+ <pre id="ex-dsh-deepseek">- id: llm-deepseek
+ config:
+ baseURL: http://127.0.0.1:3425
+ apiKeyEnv: MAGPIE_DS_KEY
+ maxInlineRequestImageBytes: 67108864
+ models:
+ - id: deepseek/deepseek-flash
+ name: DeepSeek V4.1 Flash (magpie)
+ contextWindow: 1000000
+ inputModalities: [text, image]
+ systemPromptUpdate: in-history
+ toolUpdate: addition-only
+ - id: deepseek/deepseek-v4-pro
+ name: DeepSeek V4 Pro (magpie)
+ contextWindow: 1000000</pre>
+ </div>
+ <p><code>baseURL</code> 不带 <code>/anthropic</code>。模型 id 用 magpie 的(<code>magpie models</code>);写了 <code>models</code> 就会替换 dsh 的默认列表,所以两行更新方式要保留。<code>MAGPIE_DS_KEY</code> 里放网关密钥(本机是 <code>magpie</code>),不是你的 DeepSeek 密钥:export、写进 <code>~/.dsh/.env</code>,或在 dsh 模型页的 DeepSeek 行填入都行。模型在 dsh 里选;在 magpie 里断开不会动这一项。magpie 没有 Files API,dsh 会把图片按 base64 每轮内联发送,上限是 <code>maxInlineRequestImageBytes</code>(默认 20 MiB,上面设成 64 MiB)。这一行只用 DeepSeek 自己的模型。<a href="https://github.com/yetone/magpie/blob/main/docs/reference.md#deepseek-harness-the-deepseek-row-by-hand">详见参考文档</a>。</p>
<p style="margin-top:48px">遇到问题,或者有值得分享的配置?来 <a href="https://discord.gg/vGSnD3ZKQF">Discord</a> 聊。想给自己的用户一键添加供应商的厂商,请看 <a href="/docs/zh/import">Add to magpie</a>。</p>
</article>
</main>