From 8a650a62f9b94757bf111d52d0c344da1dcad91c Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 12 Nov 2026 10:56:25 +0800 Subject: [PATCH] site: a Kun docs page in en, zh and ja /docs/kun says how magpie sets up Kun (KunAgent), its desktop app and the kun TUI, both clients of kun serve: the connections in model-connections.v2.json in ~/.kun/data (or $KUN_DATA_DIR) with keys in Kun's protected store, so magpie goes through the runtime's admin API with runtime.json's address and token, as Kun's Settings > Providers and kun provider do; the magpie connection at the gateway's /v1 as chat completions with Kun's own key, its models the ones picked for Kun (at most 500), kept in step by sync; picking a model making it Kun's default with the previous one stashed; Kun having to run; switching back to the stashed default, then removing the connection. Each claim is from internal/agent/kun.go. Linked from each language's OpenHanako page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 115 pass, 0 fail. Not tried: Kun itself with magpie for this page; it names only what magpie's source says. --- site/public/docs/ja/kun.html | 267 ++++++++++++++++++++++++++++ site/public/docs/ja/openhanako.html | 2 +- site/public/docs/kun.html | 267 ++++++++++++++++++++++++++++ site/public/docs/openhanako.html | 2 +- site/public/docs/zh/kun.html | 267 ++++++++++++++++++++++++++++ site/public/docs/zh/openhanako.html | 2 +- site/public/llms-full.txt | 70 +++++++- site/public/llms.txt | 1 + site/public/sitemap.xml | 3 + 9 files changed, 877 insertions(+), 4 deletions(-) create mode 100644 site/public/docs/ja/kun.html create mode 100644 site/public/docs/kun.html create mode 100644 site/public/docs/zh/kun.html diff --git a/site/public/docs/ja/kun.html b/site/public/docs/ja/kun.html new file mode 100644 index 000000000..5fe89a627 --- /dev/null +++ b/site/public/docs/ja/kun.html @@ -0,0 +1,267 @@ + + + + + +Kun(KunAgent)で DeepSeek、GLM、Kimi、Qwen、Claude、ChatGPT サブスクリプションを使う:magpie をモデル接続に · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

ドキュメント · ガイド

+

Kun を任意のモデルで

+

Kun(KunAgent)はローカルファーストの AI ワークベンチです。デスクトップアプリ(Code、Work、チャット、エージェント)と kun TUI は、どちらも一つのランタイム kun serve のクライアントです。モデルはランタイムのモデル接続から来ます。magpie が自分の接続を加えて既定にすると、Kun が DeepSeek、GLM、Kimi、Qwen、Claude、ChatGPT サブスクリプションなど magpie の任意のモデルで動き、デスクトップアプリでも TUI でも同じです。

+

Kun の設定

+
    +
  1. magpie にプロバイダーを追加プロバイダー ページで API キーを追加するか、サブスクリプションにサインインします。
  2. +
  3. Kun を開くmagpie は起動中の Kun を通して接続を加えます。下で説明します。
  4. +
  5. エージェント ページで Kun のモデルを選ぶvia magpie のモデルを選ぶと、Kun の既定モデルになります。
  6. +
+
ターミナル
magpie kun deepseek/deepseek-v4-pro
+

Kun 自身の API で

+

Kun は接続をデータフォルダー($KUN_DATA_DIR、なければ ~/.kun/data)の model-connections.v2.json に、接続のキーを保護された資格情報ストアに置くので、ファイルに手で書くことはできません。magpie は Kun 自身の 設定 › プロバイダー や kun provider コマンドと同じく、ランタイムの管理 API で接続を加え、外します:

+
ターミナル
GET    /v1/model-connections              接続の一覧とリビジョン
+POST   /v1/model-connections/connect      magpie の接続
+PATCH  /v1/model-connections/magpie       モデル一覧
+POST   /v1/model-connections/select       Kun の既定モデル
+DELETE /v1/model-connections/magpie       元に戻す
+

