Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ A **routing group** is several models that an agent picks as one: `group/daily-c
| `order` | Use the first model until it can't answer, then the next |
| `rotate` | Move to the next member on each turn |
| `usage` | Use the least-used member first |
| `pace` | Use the account with the most of its week left per hour until its reset |
| `pace` | Use each account's week up evenly until its reset |

Conversations **stay with the account that answered them** while the vendor's prompt cache is still worth keeping. **Intent routing** goes further: a small model you choose reads each new turn, so tests can go to the strong model and quick questions to the fast, cheap one. Groups can contain other groups. The Routing tab shows each decision live.

Expand Down
3 changes: 1 addition & 2 deletions groups_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ const groupUsage = `usage:
order the first model until it can't answer, then the next
rotate each conversation's next turn goes to the next member's account or key
usage the account or key with the most of its allowance left first
pace the account with the most of its week left per hour until it renews first, so less
of a week is lost at its reset
pace each week used evenly up to its reset, so later five hours still have several accounts

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就是在说每周均衡而非账号的均衡,后者是最少使用

manual only the model you pick (pick=, or click it on the group's card): the others and
the rules wait until you pick another or route it otherwise; no failover to them
stays auto (default) with the account or key that answered, while its cache is worth keeping
Expand Down
2 changes: 1 addition & 1 deletion internal/gui/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9024,7 +9024,7 @@ const ROUTINGS = [
["order", "In order", "Requests go to the first; the next takes over when the one before runs out of quota, hits a rate limit or fails."],
["rotate", "In turn", "Each turn of a conversation goes to the next one, spreading the load evenly; the requests within a turn stay where it began, so the prompt cache holds, and one that fails is passed over while it rests."],
["usage", "Least used first", "Each request goes to the one used least: a subscription by the share of its allowance used, a key by the tokens it served in the last hours."],
["pace", "Weekly pace", "Each request goes to the subscription with the most of its week left per hour until it renews — the one with the most to lose at its reset — so less of each week is lost at its reset; one at 90% or more waits until the others can't answer. A key goes by the tokens it served in the last hours."],
["pace", "Weekly pace", "Uses each subscription's week up evenly until it renews — the most of its week left per hour first — so later five-hour windows still have several to draw on. One at 90% or more waits until the others can't answer. A key goes by the tokens it served in the last hours."],
["weight", "By weight", "Requests spread over the keys by the weight set beside each: a key weighing 3 takes three requests for every one a key weighing 1 takes, evenly over a few requests. One that fails is passed over while it rests, and the others share its requests; a conversation stays with its key as Stays says."],
];
// weight is a key's share: offered for a provider with keys only
Expand Down
30 changes: 15 additions & 15 deletions internal/gui/assets/i18n.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions internal/gui/assets/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
order: ["In order", "In order: the first answers everything until it can't; then the next."],
rotate: ["In turn", "In turn: each conversation's next turn goes to the account after the one that answered its last, and a new conversation starts one further along; the requests within a turn stay put, keeping the prompt cache."],
usage: ["Least used", "Least used first: the account with the most of its allowance left goes first; a key by the tokens magpie sent it lately."],
pace: ["Weekly pace", "Weekly pace: the account with the most of its week left per hour until it renews goes first — the one with the most to lose at its reset; an account with five hours and no week by what its five hours have left per hour. One at 90% or more waits until the others can't answer; a key by the tokens magpie sent it lately."],
pace: ["Weekly pace", "Weekly pace: uses each account's week up evenly until it renews — the most of its week left per hour first — so later five-hour windows still have several accounts; one with five hours and no week goes by its five hours. One at 90% or more waits until the others can't answer; a key by the tokens magpie sent it lately."],

@pc418 pc418 Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原意更清楚,相信opus 5.5,copilot是gpt不会写文。前文短句更多好阅读,后文要到per hour再想想才知道意思

manual: ["Manual", "Manual: every request goes to the model picked on the group's card, over its own accounts or keys."],
};
const GROUP_ORDER = "In order: member by member, the first model the group names until it can't answer, each over its own accounts or keys as its provider routes them.";
Expand Down Expand Up @@ -2470,7 +2470,7 @@
order: "In order: the first model until it can't answer, then the next — each over its own accounts or keys as its provider routes them.",
rotate: "In turn: each conversation's next turn goes to the next member's account or key, spreading the load.",
usage: "Least used first: the account or key with the most of its allowance left goes first.",
pace: "Weekly pace: the account with the most of its week left per hour until it renews goes first, so less of each member's week is lost at its reset — an account with five hours and no week (Claude Enterprise) by what its five hours have left per hour until they renew, so almost always first; a key by the tokens magpie sent it lately.",
pace: "Weekly pace: uses each member's week up evenly until it renews — the most of its week left per hour first — so later five-hour windows still have several accounts. One with five hours and no week (Claude Enterprise) goes by its five hours, so almost always first; a key by the tokens magpie sent it lately.",
manual: "Manual: every request goes to the model you pick on the group's card, over its own accounts or keys; the others, and the rules, wait until you pick another — none takes over when it fails.",
};
// a group in the group is routed by its own routing, whatever this one's
Expand Down
2 changes: 1 addition & 1 deletion internal/gui/tests/routing-save.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function serve(lang, posts) {

const ROUTINGS = [
["", "Smart", "智能"], ["order", "In order", "按顺序"], ["rotate", "In turn", "轮流"],
["usage", "Least used first", "用量少的优先"], ["pace", "Weekly pace", "重置前用完"],
["usage", "Least used first", "用量少的优先"], ["pace", "Weekly pace", "额度均衡"],
];
const STAYS = [["", "Auto", "自动"], ["session", "Session", "整个会话"], ["turn", "Within a turn", "一轮之内"], ["off", "Off", "关闭"]];

Expand Down
2 changes: 1 addition & 1 deletion site/public/docs/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ <h3>One model over several providers</h3>
<tr><td>In order <code>order</code></td><td>The first model until it can’t answer, then the next.</td></tr>
<tr><td>In turn <code>rotate</code></td><td>Each conversation’s next turn goes to the next member’s account or key, spreading the load.</td></tr>
<tr><td>Least used <code>usage</code></td><td>The account or key with the most of its allowance left.</td></tr>
<tr><td>Weekly pace <code>pace</code></td><td>The account with the most of its week left per hour until it renews — the one with the most to lose at its reset — so less of each member’s week is lost at its reset; an account with five hours and no week (Claude Enterprise) by what its five hours have left per hour until they renew, so almost always first. One at 90% or more waits until the others can’t answer. A key by the tokens sent it lately.</td></tr>
<tr><td>Weekly pace <code>pace</code></td><td>Uses each member’s week up evenly until it renews — the most of its week left per hour first — so later five-hour windows still have several accounts. One with five hours and no week (Claude Enterprise) goes by its five hours, so almost always first. One at 90% or more waits until the others can’t answer. A key by the tokens sent it lately.</td></tr>
</table></div>
<div class="table-wrap"><table>
<tr><th>Stays</th><th>How long a conversation stays with the account or key that answered it</th></tr>
Expand Down
6 changes: 3 additions & 3 deletions site/public/docs/zh/start.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h2 id="routing"><a class="anchor" href="#routing">3 · 可选:路由组</a></
</figure>

<h3>一个供应商里的多个账号或密钥</h3>
<p>展开供应商那一行,勾选要用的每个账号或密钥。<span class="ui">路由</span> 决定请求怎么分给它们:<span class="ui">智能</span>(默认)、<span class="ui">按顺序</span>、<span class="ui">轮流</span>、<span class="ui">用量少的优先</span> 或 <span class="ui">重置前用完</span>。<span class="ui">备用</span> 里列出这个供应商额度用完、被限流或不可用时改用的模型。</p>
<p>展开供应商那一行,勾选要用的每个账号或密钥。<span class="ui">路由</span> 决定请求怎么分给它们:<span class="ui">智能</span>(默认)、<span class="ui">按顺序</span>、<span class="ui">轮流</span>、<span class="ui">用量少的优先</span> 或 <span class="ui">额度均衡</span>。<span class="ui">备用</span> 里列出这个供应商额度用完、被限流或不可用时改用的模型。</p>

<h3>跨供应商的同一个模型</h3>
<p>路由组是几个模型(来自一个或多个供应商),Agent 把它当作一个来选:<code>group/&lt;id&gt;</code>,在选择列表的 <em>路由组</em> 下面。两个供应商用同一个名字提供的模型会自动成组;在 <span class="ui">路由</span> 标签页点 <span class="ui">新建组</span> 可以把任意模型组到一起。排第一的模型决定这个组对外的能力。</p>
Expand All @@ -171,7 +171,7 @@ <h3>跨供应商的同一个模型</h3>
<tr><td>按顺序 <code>order</code></td><td>先用第一个模型,它答不了再换下一个。</td></tr>
<tr><td>轮流 <code>rotate</code></td><td>会话的每一轮交给下一个成员的账号或 Key,均摊负载。</td></tr>
<tr><td>最少使用 <code>usage</code></td><td>剩余额度最多的账号或 Key 排第一。</td></tr>
<tr><td>重置前用完 <code>pace</code></td><td>每周剩余额度除以距重置的小时数,最高的账号排第一——重置时损失最多的那个——少让成员的周额度到重置时作废;只有 5 小时额度、没有周额度的账号(如 Claude Enterprise)按 5 小时窗口的剩余额度除以距它重置的小时数算,所以几乎总排第一。用到 90% 以上的等其他账号都答不了时才用。Key 按最近发给它的 token 数排。</td></tr>
<tr><td>额度均衡 <code>pace</code></td><td>根据剩余周额度和重置时间分配使用,避免过早耗尽某个账号的周额度,让后续更多个 5 小时窗口仍有多个账号可用。只有 5 小时额度、没有周额度的账号(如 Claude Enterprise)按 5 小时窗口同样计算,所以几乎总排第一。用到 90% 以上的等其他账号都答不了时才用。Key 按最近发给它的 token 数排。</td></tr>
</table></div>
<div class="table-wrap"><table>
<tr><th>会话保持</th><th>会话在回答过它的账号或 Key 上留多久</th></tr>
Expand All @@ -194,7 +194,7 @@ <h3 id="nested">路由组里放路由组</h3>
<p>路由组的成员也可以是另一个路由组:在 <span class="ui">添加模型</span> 的 <em>路由组</em> 分类里选它,或者在终端里用 <code>models+=group/&lt;id&gt;</code>。子组占据它在顺序里的位置,在自己的模型之间按自己的路由方式和规则分配。比如 Coder 可以是 <code>deepseek-v4-pro</code>,然后是 <em>Fast</em>,而 Fast 是几个便宜模型的顺序。Coder 的规则可以把一轮对话交给 <code>group/fast</code>,再由 Fast 自己的规则决定它里面哪个模型排第一。</p>
<ul>
<li><b>不会无限递归。</b>一个组不能包含它自己,无论是直接包含,还是经由它里面的组间接包含。Coder 已经包含 Fast 时,再把 Coder 放进 Fast 会被拒绝,选择器里也不会列出这样的组。最多嵌套 8 层。一个组被别的组包含时不能删除,要先从那个组里移除它。</li>
<li><b>每一层按自己的路由。</b>外层组不管用什么路由,都不会伸进它里面的组:智能、轮流、最少使用、重置前用完都把子组当作一个成员,拿子组自己会先用的那个账号或 Key 来比;排到它时,子组按自己的顺序整体尝试。Coder 设为智能、里面放 Claude(按顺序)和 GPT(按顺序)两个组时,比较的是 Claude 组的第一个和 GPT 组的第一个,不会把两组的账号混在一起排。</li>
<li><b>每一层按自己的路由。</b>外层组不管用什么路由,都不会伸进它里面的组:智能、轮流、最少使用、额度均衡都把子组当作一个成员,拿子组自己会先用的那个账号或 Key 来比;排到它时,子组按自己的顺序整体尝试。Coder 设为智能、里面放 Claude(按顺序)和 GPT(按顺序)两个组时,比较的是 Claude 组的第一个和 GPT 组的第一个,不会把两组的账号混在一起排。</li>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最少使用是特定选项

<li><b>故障转移照常。</b>子组里的模型全部失败时,由外层组的下一个成员接手,和其他成员一样。</li>
<li>同一个模型出现两次(单独一次,子组里一次)时只问一次,按它第一次出现的位置。</li>
</ul>
Expand Down
Loading