dsh-livebench-panel 0.2.16 → 0.2.18

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -10
  3. package/lib/index.js +14 -13
  4. package/package.json +52 -43
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/index.js CHANGED
@@ -791,7 +791,6 @@ function apply(ctx) {
791
791
  const _pad = (n) => String(n).padStart(2, "0");
792
792
  const runStamp = `r${_now.getFullYear()}${_pad(_now.getMonth() + 1)}${_pad(_now.getDate())}-${_pad(_now.getHours())}${_pad(_now.getMinutes())}${_pad(_now.getSeconds())}`;
793
793
  const displayName = displayModelName(providerId || "direct", modelId) + (hasEffortSuffix ? "@" + effort : "") + "__" + runStamp;
794
- let cliModel = modelId;
795
794
  let writeError = null; // Anthropic-protocol proxies cannot go through --api-base (that path
796
795
  // speaks OpenAI Chat Completions). Instead the generated model config
797
796
  // selects LiveBench's native anthropic client and the spawn env points
@@ -803,22 +802,24 @@ function apply(ctx) {
803
802
  const isOpenAIResponsesRoute = provider
804
803
  && (provider.api === "openai-responses" || provider.api === "openai_responses")
805
804
  && provider.baseURL;
806
- const needConfig = isAnthropicRoute || isOpenAIResponsesRoute || hasEffortSuffix;
807
- if (needConfig) {
808
- writeError = writeGeneratedModelConfig(layout, loadYaml(profileDir), {
809
- displayName,
810
- modelId,
811
- reasoningEffort: isAnthropicRoute ? null : effort,
812
- protocol: isAnthropicRoute ? "anthropic" : isOpenAIResponsesRoute ? "openai_responses" : "openai",
813
- });
814
- if (writeError) return { status: 500, payload: { ok: false, error: writeError } };
815
- cliModel = displayName;
816
- }
805
+ // 每次都写自己的模型配置,并且 --model 永远用 display-name。
806
+ // 不能图省事把裸模型名交给 LiveBench:它会用 get_model_config(裸名) 去撞它自带的
807
+ // 模型库(例如 "kimi-k3" 命中 moonshotai.yml),命中后就改用那份配置的
808
+ // provider / api_kwargs / max_tokens —— 实测会把 temperature 悄悄变成 1.0、
809
+ // max_tokens 变成 131072,等于用户选的 provider 被换掉。写了自己的配置,
810
+ // 解析结果就是确定的 {local: <modelId>} + --api-base。
811
+ writeError = writeGeneratedModelConfig(layout, loadYaml(profileDir), {
812
+ displayName,
813
+ modelId,
814
+ reasoningEffort: isAnthropicRoute ? null : effort,
815
+ protocol: isAnthropicRoute ? "anthropic" : isOpenAIResponsesRoute ? "openai_responses" : "openai",
816
+ });
817
+ if (writeError) return { status: 500, payload: { ok: false, error: writeError } };
817
818
 
818
819
  const benchParts = ["live_bench", ...(category ? [category] : []), ...(task ? [task] : [])];
819
820
  const args = [
820
821
  "run_livebench.py",
821
- "--model", cliModel,
822
+ "--model", displayName,
822
823
  "--model-display-name", displayName,
823
824
  "--bench-name",
824
825
  ...(benchNames !== null ? benchNames : [benchParts.join("/")]),
package/package.json CHANGED
@@ -1,43 +1,52 @@
1
- {
2
- "name": "dsh-livebench-panel",
3
- "version": "0.2.16",
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.18",
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
+ }