アドレスとトークンはデータフォルダーの runtime.json から取ります。magpie の接続 magpie はゲートウェイの /v1 への HTTP 接続で、Chat Completions で話し、magpie の Kun 専用キーを使います。magpie は接続の id を覚えているので、Kun で magpie-2 に名前を変えても magpie のものと分かります。

+

モデル一覧

+

接続のモデルは、magpie のエージェントページで Kun に選んだモデルで、最大 500 個です。そこでの追加や削除、ゲートウェイのポート変更も接続に反映されます。

+

Kun を起動しておく

+

Kun は起動中にだけモデルプロバイダーを加えたり変えたりできます。起動していないときは、Kun を開いてもう一度試すよう magpie が伝えます。

+

元に戻す

+

magpie は最初に入るとき Kun の元の既定モデルを控えます。元に戻すとその既定を選び直してから、magpie の接続を外します。戻る先になる自分のプロバイダーが Kun にないときは、Kun の 設定 › プロバイダー で追加するよう案内します。

+
ターミナル
magpie kun default
+ +

よくある質問

+

Kun で DeepSeek、GLM、ChatGPT サブスクリプションを使えますか?

+

使えます。Kun を開き、magpie のエージェントページで Kun に via magpie のモデルを選ぶと、magpie のモデル接続が加わり既定になります。

+

「open Kun, then try again」と出ます。

+

Kun は起動中にだけプロバイダーの変更を受け付けます。Kun のデスクトップアプリか kun serve を起動して、もう一度試してください。

+

kun TUI でも使えますか?

+

使えます。デスクトップアプリと kun TUI はどちらも kun serve のクライアントで、同じモデル接続を使います。

+

元に戻すと既定モデルも戻りますか?

+

戻ります。magpie が控えた元の既定を選び直してから、接続を外します。

+ +

同じモデルを他のデスクトップアプリでも:OpenHanako を任意のモデルで、DS Bot を任意のモデルで、Tuanjie Cowork を任意のモデルで。エラーが出るときは よくあるエラーの直し方、または Discord で質問してください。

+
+
+ + + + + + + diff --git a/site/public/docs/ja/openhanako.html b/site/public/docs/ja/openhanako.html index 93d8dbfa5..1be8ef5ae 100644 --- a/site/public/docs/ja/openhanako.html +++ b/site/public/docs/ja/openhanako.html @@ -214,7 +214,7 @@

元に戻すと前のモデルに戻りますか?

戻ります。magpie が控えたモデルを戻します。OpenHanako にもうなければ、OpenHanako 自身の最初のモデルになります。

-

同じモデルを他のデスクトップアプリでも:DS Bot を任意のモデルで、Tuanjie Cowork を任意のモデルで、OpenBot を任意のモデルで。エラーが出るときは よくあるエラーの直し方、または Discord で質問してください。

+

同じモデルを他のデスクトップアプリでも:DS Bot を任意のモデルで、Tuanjie Cowork を任意のモデルで、OpenBot を任意のモデルで、Kun を任意のモデルで。エラーが出るときは よくあるエラーの直し方、または Discord で質問してください。

diff --git a/site/public/docs/kun.html b/site/public/docs/kun.html new file mode 100644 index 000000000..17b117533 --- /dev/null +++ b/site/public/docs/kun.html @@ -0,0 +1,267 @@ + + + + + +Kun (KunAgent) with DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription: magpie as a model connection · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

Docs · Guide

+

Kun on any model

+

Kun (KunAgent) is a local-first AI workbench: a desktop app (Code, Work, chats, agents) and a kun TUI, both clients of one runtime, kun serve. Its models come from the runtime's model connections. magpie adds a connection of its own and makes it the default, so Kun runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription, in the desktop app and the TUI alike.

+

Set up Kun

+
    +
  1. Add a provider in magpieAdd an API key on the Providers page, or sign in to a subscription.
  2. +
  3. Open Kunmagpie adds its connection through the running Kun, as below.
  4. +
  5. Pick a model for Kun on the Agents pagePick a model via magpie; it becomes Kun's default.
  6. +
+
Terminal
magpie kun deepseek/deepseek-v4-pro
+

