DeepSHPlugins
dsh-usage-guard 项目预览
GITHUB / COMMUNITY PROJECT

dsh-usage-guard

安全与运维JavaScriptMIT

用量统计面板:静默按模型采集 token、活跃热力图、趋势图、费用估算与每日超限守卫。

1 Starshb-degithub 更新时间 2026-08-20
访问 GitHub 仓库
dsh-usage-guard 项目预览

项目介绍

中文

用量统计面板:静默按模型采集 token、活跃热力图、趋势图、费用估算与每日超限守卫。

English

Usage statistics panel: silent per-model token collection, activity heatmap, trend charts, cost estimation and daily-limit guard.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
hb-degithub
仓库
hb-degithub/dsh-usage-guard
GitHub Stars
1
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-20
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

54/ 100
维护活跃
85
文档与实用信息
100
生态关注度
9
安装便捷信号
100
项目声明信号
100

近 22 天仍在更新;README 含完整安装与使用说明;关注度尚低(1)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add dsh-usage-guard

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-usage-guard

English | 中文

Usage statistics panel for DeepSeek Harness (DSH) Web GUI — silent background collection, per-model analytics, cost estimation and a daily-limit guard.

Features

  • Silent collection — hooks session events, folds every assistant message's token usage into daily buckets per provider × model; survives restarts, backfills from session logs on first run
  • Dashboard in Settings → Usage: six stat cards (tokens, sessions, messages, active days, current streak, top model), a GitHub-style activity heatmap (continuous year view, weekday/month labels, hover detail card per day), a multi-series line/area trend chart (input / output / cache hit / cache write / cost, dual axes, 7d/30d switch) and a model-usage donut
  • Cost estimation — configurable per-model prices (input / output / cache read / cache write per 1M tokens); built-in DeepSeek list prices; models without a price are excluded from cost instead of guessed
  • Daily-limit guard — optional daily token / cost caps; warn mode shows a global banner, block mode aborts over-limit LLM requests before they hit the network
  • Bilingual (zh/en), follows the DSH theme tokens, zero external runtime dependencies

Install

From the DSH plugin market (Settings → 插件市场), or:

dsh plugin --profile web add dsh-usage-guard   # npm
dsh plugin --profile web add <github-url>      # or from GitHub

Restart dsh web, then open Settings → 使用统计.

Develop

pnpm install
pnpm build   # tsdown + wrap-client → dist/client.js (host loads host/, browser loads dist/)
pnpm test    # vitest, incl. an SSR smoke test that renders all charts from real data

License

MIT


中文

DeepSeek Harness(DSH)Web GUI 的用量统计面板——后台静默采集、按模型分析、费用估算、每日超限守卫。

功能

  • 静默采集——挂钩会话事件,把每条助手消息的 token 用量折叠进 天 × 提供商 × 模型 桶;重启不丢,首次运行自动从会话日志回填
  • 仪表盘(设置 → 使用统计):六张统计卡(tokens、会话数、消息数、活跃天数、连续天数、最常用模型)、GitHub 风格活跃热力图(连续年度视图、星期/月份标注、逐日悬浮详情卡)、多序列折线/面积趋势图(输入/输出/缓存命中/缓存创建/成本,双轴,7/30 天切换)、模型用量环形图
  • 费用估算——按模型配置价格(每 1M tokens 的 输入/输出/缓存读/缓存写);内置 DeepSeek 刊例价;未配置价格的模型不计费而不是瞎猜
  • 每日超限守卫——可选每日 token / 费用上限;warn 模式全局横幅提醒,block 模式在请求发出前直接拦截
  • 中英双语,跟随 DSH 主题令牌,零外部运行时依赖

安装

插件市场(设置 → 插件市场)一键安装,或:

dsh plugin --profile web add dsh-usage-guard   # npm
dsh plugin --profile web add <github 地址>      # 或从 GitHub

重启 dsh web,打开 设置 → 使用统计。

许可

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目