izz-BLUE/dsh-deepseek-usage-dashboard
DeepSeek Harness Web UI插件,用于日常API令牌用量、费用估算和余额监控。
Project Overview项目介绍
This is a native installable Web UI plugin built exclusively for DeepSeek Harness (DSH). It tracks daily DeepSeek API token usage for your DSH instance, estimates daily API costs based on a user-configurable per-model pricing table, and monitors your DeepSeek account balance. To install the plugin, run dsh plugin --profile web add https://github.com/izz-BLUE/dsh-deepseek-usage-dashboard.git from your CLI, then restart dsh web to activate it. After installation, you will see an "API Usage" entry in your DSH sidebar, and a daily stats bar below the conversation composer. It is developed only using the official @deepseek-ai/* NPM SDK, and does not modify any core DSH source code.
The plugin only counts valid DeepSeek traffic that matches two conditions: the provider route ID is deepseek-official (configurable) and the request is sent to api.deepseek.com, so custom gateways will not pollute your usage stats. All usage is counted based on the Asia/Shanghai natural day, and only the final usage of a streaming request is stored to the database. It uses SQLite for persistent, idempotent storage with unique constraints that prevent duplicate counting even after restarts or projection replays. Corrupted database files are automatically moved out and rebuilt, so you do not need to manually fix them. Usage data is stored at ~/.dsh/deepseek-usage/usage.db by default.
Pricing uses a time-aware schedule system that assigns cost based on the start time of each request, and historical requests are never recalculated when you add or update pricing schedules. All cost estimates are clearly labeled as non-official estimates, and only the official DeepSeek bill is authoritative for billing purposes. The plugin follows strict security rules: your DeepSeek API key only exists in the host process, never enters the browser, logs, or request parameters. The plugin is open source under the permissive BSD-3-Clause license. It supports both Chinese and English locales out of the box.
这是一个可直接安装的DeepSeek Harness原生Web UI插件,核心功能是统计DSH实例每日DeepSeek Token用量,根据用户可编辑的分模型价格表估算当日费用,还支持监控DeepSeek账户余额。数据通过仪表盘、对话编辑器底部统计行和设置卡片展示,仅依赖官方@deepseek-ai/* NPM SDK开发,不修改DSH源码,全程不调用任何LLM接口。
统计范围严格限定为路由ID是deepseek-official且请求地址为api.deepseek.com的流量,自定义网关不会污染统计结果。用量统计按北京时间自然日划分,仅在最终用量到达后落库,采用SQLite持久化存储,幂等约束保证不会重复累计,重启后数据完整保留。
费用估算采用分时段分时定价,每个请求按发起时间计价,历史请求不会被新价格重算,所有金额明确标注为估算费用,仅供参考,不替代官方账单。API密钥仅存在于Host端进程,不进入浏览器、日志或请求参数,遵循严格的安全规范,采用BSD-3-Clause许可证开源。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-deepseek-usage-dashboard(izz-BLUE/dsh-deepseek-usage-dashboard)
仓库:https://github.com/izz-BLUE/dsh-deepseek-usage-dashboard
本站详情页:https://www.yhbd.top/plugins/izz-blue-dsh-deepseek-usage-dashboard/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 BSD-3-Clause · ⭐ 2 · 最近提交 2026-08-17 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add https://github.com/izz-BLUE/dsh-deepseek-usage-dashboard.git
把 izz-BLUE/dsh-deepseek-usage-dashboard 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-deepseek-usage-dashboard
简体中文 | English
一个独立、可安装的 DeepSeek Harness(DSH)Web UI 插件,用于:
- 从会话日志统计本 DSH 实例每日 DeepSeek Token 用量(仅精确 usage:缓存命中/未命中输入、输出、推理);
- 基于用户可编辑的分模型价格表估算今日费用;
- 监控 DeepSeek 账户余额(仅 Host 端调用,默认每 10 分钟刷新,支持手动刷新);
- 在 Web GUI 中以仪表盘、composer 底部统计行与设置卡片展示。
效果预览

仅基于官方 @deepseek-ai/* NPM SDK 开发;不修改任何 DSH 源码;通过 cordis.patch.yml + profile 插件机制安装。插件全程不调用任何 LLM 接口:统计、刷新、展示、余额查询零模型调用,空闲运行与刷新页面产生的 Token 为 0。
功能
- 每日统计(Asia/Shanghai 自然日):缓存命中输入、缓存未命中输入、输出、推理(存在时)、输入合计、Token 合计、请求数、失败请求数、缓存命中率。
- 只统计真实的 DeepSeek 流量:provider 路由为
deepseek-official(可配置)且有效 base URL 主机为api.deepseek.com——自定义网关不会污染统计。 - 流式安全:只有最终 usage 到达才落库;流式估算值从不写入每日精确统计。
- 幂等 + 持久化:SQLite(Node 24 运行时内置
node:sqlite),UNIQUE (session_id, turn, step)约束 +INSERT OR IGNORE——投影重放、流式 usage 重复到达、重启后重扫、重复提交均不会重复累计;跨重启保留;损坏文件自动移出并重建。 - Decimal 金额:费用以整数最小单位(1e-6 币种单位)BigInt 累计,禁止浮点直接累计。时间感知计价:请求按开始时间选择生效的 PricingSchedule(
effectiveFrom <= requestTime,含边界),支持分时段 band(如 peak/off-peak 窗口,start 含 / end 不含、可跨午夜);历史请求不会被后来新增的价格计划重算。未知模型明确记为「未计价」(不静默套用兜底价),显式配置*兜底仍可用;界面显示价格版本、更新时间与计价来源,所有金额明确标注为「估算费用,非官方账单」。 - 余额:仅 Host 端
GET https://api.deepseek.com/user/balance(base URL 固定、10 秒超时、401/402/429/5xx/超时/畸形响应分别处理);失败时保留最后一次成功数据并显示 stale 状态;支持手动刷新。API Key 绝不进入浏览器、日志或请求参数。 - Host HTTP 接口:
/api/deepseek-usage/stats与/api/deepseek-usage/refresh,复用 DSH 浏览器信任篱笆(Host / Origin / Sec-Fetch-Site 校验,按官方 api-request-trust 语义实现)+ loopback 套接字校验;余额明细仅限 loopback;POST 要求application/json;限制请求体大小;不提供任意 URL/文件/命令代理。 - Web UI:侧边栏「API 用量」入口;仪表盘(今日卡片、缓存命中/未命中对比条、命中率、今日估算费用、余额(总额/赠送/充值)、最近 7 天趋势、最后更新时间、数据来源说明);
conversation.composer.dock紧凑统计行(今日:命中 X · 未命中 X · 输出 X · 估算 ¥X · 余额 ¥X);完整中英文 locale;仅使用 DSH CSS Token(适配亮/暗主题);不使用dangerouslySetInnerHTML。
安装
dsh plugin --profile web add https://github.com/izz-BLUE/dsh-deepseek-usage-dashboard.git
重启 dsh web 后,侧边栏出现「API 用量」入口,composer 下方出现今日统计行。
本地开发可安装仓库检出目录:
dsh plugin --profile web add link:<本仓库路径>
如需纳入
dsh-web-ui-all聚合包:把本包追加到packages/dsh-web-ui-all/aggregate.yml(patchFrom与deps两段),再运行node scripts/aggregate.mjs。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
MeteorNOX/DeepSeek-Balance-Whale-Widget
edison7009/EchoBird
Han-1413141/dsh-cost-meter
wssfk12138/dsh-damage-pulse
zh667/TokenLedger
edonadei/caliper
Ychris12138/dsh-usage-stats
Aisland-SJL/dsh-usage