Through Kun's own API

+

Kun keeps its connections in model-connections.v2.json in its data folder ($KUN_DATA_DIR, else ~/.kun/data), and a connection's key in its protected credential store, so a connection can't be written into a file by hand. magpie adds and removes its connection as Kun's own Settings › Providers and its kun provider command do, through the runtime's admin API:

+
Terminal
GET    /v1/model-connections              the connections, with a revision
+POST   /v1/model-connections/connect      magpie's connection
+PATCH  /v1/model-connections/magpie       its model list
+POST   /v1/model-connections/select       Kun's default model
+DELETE /v1/model-connections/magpie       switching back
+

The address and token come from runtime.json in the data folder. magpie's connection, magpie, is an HTTP one at the gateway's /v1, spoken to as Chat Completions with magpie's own key for Kun. magpie remembers its id, so one you renamed to magpie-2 in Kun is still magpie's.

+

The model list

+

The connection's models are the ones you tick for Kun on magpie's Agents page, at most 500. A model picked or dropped there reaches the connection, and so does a gateway on a new port.

+

Kun has to be running

+

Kun adds and changes model providers only while it runs. When it isn't running, magpie says to open Kun, then try again.

+

Switching back

+

magpie stashes the default Kun had when it first steps in. Switching back picks that default again, then removes magpie's connection. With no provider of your own in Kun to go back to, magpie asks you to add one in Kun's Settings › Providers.

+
Terminal
magpie kun default
+ +

FAQ

+

Can Kun run on DeepSeek, GLM or a ChatGPT subscription?

+

Yes. Open Kun and pick a via-magpie model for Kun on magpie's Agents page. magpie adds a magpie model connection and makes it the default.

+

magpie says open Kun, then try again. Why?

+

Kun takes provider changes only while it runs. Open the Kun desktop app or kun serve, and try again.

+

Does the kun TUI get the models too?

+

Yes. The desktop app and the kun TUI are both clients of kun serve and share its model connections.

+

Does switching back restore my default model?

+

Yes. magpie stashed the default Kun had, picks it again, then removes its connection.

+ +

More desktop apps on the same models: OpenHanako on any model, DS Bot on any model and Tuanjie Cowork on any model. Something fails? See Fixing common errors, or ask on Discord.

+
+
+ + + + + + + diff --git a/site/public/docs/openhanako.html b/site/public/docs/openhanako.html index b6e036dcd..bbf02d07d 100644 --- a/site/public/docs/openhanako.html +++ b/site/public/docs/openhanako.html @@ -214,7 +214,7 @@

Does switching back give me my old model?

Yes. magpie stashed it and puts it back; if OpenHanako no longer has it, the agent goes to OpenHanako's first model of its own.

-

More desktop apps on the same models: DS Bot on any model, Tuanjie Cowork on any model and OpenBot on any model. Something fails? See Fixing common errors, or ask on Discord.

+

More desktop apps on the same models: DS Bot on any model, Tuanjie Cowork on any model, OpenBot on any model and Kun on any model. Something fails? See Fixing common errors, or ask on Discord.

diff --git a/site/public/docs/zh/kun.html b/site/public/docs/zh/kun.html new file mode 100644 index 000000000..29ced8920 --- /dev/null +++ b/site/public/docs/zh/kun.html @@ -0,0 +1,267 @@ + + + + + +Kun(KunAgent)接入 DeepSeek、GLM、Kimi、Qwen、Claude 或 ChatGPT 订阅:通过 magpie 添加模型连接 · magpie + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

文档 · 指南

+

让 Kun 用任意模型

+

Kun(KunAgent)是本地优先的 AI 工作台:桌面应用(Code、Work、对话和 Agent)和 kun TUI 都是同一个运行时 kun serve 的客户端。它的模型来自运行时里的模型连接。magpie 加一个自己的连接并设成默认,Kun 就能用 DeepSeek、GLM、Kimi、Qwen、Claude 或 ChatGPT 订阅等 magpie 里的任意模型,桌面应用和 TUI 都一样。

+

接入 Kun

+
    +
  1. 在 magpie 里添加供应商在 供应商 页添加 API Key,或登录一个订阅。
  2. +
  3. 打开 Kunmagpie 通过运行中的 Kun 添加连接,见下文。
  4. +
  5. 在 Agent 页给 Kun 选模型选一个 via magpie 的模型,它就成为 Kun 的默认模型。
  6. +
+
终端
magpie kun deepseek/deepseek-v4-pro
+

通过 Kun 自己的 API

+

Kun 的模型连接登记在数据目录($KUN_DATA_DIR,默认 ~/.kun/data)的 model-connections.v2.json,连接的 Key 存在 Kun 受保护的凭据库里,所以不能手动写进文件。magpie 和 Kun 自己的 设置 › 供应商 以及 kun provider 命令一样,通过运行时的管理 API 操作:

+
终端
GET    /v1/model-connections              连接列表和版本号
+POST   /v1/model-connections/connect      magpie 的连接
+PATCH  /v1/model-connections/magpie       它的模型列表
+POST   /v1/model-connections/select       Kun 的默认模型
+DELETE /v1/model-connections/magpie       切回
+

API 地址和令牌取自数据目录里的 runtime.json。magpie 的连接名为 magpie,是指向网关 /v1 的 HTTP 连接,走 Chat Completions,用 magpie 给 Kun 的专用 Key。如果你在 Kun 里把它改名成 magpie-2,magpie 记着它的 id,仍认得出来。

+

模型列表

+

连接里的模型,就是你在 magpie 的 Agent 页为 Kun 勾选的模型,最多 500 个。在 magpie 里增删模型,或者网关换了端口,都会同步到这个连接。

+

Kun 要在运行

+

Kun 只在运行时才能添加或修改模型供应商。Kun 没运行时,magpie 会提示:打开 Kun,再试一次。

+

切回

+

magpie 第一次接入时记下 Kun 原来的默认模型。切回时先把默认改回去,再删掉 magpie 的连接。如果 Kun 没有你自己的供应商可用,magpie 会提示先在 Kun 的 设置 › 供应商 里添加一个。

+
终端
magpie kun default
+ +

常见问题

+

Kun 能用 DeepSeek、GLM 或 ChatGPT 订阅吗?

+

能。打开 Kun,在 magpie 的 Agent 页给 Kun 选一个 via magpie 的模型,magpie 会加一个 magpie 模型连接并设成默认。

+

提示“open Kun, then try again”怎么办?

+

Kun 只在运行时才接受模型供应商的改动。打开 Kun 桌面应用或 kun serve,再试一次。

+

kun TUI 也能用吗?

+

能。桌面应用和 kun TUI 都是 kun serve 的客户端,用的是同一组模型连接。

+

切回后默认模型会变回原来的吗?

+

会。magpie 记下了原来的默认模型,切回时先改回去,再删除 magpie 的连接。

+ +

更多桌面应用用同样的模型:让 OpenHanako 用任意模型、让 DS Bot 用任意模型、让团结 Cowork 用任意模型。遇到报错?见 常见错误排查,或到 Discord 提问。

+
+
+ + + + + + + diff --git a/site/public/docs/zh/openhanako.html b/site/public/docs/zh/openhanako.html index f9a5bc0f1..aa3e62fc0 100644 --- a/site/public/docs/zh/openhanako.html +++ b/site/public/docs/zh/openhanako.html @@ -214,7 +214,7 @@

切回后会回到我原来的模型吗?

会。magpie 记下了原来的模型并放回去;如果那个模型已经没了,就用 OpenHanako 自己的第一个模型。

-

更多桌面应用用同样的模型:让 DS Bot 用任意模型、让团结 Cowork 用任意模型、让 OpenBot 用任意模型。遇到报错?见 常见错误排查,或到 Discord 提问。

+

更多桌面应用用同样的模型:让 DS Bot 用任意模型、让团结 Cowork 用任意模型、让 OpenBot 用任意模型、让 Kun 用任意模型。遇到报错?见 常见错误排查,或到 Discord 提问。

