deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
为 DeepSeek Harness(dsh)Web 界面打造的两个实用插件:
截图提示:可自行将面板截图放入
docs/api-meter.png后显示在这里。
<cwd>/data/refresh.log 供排查git clone https://github.com/Adachi-Hougetsu/dsh-api-tools.git
cd dsh-api-tools
# 逐个安装四个插件包(顺序:先 host 再 UI)
dsh plugin --profile web add ./dsh-api-meter
dsh plugin --profile web add ./dsh-ui-api-meter
dsh plugin --profile web add ./dsh-refresh
dsh plugin --profile web add ./dsh-ui-refresh
--profile web换成你实际使用的 profile 名;没有指定过 profile 时,默认 web 界面使用web。
安装后重启 dsh web:
插件升级前(旧版本没有按会话统计)的调用记录,会在首次启动时自动回算:
自动读取 ~/.dsh/sessions 下的会话日志,重建按会话的用量明细
无需任何手动操作,日志里会显示 backfilled N historical calls
如果你希望强制重建,可以手动运行:
node dsh-api-meter/scripts/backfill-sessions.mjs
(需 dsh web 处于停止状态;脚本会先备份现有 usage.json)
插件数据保存在 ~/.dsh/storages/api-meter/usage.json,可在 profile 的 cordis.patch.yml 中覆盖:
- id: api-meter
config:
persistIntervalMs: 30000 # 快照保存间隔(毫秒),0 关闭定时保存
persistPath: 'C:\path\to\usage.json' # 快照文件路径
sessionsRoot: 'C:\path\to\sessions' # 会话日志目录(回算用)
- id: refresh
config:
port: 3080 # 服务端口(缺省自动从启动参数解析,再回退 3080)
killDelayMs: 800 # 响应后退出延迟
timeoutMs: 30000 # 重启健康探测超时
logPath: 'C:\path\to\refresh.log' # 重启序列日志(缺省 <cwd>/data/refresh.log)
dsh plugin --profile web remove dsh-ui-refresh
dsh plugin --profile web remove dsh-refresh
dsh plugin --profile web remove dsh-ui-api-meter
dsh plugin --profile web remove dsh-api-meter
重启后历史会话数据没出现? 确认 dsh web 完整重启过一次(首次启动时自动回算),并检查日志中是否有 api-meter: backfilled 字样。
总量与会话明细数字不一致? 总量按 provider/model 统计,会话明细按对话统计;同一调用会计入两者,但旧版本无会话信息的调用只计入总量。
刷新按钮点击后页面没反应? 确认 dsh-refresh 已安装;若重启后页面仍打不开,
查看 <cwd>/data/refresh.log 中的重启序列结果(拉起命令 / 端口状态 / 健康探测)。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。