Horizon215/dsh-plugins--packages-token-stats ↗★ 1
@your-scope/dsh-token-stats
Token usage & cost stats for the DeepSeek Harness web UI: per-turn usage chips, provider price presets, cross-session aggregate dashboard and a cumulative usage-trend chart
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Horizon215/dsh-plugins#c84fe501557dc3de34d0655055154358916b3153&path:packages/token-stats说明文档
阅读完整 README ↗@your-scope/dsh-token-stats
Token usage & cost stats for the DeepSeek Harness (dsh) web UI.
DeepSeek Harness Web UI 的 Token 用量与成本统计插件。
Screenshots / 截图见仓库根 README:https://github.com/Horizon215/dsh-plugins
English
Features
- Per-turn usage chip — under each completed turn:
input · output | cache hit | duration | ≈cost - Aggregate dashboard (Settings → Usage & Cost) — cross-session token totals, cache-hit-rate progress bar, estimated total cost
- Usage trend chart — cumulative area chart with Today (hourly) / Last 7 days / Last 30 days ranges, growing live as turns complete
- Price presets — built-in list prices for DeepSeek V4-Flash / V4-Pro / Kimi K3 (CNY & USD); pick one or edit the three rates manually, every display reprices live
Install
From source (npm package coming soon):
git clone https://github.com/Horizon215/dsh-plugins.git
cd dsh-plugins
pnpm install && pnpm build
dsh plugin --profile web add file:./packages/token-stats
Restart dsh web. The package declares dsh.bundle, so it joins the profile automatically — no config edits.
Notes
- Requires dsh ≥
0.1.0-rc.5(verified on rc.5 / rc.6), web UI only - All stats live in browser localStorage; nothing is uploaded
- Costs are estimates from configurable list prices — your provider invoice wins
Uninstall
dsh plugin --profile web remove @your-scope/dsh-token-stats
中文
功能
- 每轮用量条:每轮对话末尾显示
输入 · 输出 | 缓存命中率 | 耗时 | ≈成本 - 汇总仪表盘(设置 → 用量与成本):跨会话累计 tokens、缓存命中率进度条、估算总成本
- 使用趋势图:累计用量面积图,支持 今天(按小时)/ 近 7 天 / 近 30 天 切换视角,随对话动态增长
- 价格预设:内置 DeepSeek V4-Flash / V4-Pro / Kimi K3(人民币与美元)刊例价,可一键选用或手动微调;改价后所有展示实时重算
安装
从源码安装(npm 包稍后发布):
git clone https://github.com/Horizon215/dsh-plugins.git
cd dsh-plugins
pnpm install && pnpm build
dsh plugin --profile web add file:./packages/token-stats
装完重启 dsh web 即可(插件声明了 dsh.bundle,会自动装配进 profile,无需手动改配置)。
说明
- 需要 dsh ≥
0.1.0-rc.5(在 rc.5 / rc.6 上验证通过),仅 Web UI - 所有统计数据仅存浏览器 localStorage,不上传任何服务器
- 成本为基于可配置刊例价的估算值,以供应商账单为准
卸载
dsh plugin --profile web remove @your-scope/dsh-token-stats
License
MIT