diff --git a/site/public/llms-full.txt b/site/public/llms-full.txt index bfd4581e4..4febdf776 100644 --- a/site/public/llms-full.txt +++ b/site/public/llms-full.txt @@ -6680,7 +6680,75 @@ Not while it runs: magpie goes through its local API and the models reload at on Yes. magpie stashed it and puts it back; if OpenHanako no longer has it, the agent goes to OpenHanako's first model of its own. -More desktop apps on the same models: [DS Bot on any model](https://usemagpie.ai/docs/ds-bot), [Tuanjie Cowork on any model](https://usemagpie.ai/docs/tuanjie-cowork) and [OpenBot on any model](https://usemagpie.ai/docs/openbot). Something fails? See [Fixing common errors](https://usemagpie.ai/docs/troubleshooting), or ask on [Discord](https://discord.gg/vGSnD3ZKQF). +More desktop apps on the same models: [DS Bot on any model](https://usemagpie.ai/docs/ds-bot), [Tuanjie Cowork on any model](https://usemagpie.ai/docs/tuanjie-cowork), [OpenBot on any model](https://usemagpie.ai/docs/openbot) and [Kun on any model](https://usemagpie.ai/docs/kun). Something fails? See [Fixing common errors](https://usemagpie.ai/docs/troubleshooting), or ask on [Discord](https://discord.gg/vGSnD3ZKQF). + +--- + +Source: https://usemagpie.ai/docs/kun + +# Kun on any model + +Kun (KunAgent) is a local-first AI workbench: a desktop app (Code, Work, chats, agents) and a `kun` TUI, both clients of one runtime, `kun serve`. Its models come from the runtime's model connections. magpie adds a connection of its own and makes it the default, so Kun runs on any model in magpie: DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription, in the desktop app and the TUI alike. + +## Set up Kun + +1. **Add a provider in magpie.** Add an API key on the Providers page, or sign in to a subscription. +2. **Open Kun.** magpie adds its connection through the running Kun, as below. +3. **Pick a model for Kun on the Agents page.** Pick a model via magpie; it becomes Kun's default. + +``` +magpie kun deepseek/deepseek-v4-pro +``` + +## Through Kun's own API + +Kun keeps its connections in `model-connections.v2.json` in its data folder (`$KUN_DATA_DIR`, else `~/.kun/data`), and a connection's key in its protected credential store, so a connection can't be written into a file by hand. magpie adds and removes its connection as Kun's own Settings › Providers and its `kun provider` command do, through the runtime's admin API: + +``` +GET /v1/model-connections the connections, with a revision +POST /v1/model-connections/connect magpie's connection +PATCH /v1/model-connections/magpie its model list +POST /v1/model-connections/select Kun's default model +DELETE /v1/model-connections/magpie switching back +``` + +The address and token come from `runtime.json` in the data folder. magpie's connection, `magpie`, is an HTTP one at the gateway's `/v1`, spoken to as Chat Completions with magpie's own key for Kun. magpie remembers its id, so one you renamed to magpie-2 in Kun is still magpie's. + +## The model list + +The connection's models are the ones you tick for Kun on magpie's Agents page, at most 500. A model picked or dropped there reaches the connection, and so does a gateway on a new port. + +## Kun has to be running + +Kun adds and changes model providers only while it runs. When it isn't running, magpie says to open Kun, then try again. + +## Switching back + +magpie stashes the default Kun had when it first steps in. Switching back picks that default again, then removes magpie's connection. With no provider of your own in Kun to go back to, magpie asks you to add one in Kun's Settings › Providers. + +``` +magpie kun default +``` + +## FAQ + +### Can Kun run on DeepSeek, GLM or a ChatGPT subscription? + +Yes. Open Kun and pick a via-magpie model for Kun on magpie's Agents page. magpie adds a magpie model connection and makes it the default. + +### magpie says open Kun, then try again. Why? + +Kun takes provider changes only while it runs. Open the Kun desktop app or kun serve, and try again. + +### Does the kun TUI get the models too? + +Yes. The desktop app and the kun TUI are both clients of kun serve and share its model connections. + +### Does switching back restore my default model? + +Yes. magpie stashed the default Kun had, picks it again, then removes its connection. + +More desktop apps on the same models: [OpenHanako on any model](https://usemagpie.ai/docs/openhanako), [DS Bot on any model](https://usemagpie.ai/docs/ds-bot) and [Tuanjie Cowork on any model](https://usemagpie.ai/docs/tuanjie-cowork). Something fails? See [Fixing common errors](https://usemagpie.ai/docs/troubleshooting), or ask on [Discord](https://discord.gg/vGSnD3ZKQF). --- diff --git a/site/public/llms.txt b/site/public/llms.txt index 2117fec1d..ea789668c 100644 --- a/site/public/llms.txt +++ b/site/public/llms.txt @@ -110,6 +110,7 @@ DeepSeek, Kimi (Moonshot), GLM (Zhipu), Qwen, MiniMax, Anthropic (Claude), OpenA - [DS Bot on any model](https://usemagpie.ai/docs/ds-bot): DS Bot (DeepSeek Bot) on GLM, Kimi, Qwen, Claude, GPT or a ChatGPT subscription through magpie: its data folder, the route in profiles/ds-bot/cordis.patch.yml, new and older Bots, web search, switching back. - [Prime Agent on any model](https://usemagpie.ai/docs/prime-agent): Prime Intellect's Prime Agent (prime-agent) on DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription through magpie: settings.json and models.json in ~/.prime/agent, PRIME_AGENT_CODING_AGENT_DIR, allowedModels, switching back. - [OpenHanako on any model](https://usemagpie.ai/docs/openhanako): OpenHanako (HanaAgent) on DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription through magpie: the magpie provider in ~/.hanako, the primary agent's chat model, its local API, the catalog sealed since 1.0, switching back. +- [Kun on any model](https://usemagpie.ai/docs/kun): Kun (KunAgent), its desktop app and the kun TUI, on DeepSeek, GLM, Kimi, Qwen, Claude or a ChatGPT subscription through magpie: the magpie model connection through kun serve's admin API, the default model, switching back. - [Cherry Studio](https://usemagpie.ai/docs/cherry-studio): add magpie to Cherry Studio as one OpenAI-compatible provider in one click, confirmed in Cherry Studio, and use every magpie model there, Claude, ChatGPT and Copilot subscriptions included; model list, status and usage. - [Fixing common errors](https://usemagpie.ai/docs/troubleshooting): what the gateway's errors mean and the fix: 401 and 403, 429 and rest periods, 502 and 504, model not found, an agent that doesn't show a model, port 3425 in use, agents in WSL, use from another computer and subscriptions moved to plugins. - [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 21250d55a..e22afb536 100644 --- a/site/public/sitemap.xml +++ b/site/public/sitemap.xml @@ -64,6 +64,7 @@ https://usemagpie.ai/docs/ds-bot https://usemagpie.ai/docs/prime-agent https://usemagpie.ai/docs/openhanako +https://usemagpie.ai/docs/kun https://usemagpie.ai/docs/local-models https://usemagpie.ai/docs/opencode-models https://usemagpie.ai/docs/alternatives @@ -149,6 +150,7 @@ https://usemagpie.ai/docs/zh/ds-bot https://usemagpie.ai/docs/zh/prime-agent https://usemagpie.ai/docs/zh/openhanako +https://usemagpie.ai/docs/zh/kun https://usemagpie.ai/docs/zh/local-models https://usemagpie.ai/docs/zh/opencode-models https://usemagpie.ai/docs/zh/alternatives @@ -233,6 +235,7 @@ https://usemagpie.ai/docs/ja/ds-bot https://usemagpie.ai/docs/ja/prime-agent https://usemagpie.ai/docs/ja/openhanako +https://usemagpie.ai/docs/ja/kun https://usemagpie.ai/docs/ja/local-models https://usemagpie.ai/docs/ja/opencode-models https://usemagpie.ai/docs/ja/alternatives