marisa-4219/deepseek-harness-quota-monitor ↗★ 0
deepseek-harness-quota-monitor
Multi-provider quota monitor for DeepSeek Harness: balance type (query + JS parser) and window type (local sliding-window metering). Sidebar widget + settings section.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:marisa-4219/deepseek-harness-quota-monitor说明文档
阅读完整 README ↗deepseek-harness-quota-monitor
DeepSeek Harness 多供应商额度监控插件。侧边栏实时卡片 + 设置页可视化配置,支持余额型(主动查询供应商 API)与限额型(本地滑动窗口计量)两类额度模型。
特性
- 余额型:主动查询供应商余额/用量 API(地址 + API Key 引用 + JS 解析器),如 DeepSeek 官方
GET /user/balance - 限额型:本地滑动窗口用量统计(5h / 7d / 1m 等,按
llm/stream瀑布采集真实 token 用量,持久化到$DSH_HOME/storages/quota-monitor-usage.jsonl),对照配额上限显示剩余 - 今日已用:自然日桶,跨重启保留;主数字含缓存(输入 + 输出 + 缓存读),附输入/输出/缓存分项与缓存命中率(3 位小数)
- 翻转卡片:点击今日已用区翻转 3D 卡片,查看输入/输出/缓存三线小时折线图(平滑曲线、峰值标注)
- 自动发现:系统内已注册的 LLM 供应商自动进入监控列表(有预设的自动套预设查询,没有的走本地计量)
- 预设一键添加:
deepseek-official/opencode-go/new-api/sub2api等整体方案,选中即填好 kind/url/解析器 - 金额按供应商实报:供应商在 usage 里返回价格才显示金额(无价格表、不推断),按模型明细展示
- 限流事件:模型请求被 429 限流时记录
retry-after,随快照返回 - 主题适配:明/暗色均使用产品 token,暗色下更贴近页面背景
UI 两处:侧边栏设置按钮上方的圆角卡片(sidebar.footer.action,点击刷新,5 分钟自动轮询)、设置页「额度监控」区块(settings.section)。
安装
从 npm registry 安装(推荐):
dsh plugin --profile web add deepseek-harness-quota-monitor
# 然后重启 dsh web 服务
dsh plugin会把参数转发给 pnpm,包名会从 npm registry 拉取。若本机 pnpm 不在 PATH 导致失败,可用 corepack 手动安装(效果相同,之后需手动把包名追加进 profilepackage.json的dsh.profile.bundles):corepack pnpm --dir "$DSH_HOME/profiles/web" add deepseek-harness-quota-monitor
开发模式(本地目录安装,改动即时生效):
dsh plugin --profile web add
快速开始(零配置)
不配置任何东西时:当前默认供应商(agent-default-model)如果是 deepseek-official,自动用内置余额解析器查询(key 取 DEEPSEEK_API_KEY 凭据引用);其他已注册供应商自动走本地窗口计量(默认窗口 5h / 7d / 1m,无配额上限时只显示用量文本)。
配置
设置页「额度监控」或 profile 的 cordis.patch.yml,同一套 schema: