@ljwei-stak/dsh-model-router 0.22.1 → 0.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dsh-plugin/client.js +1 -1
- package/CHANGELOG.md +6 -0
- package/README.i18n.yaml +2 -2
- package/README.md +16 -16
- package/README.zh.md +16 -16
- package/docs/INSTALLATION_GUIDE.zh.md +12 -12
- package/docs/WORKBENCH_USER_GUIDE.zh.md +1 -1
- package/package.json +1 -1
package/.dsh-plugin/client.js
CHANGED
|
@@ -13589,7 +13589,7 @@ var xterm_default = `/**
|
|
|
13589
13589
|
`;
|
|
13590
13590
|
|
|
13591
13591
|
// .dsh-plugin/client/host-version.mjs
|
|
13592
|
-
var ROUTER_CLIENT_VERSION = true ? "0.22.
|
|
13592
|
+
var ROUTER_CLIENT_VERSION = true ? "0.22.2" : "";
|
|
13593
13593
|
var STALE_HOST_MESSAGE = "\u63D2\u4EF6\u540E\u53F0\u7248\u672C\u8F83\u65E7\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u542F Harness\uFF08\u5305\u62EC\u6258\u76D8\u56FE\u6807\uFF09\u540E\u518D\u4F7F\u7528\u3002";
|
|
13594
13594
|
function isMissingRemoteMethod(message) {
|
|
13595
13595
|
const value = String(message ?? "");
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.22.2 — 2026-10-19
|
|
4
|
+
|
|
5
|
+
- Render the README's mathematical symbols and expressions in running prose as inline math in both languages, while retaining code formatting for actual API fields. Keep ordinary display equations on one line.
|
|
6
|
+
- Write the routing weights, quality floors and other decimal values with a leading zero throughout both READMEs, without changing their values.
|
|
7
|
+
- Extend the README checks to inline formula pairing, mathematical symbols accidentally formatted as code, and omitted decimal zeros. Actual-page acceptance covers complete explanatory paragraphs and the weight table in addition to display formulas.
|
|
8
|
+
|
|
3
9
|
## 0.22.1 — 2026-10-19
|
|
4
10
|
|
|
5
11
|
- Render the English and Chinese README accounting, planning, latency and assignment formulas with GitHub math fences instead of plain text code blocks. Keep ordinary equations on one line using short symbols explained in prose; reserve line breaks for the latency function's conditions. Escape currency dollar signs and document the historical P90 latency branch already used by the router.
|
package/README.i18n.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# README translation pairing for this repository.
|
|
2
2
|
# Reviewed together; Git blob hashes identify the exact synchronized texts.
|
|
3
|
-
README.md:
|
|
4
|
-
README.zh.md:
|
|
3
|
+
README.md: e73aada4df85277816f1d06c66d76c4e2c8a45b7
|
|
4
|
+
README.zh.md: ff34db2cb3b95a5472d8e165c447ab36e844cd66
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A cost-aware model-routing workbench for **DeepSeek Harness Desktop**. Plan locally, compare configured routes, inspect execution permissions, and run dependent work packages through model APIs or supported official vendor CLIs.
|
|
6
6
|
|
|
7
|
-
Current version: **0.22.
|
|
7
|
+
Current version: **0.22.2** (`@ljwei-stak/dsh-model-router`). Choose algorithm recommendations or manually assign each decomposed package to an exact model API or official tool, preserving dependencies, refreshed cost previews and retry targets. Routing now supports task-specific quality evidence, joint model/effort selection, historical P90 resource estimates and dependency-aware search. Manual mixed execution is read-only; tools use their configured default model, while the existing editable official-team workflow remains available. Compatibility remains **DeepSeek Harness Desktop 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2**, including Hermes/Pi installation and terminal support; neither has a verified managed runner yet. Real vendor execution evidence remains tied to **0.20.0**, with no new model experiments in this release. The router and [GAL](https://github.com/Alice-Marx/deepseek-harness-galgame) have been independent plugins since 0.12.0.
|
|
8
8
|
|
|
9
9
|
Official CLI teamwork runs packages sequentially with dependency context and no automatic model-directory API fallback. Editable teams explicitly choose the Harness sandbox or the vendor CLI's normal environment. In the latter, Git worktrees collect edits but do not restrict OS access. CLIs retain their configured model unless explicitly mapped. See [real Windows validation and its limits](docs/releases/0.20.0-validation.md).
|
|
10
10
|
|
|
@@ -40,16 +40,16 @@ Generating a route recommendation is local: it does not start a vendor CLI or ma
|
|
|
40
40
|
Open **Plugins → Add plugin** and enter:
|
|
41
41
|
|
|
42
42
|
```text
|
|
43
|
-
@ljwei-stak/dsh-model-router@0.22.
|
|
43
|
+
@ljwei-stak/dsh-model-router@0.22.2
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Use the official HTTPS npm source `https://registry.npmjs.org/` when a mirror lacks that exact version. Enable the plugin, then fully quit Harness (including its tray process) and restart it. Plugin details should show **0.22.
|
|
46
|
+
Use the official HTTPS npm source `https://registry.npmjs.org/` when a mirror lacks that exact version. Enable the plugin, then fully quit Harness (including its tray process) and restart it. Plugin details should show **0.22.2** and the sidebar should contain **模型路由** (Model Router). A global `npm install -g` alone does not register a Desktop plugin.
|
|
47
47
|
|
|
48
48
|
You can instead install a local `.tgz` archive or its extracted inner `package` directory through the plugin manager. Both must contain `package.json` and `.dsh-plugin`. See [releases](https://github.com/Alice-Marx/dsh-model-router/releases) for archived builds, or build your own checkout below.
|
|
49
49
|
|
|
50
50
|
### Upgrade from the old package name
|
|
51
51
|
|
|
52
|
-
The old name `@ljwei-stak/model-router-galgame` ended at 0.13.0. Remove that plugin entry while retaining your profile/application data, then add `@ljwei-stak/dsh-model-router@0.22.
|
|
52
|
+
The old name `@ljwei-stak/model-router-galgame` ended at 0.13.0. Remove that plugin entry while retaining your profile/application data, then add `@ljwei-stak/dsh-model-router@0.22.2`. Do not keep both entries installed: they share the internal plugin id `model-router-galgame` and tool names. The retained id lets existing router settings and history carry over.
|
|
53
53
|
|
|
54
54
|
For the combined 0.11.x package, back up the profile and export the GAL saves you want to preserve before upgrading. Story playback, artwork, music and saves now belong to the independent `@ljwei-stak/dsh-galgame` package. The detailed save limitations are in [MIGRATION.md](docs/archive/MIGRATION.md).
|
|
55
55
|
|
|
@@ -322,7 +322,7 @@ A valid CLI-reported USD amount, including explicit zero, wins over token-price
|
|
|
322
322
|
C_a = \frac{I_u p_i+O p_o+R p_r+W p_w}{10^6}
|
|
323
323
|
```
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
$`C_a`$ is `actualUsd`; $`I_u`$, $`O`$, $`R`$, and $`W`$ correspond to `inputTokens`, `outputTokens`, `cacheReadTokens`, and `cacheWriteTokens`. $`p_i`$, $`p_o`$, $`p_r`$, and $`p_w`$ are the matching input, output, cache-read and cache-write prices in USD per million tokens.
|
|
326
326
|
|
|
327
327
|
These ledger counters are disjoint after adapter normalization; do not add cached tokens to an inclusive input count. Missing optional cache prices use the input price. Incomplete usage, absent prices or unknown/unmatched identity keep the amount `null`, not zero. Complete terminal evidence can survive a failed/cancelled/timed-out run; partial events are marked `usageIncomplete`.
|
|
328
328
|
|
|
@@ -338,7 +338,7 @@ The planner is a deterministic local heuristic, not a trained success predictor.
|
|
|
338
338
|
|
|
339
339
|
### Token and price estimate
|
|
340
340
|
|
|
341
|
-
Without matching resource evidence, base input tokens are
|
|
341
|
+
Without matching resource evidence, base input tokens are $`\max(80,\lceil n/3.7\rceil)`$, then adjusted by package-stage multipliers. Base output is 900, adjusted by stage/reasoning effort, with minimum 220. Here $`n`$ is the JavaScript `text.length` value. This is a text-length heuristic, not a vendor tokenizer. Sufficient matching, complete history replaces these heuristics with empirical P90 resource estimates, without applying effort or stage multipliers again. Let $`I`$ be total estimated input, $`R`$/$`W`$ the cached-read/write portions, $`O`$ output, and prices USD per million tokens:
|
|
342
342
|
|
|
343
343
|
<!-- formula:planning-cost -->
|
|
344
344
|
```math
|
|
@@ -350,11 +350,11 @@ C = \frac{(I-R-W)p_i+O p_o+R p_r+W p_w}{10^6}
|
|
|
350
350
|
U_c = \frac{1}{1+C/\max(C_{\mathrm{ref}},10^{-12})}
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
|
|
353
|
+
$`U_c`$ is `costUtility`. The price symbols are the same as above. $`C_{\mathrm{ref}}`$ uses fixed reference prices (input 1, output 5, cache read/write 1 USD/million), not a vendor offer. Fixed scaling prevents an unrelated expensive candidate from flattening all cost penalties. Unknown prices produce a public estimate of `null` and cost utility 0. Internal unconstrained search uses a cost sentinel of 0, but finite-budget assignment excludes unknown-price candidates; the sentinel never means free execution.
|
|
354
354
|
|
|
355
355
|
### Candidate objective and quality floors
|
|
356
356
|
|
|
357
|
-
With normalized quality
|
|
357
|
+
With normalized quality $`q`$ and normalized latency, specialty, reasoning-fit and risk proxies:
|
|
358
358
|
|
|
359
359
|
<!-- formula:latency-utility -->
|
|
360
360
|
```math
|
|
@@ -374,25 +374,25 @@ u = w_q q+w_c U_c+w_\ell L+w_s s+w_r r-w_k k-\alpha\max(0,f-q)+\Delta_p
|
|
|
374
374
|
S = \sum_{j=1}^{n}u_j - 0.015\sum_{(i,j)\in E}\mathbf{1}[\rho_i\ne\rho_j]
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
$`L`$ is latency utility: $`t`$ is the matching historical P90 duration in milliseconds; otherwise $`\ell`$ is the latency proxy and $`e_\ell`$ its effort multiplier. In the utility formula, $`s`$/$`r`$/$`k`$ are specialty/reasoning-fit/risk, $`f`$ is the quality floor, $`\alpha`$ is criticality, and $`\Delta_p`$ is the bounded `preferenceAdjustment`; the $`w`$ terms are the corresponding weights. $`S`$ is `assignmentScore`; $`E`$ contains dependency edges, and $`\rho_j`$ is package $`j`$'s `provider/model` route. The indicator is 1 when routes differ, otherwise 0.
|
|
378
378
|
|
|
379
379
|
Quality first uses sufficient matching objective task evidence, then falls back to task-category LiveBench, overall LiveBench, and profile/catalog estimates. Model and effort are compared jointly only when at least two API efforts have usable task evidence; observed duration can replace the latency proxy. Public-data refresh is opt-in. Human ratings affect only the bounded `preferenceAdjustment`; they cannot increase objective quality or satisfy its floor.
|
|
380
380
|
|
|
381
381
|
| Package basis | Quality | Cost | Latency | Specialty | Reasoning | Risk |
|
|
382
382
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
383
|
-
| Simple | .28 | .45 | .14 | .04 | .07 | .02 |
|
|
384
|
-
| Balanced | .40 | .26 | .10 | .09 | .10 | .05 |
|
|
385
|
-
| Complex | .48 | .14 | .06 | .14 | .11 | .07 |
|
|
386
|
-
| Synthesis | .58 | .08 | .04 | .08 | .16 | .06 |
|
|
383
|
+
| Simple | 0.28 | 0.45 | 0.14 | 0.04 | 0.07 | 0.02 |
|
|
384
|
+
| Balanced | 0.40 | 0.26 | 0.10 | 0.09 | 0.10 | 0.05 |
|
|
385
|
+
| Complex | 0.48 | 0.14 | 0.06 | 0.14 | 0.11 | 0.07 |
|
|
386
|
+
| Synthesis | 0.58 | 0.08 | 0.04 | 0.08 | 0.16 | 0.06 |
|
|
387
387
|
|
|
388
|
-
Base quality floors are
|
|
388
|
+
Base quality floors are **0.75 / 0.78 / 0.82** for simple/balanced/complex tasks; critical complex packages raise the floor, and complex synthesis is at least 0.84. The economy preset multiplies quality/cost/latency weights by 0.75/1.6/1.1 and lowers the floor by 0.04. Quality-first multiplies quality/cost/specialty/reasoning by 1.35/0.5/1.2/1.2 and raises the floor by 0.04. Tilted weights are renormalized to the original total; adjusted floors are clamped to [0.5, 0.97]. Balanced applies no tilt.
|
|
389
389
|
|
|
390
390
|
### Candidate pruning and assignment search
|
|
391
391
|
|
|
392
392
|
1. Prefer candidates meeting each package's floor. If none qualify, retain up to three highest-quality fallbacks and report relaxation.
|
|
393
393
|
2. Keep at most **12 candidates per package**, including anchors for lowest known cost, greatest utility and highest quality. Local Pareto pruning is disabled when dependencies exist, because route identity affects handoffs.
|
|
394
394
|
3. Validate unique package IDs and topological dependency order. Search the retained Cartesian space exactly when its size is at most **4,096**; otherwise use **beam width 256**. Search compresses dominated prefixes sharing the same future dependency boundary and ranks them using optimistic future handoffs. Remaining minimum costs prune infeasible prefixes; the beam protects the cheapest feasible prefix under a finite budget.
|
|
395
|
-
4. Compare assignments lexicographically: fewer relaxed packages, smaller quality shortfall, higher utility, lower cost, fewer route switches, then stable route order. Minimum-cost mode compares cost before utility. Each dependency crossing a `provider/model` route subtracts .015 from utility.
|
|
395
|
+
4. Compare assignments lexicographically: fewer relaxed packages, smaller quality shortfall, higher utility, lower cost, fewer route switches, then stable route order. Minimum-cost mode compares cost before utility. Each dependency crossing a `provider/model` route subtracts 0.015 from utility.
|
|
396
396
|
5. Report search metadata and feasibility. When a positive budget has no feasible assignment, a minimum-cost alternative can still be returned with `budgetFeasible: false`. A displayed plan is not proof that the budget is satisfied.
|
|
397
397
|
|
|
398
398
|
“Exact” applies only to the retained candidate space and proxy objective. Candidate caps and beam pruning preclude a claim of global optimality over every configured model. Unit/synthetic tests establish mechanisms, not actual answer-quality gains. The public 2026-06-25 LiveBench score/cost tables used by the research audit are aggregate data; a paired per-question quality/cost matrix was not obtained, so no real routing gain is claimed. See [research](docs/ROUTING_RESEARCH.zh.md), [derivation/experiments](docs/ROUTING_DERIVATION_EXPERIMENTS.zh.md), and [validation protocol](docs/ROUTING_LIVEBENCH_VALIDATION.zh.md).
|
|
@@ -455,7 +455,7 @@ Open [the local preview](http://127.0.0.1:4173). It uses mock models, tools and
|
|
|
455
455
|
| `experiment-plugin/` | Separate research experiment project; not shipped as part of the router plugin. |
|
|
456
456
|
| `docs/` and dated reports | User documentation and historical verification records. |
|
|
457
457
|
|
|
458
|
-
`check:readme` guards the six
|
|
458
|
+
`check:readme` guards the six display formulas, inline mathematical symbols, leading zeros in decimals, matching formulas in both languages and the reviewed blob hashes. `npm test` and `prepack` run this check; render changes must also be viewed on GitHub. The math blocks use [GitHub-supported syntax](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions).
|
|
459
459
|
|
|
460
460
|
`check:client` rebuilds in memory and compares the generated output with the committed bundle; `prepack` refuses a stale bundle. pnpm 10 has no `pnpm peers check` command: use the strict install above. Unavailable/incompatible host SDK packages may require the installed Harness runtime for local integration testing; [setup-harness-dev.mjs](scripts/setup-harness-dev.mjs) links missing SDK packages from an explicitly supplied Host `node_modules`, and [start-harness-preview.mjs](scripts/start-harness-preview.mjs) starts a separate local web Host profile. These helpers do not replace dependency verification or Desktop acceptance checks.
|
|
461
461
|
|
package/README.zh.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
面向 **DeepSeek Harness Desktop** 的成本感知模型路由工作台。在本地规划任务、比较已配置路线、检查执行权限,并通过模型 API 或支持的厂商官方 CLI 执行有依赖关系的工作包。
|
|
6
6
|
|
|
7
|
-
当前版本:**0.22.
|
|
7
|
+
当前版本:**0.22.2**(`@ljwei-stak/dsh-model-router`)。新增“按算法推荐分配 / 手动调整分配”:拆分后的工作包可逐个指定模型 API 或官方工具,保留依赖、重新预览费用,并保存重跑目标。同时接入任务相关质量证据、模型与推理档位联合选择、历史资源 P90 估计与依赖感知搜索。手动混合执行当前只读;官方工具使用自身默认模型,原有官方团队编辑流程保留。继续兼容 **DeepSeek Harness Desktop 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2**,沿用 Hermes/Pi 安装与终端支持;两者仍无经过验证的托管执行器。真实厂商执行证据仍见 **0.20.0** 报告,本版未新增模型实测。路由器与 [GAL](https://github.com/Alice-Marx/deepseek-harness-galgame) 自 0.12.0 起已拆分为独立插件。
|
|
8
8
|
|
|
9
9
|
官方 CLI 协作按依赖顺序逐包执行、传递依赖上下文,不会自动回退到模型目录 API。可编辑团队需明确选择 Harness 沙箱或厂商 CLI 正常环境。后者通过 Git worktree 收集修改,但不限制操作系统访问。未显式设置模型映射时,各 CLI 沿用自身配置的模型。参见[真实 Windows 验证及其局限](docs/releases/0.20.0-validation.md)。
|
|
10
10
|
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
打开 **插件 → 添加插件**,输入:
|
|
41
41
|
|
|
42
42
|
```text
|
|
43
|
-
@ljwei-stak/dsh-model-router@0.22.
|
|
43
|
+
@ljwei-stak/dsh-model-router@0.22.2
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
镜像缺少该精确版本时,使用官方 HTTPS npm 源 `https://registry.npmjs.org/`。启用插件,然后完全退出 Harness(包括托盘进程)并重启。插件详情应显示 **0.22.
|
|
46
|
+
镜像缺少该精确版本时,使用官方 HTTPS npm 源 `https://registry.npmjs.org/`。启用插件,然后完全退出 Harness(包括托盘进程)并重启。插件详情应显示 **0.22.2**,侧栏应出现 **模型路由**。仅执行全局 `npm install -g` 不会把插件注册到 Desktop。
|
|
47
47
|
|
|
48
48
|
也可以通过插件管理器安装本地 `.tgz` 压缩包,或解压后的内部 `package` 目录。两者都必须包含 `package.json` 和 `.dsh-plugin`。历史构建见 [Releases](https://github.com/Alice-Marx/dsh-model-router/releases),也可按下文从源码构建。
|
|
49
49
|
|
|
50
50
|
### 从旧包名升级
|
|
51
51
|
|
|
52
|
-
旧名称 `@ljwei-stak/model-router-galgame` 停留在 0.13.0。保留配置档/应用数据,移除旧插件条目,再添加 `@ljwei-stak/dsh-model-router@0.22.
|
|
52
|
+
旧名称 `@ljwei-stak/model-router-galgame` 停留在 0.13.0。保留配置档/应用数据,移除旧插件条目,再添加 `@ljwei-stak/dsh-model-router@0.22.2`。不要同时保留两条插件:它们共用内部插件 id `model-router-galgame` 和工具名。保留该 id 能让现有路由设置与历史记录继续使用。
|
|
53
53
|
|
|
54
54
|
从合包 0.11.x 升级前,先备份配置档,并导出需要保留的 GAL 存档。剧情播放、立绘、音乐与存档现属于独立的 `@ljwei-stak/dsh-galgame`。详细存档限制见 [MIGRATION.md](docs/archive/MIGRATION.md)。
|
|
55
55
|
|
|
@@ -322,7 +322,7 @@ Coding-plan 密钥与端点保留在 Harness 供应商设置中。`plan-key` 配
|
|
|
322
322
|
C_a = \frac{I_u p_i+O p_o+R p_r+W p_w}{10^6}
|
|
323
323
|
```
|
|
324
324
|
|
|
325
|
-
|
|
325
|
+
$`C_a`$ 对应 `actualUsd`;$`I_u`$、$`O`$、$`R`$、$`W`$ 分别对应 `inputTokens`、`outputTokens`、`cacheReadTokens`、`cacheWriteTokens`,$`p_i`$、$`p_o`$、$`p_r`$、$`p_w`$ 分别为输入、输出、缓存读取和缓存写入单价,单位为美元/百万 token。
|
|
326
326
|
|
|
327
327
|
经适配器归一化后,这些账本计数互不重叠;不要把缓存 token 再加到已包含缓存的输入计数中。缺少可选缓存单价时,使用输入单价。用量不完整、价格缺失或身份未知/不匹配时,金额保持 `null`,不是零。完整的终态证据可在失败、取消、超时后保留;部分事件标记为 `usageIncomplete`。
|
|
328
328
|
|
|
@@ -338,7 +338,7 @@ C_a = \frac{I_u p_i+O p_o+R p_r+W p_w}{10^6}
|
|
|
338
338
|
|
|
339
339
|
### Token 与价格估计
|
|
340
340
|
|
|
341
|
-
没有匹配资源证据时,基础输入 token 为
|
|
341
|
+
没有匹配资源证据时,基础输入 token 为 $`\max(80,\lceil n/3.7\rceil)`$,再乘以工作包阶段系数。基础输出为 900,按阶段/推理强度调整,最少 220。其中 $`n`$ 对应 JavaScript 的 `text.length`。这是按文本长度估算,不是厂商 tokenizer。匹配的完整历史记录达到样本门槛后,改用经验 P90 资源估计,不再重复乘档位和阶段系数。令 $`I`$ 为估计输入总数,$`R`$/$`W`$ 为缓存读取/写入部分,$`O`$ 为输出,价格单位为美元/百万 token:
|
|
342
342
|
|
|
343
343
|
<!-- formula:planning-cost -->
|
|
344
344
|
```math
|
|
@@ -350,11 +350,11 @@ C = \frac{(I-R-W)p_i+O p_o+R p_r+W p_w}{10^6}
|
|
|
350
350
|
U_c = \frac{1}{1+C/\max(C_{\mathrm{ref}},10^{-12})}
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
|
|
353
|
+
$`U_c`$ 对应 `costUtility`,单价符号与上文一致。$`C_{\mathrm{ref}}`$ 使用固定参考价(输入 1、输出 5、缓存读取/写入 1 美元/百万),不是厂商报价。固定尺度防止一个无关的昂贵候选把所有费用惩罚压平。未知价格的公开估计为 `null`,费用效用为 0。内部无预算约束搜索使用费用哨兵值 0,但有限预算分配会排除价格未知候选;哨兵值绝不代表执行免费。
|
|
354
354
|
|
|
355
355
|
### 候选目标与质量下限
|
|
356
356
|
|
|
357
|
-
使用归一化质量
|
|
357
|
+
使用归一化质量 $`q`$,以及归一化延迟、领域匹配、推理匹配和风险代理值:
|
|
358
358
|
|
|
359
359
|
<!-- formula:latency-utility -->
|
|
360
360
|
```math
|
|
@@ -374,25 +374,25 @@ u = w_q q+w_c U_c+w_\ell L+w_s s+w_r r-w_k k-\alpha\max(0,f-q)+\Delta_p
|
|
|
374
374
|
S = \sum_{j=1}^{n}u_j - 0.015\sum_{(i,j)\in E}\mathbf{1}[\rho_i\ne\rho_j]
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
$`L`$ 为延迟效用:$`t`$ 是匹配历史的 P90 耗时,单位为毫秒;未知时使用延迟代理值 $`\ell`$ 及档位系数 $`e_\ell`$。效用式中,$`s`$/$`r`$/$`k`$ 分别是领域匹配、推理匹配和风险,$`f`$ 为质量下限,$`\alpha`$ 为关键性,$`\Delta_p`$ 为有界的 `preferenceAdjustment`;各 $`w`$ 为对应权重。$`S`$ 对应 `assignmentScore`,$`E`$ 为依赖边集合,$`\rho_j`$ 为工作包 $`j`$ 的 `provider/model` 路线;指示函数在路线不同时取 1,否则取 0。
|
|
378
378
|
|
|
379
379
|
质量优先使用足量且匹配的任务客观证据,再回退对应任务类别的 LiveBench 分数、整体 LiveBench、路线配置/目录估值。至少两个 API 档位各有可用任务证据时,才联合比较模型与档位;经验耗时可替换延迟代理项。公共数据刷新默认关闭,需主动启用。人工评分仅影响有界的 `preferenceAdjustment`,不能提高客观质量或满足质量下限。
|
|
380
380
|
|
|
381
381
|
| 工作包基础类型 | 质量 | 费用 | 延迟 | 领域 | 推理 | 风险 |
|
|
382
382
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
383
|
-
| 简单 | .28 | .45 | .14 | .04 | .07 | .02 |
|
|
384
|
-
| 均衡 | .40 | .26 | .10 | .09 | .10 | .05 |
|
|
385
|
-
| 复杂 | .48 | .14 | .06 | .14 | .11 | .07 |
|
|
386
|
-
| 汇总 | .58 | .08 | .04 | .08 | .16 | .06 |
|
|
383
|
+
| 简单 | 0.28 | 0.45 | 0.14 | 0.04 | 0.07 | 0.02 |
|
|
384
|
+
| 均衡 | 0.40 | 0.26 | 0.10 | 0.09 | 0.10 | 0.05 |
|
|
385
|
+
| 复杂 | 0.48 | 0.14 | 0.06 | 0.14 | 0.11 | 0.07 |
|
|
386
|
+
| 汇总 | 0.58 | 0.08 | 0.04 | 0.08 | 0.16 | 0.06 |
|
|
387
387
|
|
|
388
|
-
简单/均衡/复杂任务的基础质量下限分别为
|
|
388
|
+
简单/均衡/复杂任务的基础质量下限分别为 **0.75 / 0.78 / 0.82**;关键复杂包会提高下限,复杂任务的汇总包至少为 0.84。省钱预设把质量/费用/延迟权重分别乘以 0.75/1.6/1.1,并把下限降低 0.04。效果优先把质量/费用/领域/推理权重分别乘以 1.35/0.5/1.2/1.2,并把下限提高 0.04。倾斜后的权重重新归一化到原总量;调整后的下限限制在 [0.5, 0.97]。均衡不作倾斜。
|
|
389
389
|
|
|
390
390
|
### 候选裁剪与分配搜索
|
|
391
391
|
|
|
392
392
|
1. 优先保留达到各工作包质量下限的候选。若没有合格候选,保留质量最高的至多三个回退候选,并报告约束放宽。
|
|
393
393
|
2. 每包最多保留 **12 个候选**,包含最低已知费用、最大效用与最高质量的锚点。存在依赖时禁用局部 Pareto 裁剪,因为路线身份会影响交接。
|
|
394
394
|
3. 验证工作包 ID 唯一且依赖按拓扑排序。保留候选的笛卡尔空间大小不超过 **4,096** 时精确搜索;否则采用 **beam width 256**。搜索按未来依赖的模型边界压缩被支配前缀,并用未来交接的乐观估计排序。剩余最小费用用于裁剪不可行前缀;有限预算时,beam 会保护最便宜的可行前缀。
|
|
395
|
-
4. 按字典序比较分配:更少放宽包、更小质量缺口、更高效用、更低费用、更少路线切换,最后稳定的路线顺序。最小费用模式先比较费用,再比较效用。每条跨越 `provider/model` 路线的依赖边从效用中扣除 .015。
|
|
395
|
+
4. 按字典序比较分配:更少放宽包、更小质量缺口、更高效用、更低费用、更少路线切换,最后稳定的路线顺序。最小费用模式先比较费用,再比较效用。每条跨越 `provider/model` 路线的依赖边从效用中扣除 0.015。
|
|
396
396
|
5. 报告搜索元数据与可行性。正预算下若不存在可行分配,仍可返回最小费用备选,但标记 `budgetFeasible: false`。显示了计划不代表预算已满足。
|
|
397
397
|
|
|
398
398
|
“精确”仅适用于保留下来的候选空间与代理目标。候选上限和 beam 裁剪意味着不能声称在所有已配置模型上全局最优。单元/合成测试验证机制,不证明真实回答质量提升。研究审查使用的公开 2026-06-25 LiveBench 分数/费用表属于汇总数据;未取得逐题配对的质量/费用矩阵,因此不主张真实路由收益。参见[研究](docs/ROUTING_RESEARCH.zh.md)、[推导/实验](docs/ROUTING_DERIVATION_EXPERIMENTS.zh.md)与[验证规程](docs/ROUTING_LIVEBENCH_VALIDATION.zh.md)。
|
|
@@ -455,7 +455,7 @@ npm run preview:ui
|
|
|
455
455
|
| `experiment-plugin/` | 独立研究实验项目,不随路由插件发布。 |
|
|
456
456
|
| `docs/` 与带日期报告 | 用户文档与历史验证记录。 |
|
|
457
457
|
|
|
458
|
-
`check:readme`
|
|
458
|
+
`check:readme` 检查六个展示公式、正文行内数学符号、小数前导零、双语公式一致性和审阅后的 blob 哈希;`npm test` 与 `prepack` 均会执行。修改公式后还须在 GitHub 页面查看实际渲染。公式块采用 [GitHub 官方支持的语法](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions)。
|
|
459
459
|
|
|
460
460
|
`check:client` 在内存中重建并比较已提交 bundle;`prepack` 会拒绝过期 bundle。pnpm 10 没有 `pnpm peers check` 命令:请使用上述严格安装。Host SDK 包不可用/不兼容时,本地集成测试可能需要已安装的 Harness 运行时;[setup-harness-dev.mjs](scripts/setup-harness-dev.mjs) 从显式提供的 Host `node_modules` 链接缺失 SDK 包,[start-harness-preview.mjs](scripts/start-harness-preview.mjs) 启动独立的本地 Web Host 配置档。这些辅助脚本不能代替依赖验证或 Desktop 验收。
|
|
461
461
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DeepSeek Harness Desktop · 独立插件安装与验证
|
|
2
2
|
|
|
3
|
-
模型路由从 **0.12.0** 起独立发布;GAL 是独立的 **0.1.0** 插件。路由 **0.22.
|
|
3
|
+
模型路由从 **0.12.0** 起独立发布;GAL 是独立的 **0.1.0** 插件。路由 **0.22.2** 声明支持官方 **DeepSeek Harness Desktop 0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2**。GAL 的兼容范围以其自身安装包为准。
|
|
4
4
|
|
|
5
|
-
当前路由版本为 **0.22.
|
|
5
|
+
当前路由版本为 **0.22.2**,修复中英文 README 正文数学符号显示与小数格式;0.22.0 新增算法推荐与手动工作包分配二选一,可逐包选择模型 API 或官方工具,并改进证据驱动规划与依赖搜索。手动混合执行目前只读;编辑文件继续走官方工具协作。沿用 Hermes/Pi 安装与终端支持、OpenCode 官方 V2 包和现有兼容声明。保留原插件 id、配置与运行记录;安装后完全退出 Harness(包括托盘)再重启。公开数据默认关闭,自动质量升级默认关闭。
|
|
6
6
|
|
|
7
7
|
[路由 README](../README.zh.md) · [迁移说明](archive/MIGRATION.md) · [独立 GAL README](https://github.com/Alice-Marx/deepseek-harness-galgame#readme)
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
| 需求 | 添加插件输入框 | 安装后的入口 |
|
|
12
12
|
| --- | --- | --- |
|
|
13
|
-
| 分析复杂度、按质量和费用选模型、调用官方工具 | `@ljwei-stak/dsh-model-router@0.22.
|
|
13
|
+
| 分析复杂度、按质量和费用选模型、调用官方工具 | `@ljwei-stak/dsh-model-router@0.22.2` | 模型路由 |
|
|
14
14
|
| 剧情、立绘、音乐、存档、自由对话 | `@ljwei-stak/dsh-galgame@0.1.0` | Gal 模块 |
|
|
15
15
|
| 两者都要 | 分别安装上面两个包 | 模型路由 + Gal 模块 |
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
2. 在“包名、GitHub 仓库地址或本地目录路径”输入框填一个完整包名,例如:
|
|
25
25
|
|
|
26
26
|
```text
|
|
27
|
-
@ljwei-stak/dsh-model-router@0.22.
|
|
27
|
+
@ljwei-stak/dsh-model-router@0.22.2
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
只想安装 GAL 时填写:
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
4. 核对预览的包名、版本和宿主兼容信息,安装并启用。完全退出 Harness(包括托盘进程)再启动,确保 Host 加载新代码。
|
|
43
|
-
5. 检查插件详情与侧边栏:路由应为 **0.22.
|
|
43
|
+
5. 检查插件详情与侧边栏:路由应为 **0.22.2 / 模型路由**;GAL 应为 **0.1.0 / Gal 模块**。仅装路由时没有 GAL 入口是预期行为。
|
|
44
44
|
|
|
45
45
|
普通用户无需 `npm install -g`,该命令不会把插件注册到当前 Harness profile。
|
|
46
46
|
|
|
@@ -48,13 +48,13 @@
|
|
|
48
48
|
|
|
49
49
|
进入对应 Release 下载 `.tgz`:
|
|
50
50
|
|
|
51
|
-
- [模型路由 Releases](https://github.com/Alice-Marx/dsh-model-router/releases)(也可运行 `npm pack @ljwei-stak/dsh-model-router@0.22.
|
|
51
|
+
- [模型路由 Releases](https://github.com/Alice-Marx/dsh-model-router/releases)(也可运行 `npm pack @ljwei-stak/dsh-model-router@0.22.2` 获取同一安装包)
|
|
52
52
|
- [独立 GAL v0.1.0](https://github.com/Alice-Marx/deepseek-harness-galgame/releases/tag/v0.1.0)
|
|
53
53
|
|
|
54
54
|
在“添加插件”填写下载文件的**绝对路径**,例如:
|
|
55
55
|
|
|
56
56
|
```text
|
|
57
|
-
D:\Plugins\ljwei-stak-dsh-model-router-0.22.
|
|
57
|
+
D:\Plugins\ljwei-stak-dsh-model-router-0.22.2.tgz
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
```text
|
|
@@ -64,7 +64,7 @@ D:\Plugins\ljwei-stak-dsh-galgame-0.1.0.tgz
|
|
|
64
64
|
如附有 `.sha256` 文件,用 PowerShell 计算并比较摘要:
|
|
65
65
|
|
|
66
66
|
```powershell
|
|
67
|
-
Get-FileHash -Algorithm SHA256 -LiteralPath 'D:\Plugins\ljwei-stak-dsh-model-router-0.22.
|
|
67
|
+
Get-FileHash -Algorithm SHA256 -LiteralPath 'D:\Plugins\ljwei-stak-dsh-model-router-0.22.2.tgz'
|
|
68
68
|
Get-FileHash -Algorithm SHA256 -LiteralPath 'D:\Plugins\ljwei-stak-dsh-galgame-0.1.0.tgz'
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ Get-FileHash -Algorithm SHA256 -LiteralPath 'D:\Plugins\ljwei-stak-dsh-galgame-0
|
|
|
74
74
|
|
|
75
75
|
1. 在旧合并插件的 GAL 播放器导出需要保留的剧情进度,并备份整个 Harness profile。每份 JSON 仅保存**当前剧情状态**,不含所有手动槽、设置、已读记录或本地音乐;重要槽位可依次读档再导出。
|
|
76
76
|
2. 在**同一个 profile**安装独立 `@ljwei-stak/dsh-galgame@0.1.0`。
|
|
77
|
-
3. 0.13.0 起包名改为 `@ljwei-stak/dsh-model-router`(旧包名最后版本为 0.13.0,内容相同,之后不再更新):在插件管理器卸载原 `@ljwei-stak/model-router-galgame`(保留 profile 与应用数据),再添加 `@ljwei-stak/dsh-model-router@0.22.
|
|
77
|
+
3. 0.13.0 起包名改为 `@ljwei-stak/dsh-model-router`(旧包名最后版本为 0.13.0,内容相同,之后不再更新):在插件管理器卸载原 `@ljwei-stak/model-router-galgame`(保留 profile 与应用数据),再添加 `@ljwei-stak/dsh-model-router@0.22.2`。不要两个同时安装(条目 id 与工具名相同);条目 id 未变,路由设置与执行记录会保留。完成两项更新后再玩剧情,避免同时操作旧合并入口和新入口。
|
|
78
78
|
4. 现在路由与 GAL 各有一个入口。独立 GAL 沿用旧存档 localStorage 键,核对当前进度和三槽;更换 profile 或进度未恢复时,先切换到匹配剧目,再导入 JSON 备份。
|
|
79
79
|
5. 后续分别更新需要的插件;只用路由可以不启用或不安装 GAL。保留 profile 与应用数据,卸载插件时不要清理故事数据。
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ GAL 核心只包含**《回声之城·正篇》**与**《旧城迁移篇:未
|
|
|
82
82
|
|
|
83
83
|
## 5. 模型路由第一次使用
|
|
84
84
|
|
|
85
|
-
工作台自 0.15.0 起分成**任务与执行、模型配置、官方工具、预算与安全**四页;0.22.
|
|
85
|
+
工作台自 0.15.0 起分成**任务与执行、模型配置、官方工具、预算与安全**四页;0.22.2 沿用该布局。切换页面保留安装任务、终端会话和未完成的输入。
|
|
86
86
|
|
|
87
87
|
1. 在 Harness 官方**模型**页配置供应商、模型与凭据。插件读取准确的 `provider/model` 目录,模型档案不保存 API Key。
|
|
88
88
|
2. 在**模型配置**刷新目录,逐条填写自报质量评分、核对过的输入/输出单价(USD / 百万 token)和擅长方向;缺价留空。可选 `cliModel` 必须是该厂商 CLI 已验证接受的名字。可选 LiveBench 名称须准确对应版本与推理档位;它是用户确认的映射,不自动证明实际执行档位。
|
|
@@ -114,7 +114,7 @@ GAL 核心只包含**《回声之城·正篇》**与**《旧城迁移篇:未
|
|
|
114
114
|
| 检查 | 预期 |
|
|
115
115
|
| --- | --- |
|
|
116
116
|
| 路由宿主版本 | 0.2.0-rc.1、0.2.0-rc.2 或 0.2.1-rc.2;包括 `rc` 后缀。 |
|
|
117
|
-
| 路由独立安装 | 0.22.
|
|
117
|
+
| 路由独立安装 | 0.22.2 详情、模型路由入口、目录和模型档案可用;不出现旧合并 GAL 入口。 |
|
|
118
118
|
| GAL 独立安装 | 0.1.0 详情、Gal 模块入口、标题与两部核心剧情可用;不要求安装路由。 |
|
|
119
119
|
| 共同安装 | 两个入口各一份,路由工具和 GAL 播放器均能使用。 |
|
|
120
120
|
| 存档迁移 | 同 profile 可读旧键;跨 profile 用匹配剧目 JSON 导入;旧篇目的数据不覆盖。 |
|
|
@@ -129,7 +129,7 @@ GAL 核心只包含**《回声之城·正篇》**与**《旧城迁移篇:未
|
|
|
129
129
|
|
|
130
130
|
## 8. 开发者从完整源码构建
|
|
131
131
|
|
|
132
|
-
路由需要 Node.js **22.19+** 与 **pnpm 10.34.6**。从完整源码仓库根目录构建;当前源码版本为 0.22.
|
|
132
|
+
路由需要 Node.js **22.19+** 与 **pnpm 10.34.6**。从完整源码仓库根目录构建;当前源码版本为 0.22.2,复现已发布版本时检出对应发布标签。旧版(如 0.15.0)标签保留其当时内容。运行:
|
|
133
133
|
|
|
134
134
|
```powershell
|
|
135
135
|
pnpm install --frozen-lockfile --strict-peer-dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 模型路由工作台:配置、规划与实际执行
|
|
2
2
|
|
|
3
|
-
适用版本:`@ljwei-stak/dsh-model-router@0.22.
|
|
3
|
+
适用版本:`@ljwei-stak/dsh-model-router@0.22.2`。声明兼容 DeepSeek Harness Desktop `0.2.0-rc.1 / 0.2.0-rc.2 / 0.2.1-rc.2`。安装与开发见[中文 README](../README.zh.md),旧包迁移见[迁移说明](archive/MIGRATION.md)。
|
|
4
4
|
|
|
5
5
|
0.22.0 新增“按算法推荐分配 / 手动调整分配”:生成任务建议后,可为每个工作包选择模型 API 或官方工具;修改后重新预览费用与渠道,再确认执行。任务依赖与重跑目标保留。手动混合执行当前只读,官方工具使用自身默认模型;编辑文件继续选择官方工具协作。详见[手动分配说明](MANUAL_TASK_ASSIGNMENT.zh.md)。Hermes 自定义程序目录、原配置/登录/历史位置,以及工具页顶部终端的行为继续保留。
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ljwei-stak/dsh-model-router",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Model Router for official DeepSeek Harness Desktop: cost-aware task routing, dependent work packages and official vendor CLI discovery, installation and execution. GAL is available separately as @ljwei-stak/dsh-galgame.",
|
|
6
6
|
"repository": {
|