dsh-livebench-panel 0.2.15 → 0.2.17

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 cszr (Vithrive)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # dsh-livebench-panel
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/dsh-livebench-panel.svg)](https://www.npmjs.com/package/dsh-livebench-panel)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-livebench-panel.svg)](https://www.npmjs.com/package/dsh-livebench-panel)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+
3
7
  DSH web 插件:在 **Trajectory 视图(轨迹视图)** 的「对话 / 轨迹」标签右侧新增一个 **LiveBench** 标签页。点进去即可用下拉框选择参数,直接对本机 LiveBench 发起评测并查看成绩。
4
8
 
9
+ > 💬 使用问题、配置分享、成绩对比 → [Discussions](https://github.com/Vithrive/dsh-livebench-panel/discussions);
10
+ > 缺陷与功能建议 → [Issues](https://github.com/Vithrive/dsh-livebench-panel/issues)。
11
+ > 遇到报错请先看 [LiveBench 本地补丁说明](docs/livebench-patches.md),多数问题源于漏打补丁。
12
+
5
13
  ## ⚠️ 依赖要求(必读)
6
14
 
7
15
  本插件只是**控制台**,真正的评测由 [LiveBench](https://github.com/LiveBench/LiveBench) 项目在本机完成。仅安装插件时,面板底部会显示同样的安装指引。完整安装步骤(Windows,约 10–20 分钟):
@@ -36,7 +44,7 @@ cd livebench
36
44
  | 题集 release | LiveBench 题目发布批次 | 公开题目最全的是 `2024-11-25`(推荐) |
37
45
  | 分类 | 六大类:coding / math / reasoning / language / data_analysis / instruction_following | 首次验证选 `language` |
38
46
  | 任务 | 分类下的具体任务(如 language/typos 拼写纠错) | 首次验证选 `typos`(短平快) |
39
- | 题目序号范围 | 该任务题目的起止下标(0 起) | 冒烟测试填 0–1(只跑 2 题) |
47
+ | 题目序号范围 | 该任务题目的起止下标(0 起,**含首尾**) | 冒烟测试填 0–1(只跑 2 题) |
40
48
  | max-tokens | 单次回答的 token 上限 | 推理模型给 8192+,否则思考被截断判 0 分 |
41
49
 
42
50
  ## 功能
@@ -48,7 +56,8 @@ cd livebench
48
56
  - 强度编码进 display-name(如 `code-gpt__gpt-5.6-sol@high`),**不同强度在成绩表中是独立条目**,可直接对比。
49
57
  - **参数下拉框**:题集 release(LiveBench 全部 releases)、分类(coding/math/reasoning/language/data_analysis/instruction_following)、任务(随分类联动)、题目序号范围、max-tokens。
50
58
  - **运行控制**:开始 / 停止 / 刷新;最多 9 个模型并发评测(每个模型同时只跑 1 次);实时滚动日志(每 2.5s 轮询);「刷新」会清掉已结束的运行日志。
51
- - **成绩表**:直接读取 `data/live_bench/**/model_judgment/ground_truth_judgment.jsonl` 计算 模型 × 任务 平均分(分数 = 正确率 ×100,单元格下方括号标注「本次没做或没做完的题数 / 本次设定的题数」),无需等 LiveBench 自己出榜。支持按模型名/时间排序、拖 ⠿ 自定义行序、勾选或单行按钮删除成绩(删除会同时清掉该模型的答案与判分行;只有空壳文件的“幽灵行”不会再被扫描出来,删除结果稳定持久)。
59
+ - **成绩表**:直接读取 `data/live_bench/**/model_judgment/ground_truth_judgment.jsonl` 计算 模型 × 任务 平均分(分数 = 正确率 ×100,单元格下方括号标注「**本次没做或没做完的题数 / 用户选择的题数**」,即题目序号范围的题数;不参与正确率计算的总题数不展示),无需等 LiveBench 自己出榜。支持按模型名/时间排序、拖 ⠿ 自定义行序、勾选或单行按钮删除成绩(删除会同时清掉该模型的答案与判分行;只有空壳文件的“幽灵行”不会再被扫描出来,删除结果稳定持久)。
60
+ - **题目序号范围按闭区间处理**:LiveBench 的 `--question-end` 是开区间(`questions[begin:end]`),面板按用户直觉采用闭区间(传参时 `止 + 1`),因此界面上填的题数与实际跑的题数一致。
52
61
 
53
62
  ## 依赖
54
63
 
@@ -69,13 +78,52 @@ cd livebench
69
78
  | `/dsh-livebench-panel/api/clear` | POST | 清掉已结束的运行日志/记录 |
70
79
  | `/dsh-livebench-panel/api/home` | POST | 保存 LiveBench 检出路径 |
71
80
 
72
- ## 安装(本地开发,遵循 ~/.dsh/AGENTS.md)
81
+ ## 安装
82
+
83
+ ### 方式 A:从 npm 安装(推荐)
84
+
85
+ ```bash
86
+ dsh plugin --profile web add dsh-livebench-panel
87
+ ```
88
+
89
+ ### 方式 B:从本仓库安装
90
+
91
+ ```bash
92
+ git clone https://github.com/Vithrive/dsh-livebench-panel.git ~/.dsh/plugins/dsh-livebench-panel
93
+ ```
94
+
95
+ 然后在 `~/.dsh/profiles/web/package.json` 中:
96
+
97
+ 1. `dependencies` 加入 `"dsh-livebench-panel": "link:../../plugins/dsh-livebench-panel"`;
98
+ 2. `dsh.profile.bundles` 数组加入 `"dsh-livebench-panel"`。
99
+
100
+ 最后在 profile 目录执行 `pnpm install`,重启 `dsh web`,打开任一会话的轨迹视图即可看到 **LiveBench** 标签。
101
+
102
+ ## 开发
103
+
104
+ 提交前跑一遍自检(语法 + 插件声明 + npm 打包内容白名单,与 CI 口径一致):
105
+
106
+ ```bash
107
+ node scripts/check.mjs
108
+ ```
109
+
110
+ 仓库结构:
111
+
112
+ ```
113
+ lib/index.js node 半:/dsh-livebench-panel/api/* 路由,spawn run_livebench.py
114
+ lib/client.js 浏览器半:注册 conversation.view 槽位的 LiveBench 标签
115
+ cordis.patch.yml 把插件行插入 profile 的 bundle 层
116
+ scripts/check.mjs 本地自检(语法 / 插件声明 / 打包白名单)
117
+ docs/livebench-patches.md 依赖的 LiveBench 本地补丁(Windows + 中转站兼容)
118
+ smoke.mjs 开发期冒烟脚本(不进 npm 包)
119
+ ```
120
+
121
+ ## 交流与反馈
122
+
123
+ - **Bug / 功能建议**:[Issues](https://github.com/Vithrive/dsh-livebench-panel/issues)(有对应模板)
124
+ - **使用问题 / 配置分享 / 成绩对比**:[Discussions](https://github.com/Vithrive/dsh-livebench-panel/discussions)
125
+ - 提交 Issue 时请附:插件版本、系统与 Node/Python 版本、复现用的 release + 任务 + 题号范围 + provider/模型、以及完整日志(记得打码 API Key 和私有域名)。
73
126
 
74
- 1. 插件源码位于 `~/.dsh/plugins/dsh-livebench-panel/`(开发/验证阶段标准位置);
75
- 2. 在 `~/.dsh/profiles/web/package.json` 的 `dependencies` 加入
76
- `"dsh-livebench-panel": "link:../../plugins/dsh-livebench-panel"`,
77
- 并在 `dsh.profile.bundles` 数组加入 `"dsh-livebench-panel"`;
78
- 3. 在 profile 目录执行 `pnpm install`;
79
- 4. 重启 `dsh web`,打开任一会话的轨迹视图即可看到 **LiveBench** 标签。
127
+ ## License
80
128
 
81
- 验证通过后可发布 npm,再以 `dsh plugin --profile web add <npm包名>` 正式安装。
129
+ [MIT](LICENSE) © 2026 cszr (Vithrive)
package/lib/client.js CHANGED
@@ -539,10 +539,10 @@ window.__ModuleLoader__.load({
539
539
  h("input", { className: c("input"), type: "number", min: 256, max: 32768, value: sel.maxTokens, onChange: setField("maxTokens") }),
540
540
  ),
541
541
  h("div", { className: c("field") },
542
- h("label", { className: c("label") }, "题目序号范围(可选)"),
542
+ h("label", { className: c("label") }, "题目序号范围(可选,0 起,含首尾)"),
543
543
  h("div", { className: c("row"), style: { flexWrap: "nowrap" } },
544
- h("input", { className: c("input"), type: "number", min: 0, placeholder: "", value: sel.begin, onChange: setField("begin"), style: { flex: "1", minWidth: "0" } }),
545
- h("input", { className: c("input"), type: "number", min: 0, placeholder: "", value: sel.end, onChange: setField("end"), style: { flex: "1", minWidth: "0" } }),
544
+ h("input", { className: c("input"), type: "number", min: 0, placeholder: "起(含)", title: "起始题号(0 起,包含该题)", value: sel.begin, onChange: setField("begin"), style: { flex: "1", minWidth: "0" } }),
545
+ h("input", { className: c("input"), type: "number", min: 0, placeholder: "止(含)", title: "结束题号(包含该题);只填起不填止 = 从该题跑到底", value: sel.end, onChange: setField("end"), style: { flex: "1", minWidth: "0" } }),
546
546
  ),
547
547
  h("div", { className: c("field") },
548
548
  h("label", { className: c("label") }, "分类(可多选,不选 = 全部分类;括号内为该 release 下有效题数)"),
@@ -756,7 +756,7 @@ window.__ModuleLoader__.load({
756
756
  h("tr", null, h("th", null, "分类 / 任务"), h("td", null,
757
757
  "六大类共 18 个任务:coding(代码生成/补全)、math(竞赛数学等)、reasoning(空间推理/逻辑谜题)、language(拼写/连线/语义)、data_analysis(表格操作)、instruction_following(指令遵循)。首次验证推荐 language → typos。")),
758
758
  h("tr", null, h("th", null, "题目序号范围"), h("td", null,
759
- "从 0 起。冒烟测试填 0 到 2(只跑 3 题);2 题得分噪声很大(对一题就是 0↔100 的波动),想看真实水平建议 20 题以上。")),
759
+ "从 0 起,起止都包含。冒烟测试填 0 到 2(跑 3 题);只填「起」= 从该题跑到底。2 题得分噪声很大(对一题就是 0↔100 的波动),想看真实水平建议 20 题以上。")),
760
760
  h("tr", null, h("th", null, "max-tokens"), h("td", null,
761
761
  "单题回答的 token 上限,默认 32000。推理模型思考也占 token,不要低于 8192,否则思考被截断、答案为空会记 0 分。")),
762
762
  ),
package/lib/index.js CHANGED
@@ -834,7 +834,9 @@ function apply(ctx) {
834
834
  args.push("--question-begin", String(asInt(body.begin, 0, 100000, 0)));
835
835
  }
836
836
  if (body.end !== undefined && body.end !== null && `${body.end}`.length > 0) {
837
- args.push("--question-end", String(asInt(body.end, 0, 100000, 0)));
837
+ // 面板的「止」按用户直觉是闭区间;LiveBench 的 --question-end 是开区间
838
+ // (gen_api_answer.py: questions[begin:end]),这里 +1 对齐,否则实际少跑一题。
839
+ args.push("--question-end", String(asInt(body.end, 0, 100000, 0) + 1));
838
840
  }
839
841
  if (body.resume === true) args.push("--resume");
840
842
  if (body.retryFailures === true) args.push("--retry-failures");
@@ -884,8 +886,9 @@ function apply(ctx) {
884
886
  }
885
887
  }
886
888
 
887
- // 记录本次评测的配置范围:/results 用它计算每个任务的"设定题数"
888
- // (未做/失败的题数 = 设定题数 - 实际产出的有效答案数)。
889
+ // 记录本次评测的配置范围:/results 用它计算每个任务的"选择题数"
890
+ // 注意 begin/end 存的是面板上的原始输入(闭区间,含首尾),
891
+ // 供 computeResults 算 end - begin + 1;传给 LiveBench 时 end 已 +1。
889
892
  try {
890
893
  const metaDir = join(layout.dataDir, ".dsh_runs");
891
894
  if (!existsSync(metaDir)) mkdirSync(metaDir, { recursive: true });
package/package.json CHANGED
@@ -1,43 +1,52 @@
1
- {
2
- "name": "dsh-livebench-panel",
3
- "version": "0.2.15",
4
- "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "lib/index.js",
8
- "exports": {
9
- ".": "./lib/index.js",
10
- "./client": "./lib/client.js",
11
- "./cordis.patch.yml": "./cordis.patch.yml",
12
- "./package.json": "./package.json"
13
- },
14
- "engines": {
15
- "node": ">=20"
16
- },
17
- "files": [
18
- "lib",
19
- "cordis.patch.yml",
20
- "README.md"
21
- ],
22
- "keywords": [
23
- "dsh-plugin",
24
- "deepseek-harness",
25
- "livebench",
26
- "benchmark",
27
- "evaluation"
28
- ],
29
- "dsh": {
30
- "bundle": {
31
- "patch": "./cordis.patch.yml"
32
- },
33
- "client": {
34
- "platform": "web",
35
- "inject": [
36
- "@deepseek-ai/dsh-client-runtime",
37
- "@deepseek-ai/dsh-client-locale",
38
- "@deepseek-ai/dsh-client-ui-slots",
39
- "@deepseek-ai/dsh-client-ui-conversation"
40
- ]
41
- }
42
- }
43
- }
1
+ {
2
+ "name": "dsh-livebench-panel",
3
+ "version": "0.2.17",
4
+ "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
+ "license": "MIT",
6
+ "author": "cszr (Vithrive)",
7
+ "type": "module",
8
+ "main": "lib/index.js",
9
+ "exports": {
10
+ ".": "./lib/index.js",
11
+ "./client": "./lib/client.js",
12
+ "./cordis.patch.yml": "./cordis.patch.yml",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/Vithrive/dsh-livebench-panel.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/Vithrive/dsh-livebench-panel/issues"
21
+ },
22
+ "homepage": "https://github.com/Vithrive/dsh-livebench-panel#readme",
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "files": [
27
+ "lib",
28
+ "cordis.patch.yml",
29
+ "README.md"
30
+ ],
31
+ "keywords": [
32
+ "dsh-plugin",
33
+ "deepseek-harness",
34
+ "livebench",
35
+ "benchmark",
36
+ "evaluation"
37
+ ],
38
+ "dsh": {
39
+ "bundle": {
40
+ "patch": "./cordis.patch.yml"
41
+ },
42
+ "client": {
43
+ "platform": "web",
44
+ "inject": [
45
+ "@deepseek-ai/dsh-client-runtime",
46
+ "@deepseek-ai/dsh-client-locale",
47
+ "@deepseek-ai/dsh-client-ui-slots",
48
+ "@deepseek-ai/dsh-client-ui-conversation"
49
+ ]
50
+ }
51
+ }
52
+ }