marisa-4219/deepseek-harness-quota-monitor

Plugin插件 Native原生 ⭐ 7 MIT Usage & Cost用量与计费

DeepSeek Harness 多供应商额度监控插件:余额型 API 查询 + 限额型本地用量计量,侧边栏实时卡片 + 可视化配置。

Project Overview项目介绍

This is a native quota monitoring plugin built exclusively for DeepSeek Harness (DSH), designed to track the remaining balance and token usage of multiple LLM API providers. It supports two quota models: balance mode that actively queries provider APIs, and limit mode that performs local sliding window usage metering. The recommended installation method is pulling from the npm registry via the DSH CLI: run dsh plugin --profile web add deepseek-harness-quota-monitor, then restart the DSH web service to complete the installation. After installation, you need to confirm the package name is added to the dsh.profile.bundles array in your profile’s package.json, otherwise the plugin will not load correctly.

This plugin is built for DSH users who work with multiple LLM API providers and want to avoid unexpected service outages or overbilling. It automatically discovers registered providers with pre-built configurations, including DeepSeek Official, OpenCode GO, new-api, and sub2api, so users can add a supported provider in one click without manual parameter filling. For providers without pre-built configurations, users can manually add custom entries and set their own quota windows, refresh intervals, and low balance thresholds. Each configured provider can be enabled or disabled individually at any time, with changes taking effect immediately.

The plugin is released under the open-source MIT license, so it is free to use, modify, and distribute per the license terms. There are several known limitations users should be aware of before first use: local usage metering only counts requests that are routed through DSH, so usage from other tools using the same API key will not be counted. Rate limit event information is currently only collected from 429 error responses, as the LLM abstraction layer does not expose rate limit headers. When the sidebar is collapsed, only the most urgent status of the default provider is displayed.

这是专为DeepSeek Harness开发的额度监控原生插件,用于监控多LLM供应商的账户余额与token用量,支持两类额度模型:一类是主动调用供应商API查询的余额型,另一类是基于本地滑动窗口统计的限额型。插件在侧边栏提供实时卡片展示数据,支持通过「设置→插件」页面进行可视化配置,适配DSH 0.1.5-rc.1及以上版本的插件接口。

面向需要同时使用多个LLM供应商的DSH用户,帮助追踪各供应商的额度使用情况,避免突发额度耗尽或超额扣费。插件支持自动发现系统内已注册的官方供应商,DeepSeek、OpenCode GO等热门供应商都提供预设配置,选中即可一键填充完整参数,仅需填入用户自己的API密钥。每个供应商都支持单独启用或禁用,配置灵活。

本插件采用MIT开源许可证,可免费使用,安装方式推荐通过npm registry拉取,执行dsh plugin --profile web add deepseek-harness-quota-monitor后重启DSH服务即可使用。安装后需确认包名已添加到profile的dsh.profile.bundles列表中,否则插件无法正常加载。插件存在部分已知边界,比如本地计量仅统计经过DSH的请求。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 7 stars - very few users, little community feedback星标只有 7,几乎没人在用,遇到问题缺少社区反馈
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 deepseek-harness-quota-monitor

把 marisa-4219/deepseek-harness-quota-monitor 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

deepseek-harness-quota-monitor

DeepSeek Harness 多供应商额度监控插件。侧边栏实时卡片 + 「设置 → 插件」可视化配置,支持余额型(主动查询供应商 API)与限额型(本地滑动窗口计量)两类额度模型。

本版本适配 DSH 0.1.7-alpha.1 起的插件接口:设置 schema 改为导出 Config 声明式注册(不再有 installSection),配置页注册到插件管理页的 plugins.item 插槽,配置改写入 profile 的 cordis.patch.yml(settings.yaml 已被上游移除)。旧版(0.1.5-rc.1 及更早)的 installSection / settings.plugin.item 接口在本版本已不适用。

特性

  • 余额型:主动查询供应商余额/用量 API(地址 + API Key 引用 + JS 解析器),如 DeepSeek 官方 GET /user/balance
  • 限额型:本地滑动窗口用量统计(5h / 7d / 1m 等,按 llm/stream 瀑布采集真实 token 用量,持久化到 $DSH_HOME/storages/quota-monitor-usage.jsonl),对照配额上限显示剩余
  • 今日已用:自然日桶,跨重启保留;主数字含缓存(输入 + 输出 + 缓存读),附输入/输出/缓存分项与缓存命中率(3 位小数)
  • 翻转卡片:点击今日已用区翻转 3D 卡片,查看输入/输出/缓存三线小时折线图(平滑曲线、峰值标注)
  • 自动发现:有确定预设的官方供应商(DeepSeek、OpenCode GO、Command Code 等)自动进入监控;无预设的自建网关不自动发现,需手动添加
  • 逐个启用/禁用:自动发现与手动配置的每个供应商都可单独暂停/恢复监控(即时生效,配置保留)
  • 预设一键添加:deepseek-official / opencode-go / commandcode / new-api / sub2api 等整体方案,选中即填好 kind/url/解析器
  • 金额按供应商实报:供应商在 usage 里返回价格才显示金额(无价格表、不推断),按模型明细展示
  • 供应商显示名:卡片打印人类可读的名字(路由声明的 displayName,或配置的 label),而不是 commandcode 这类路由 id;两者在悬停提示里同时可见
  • 刷新有反馈:点卡片立刻出现转圈指示并短暂锁定按钮,不再依赖一闪而过的顶部横幅
  • 消耗动画:每次模型调用从卡片飘出一个 -N 并轻微抖动,连续消耗连续抖;设置页可关闭
  • 限流事件:模型请求被 429 限流时记录 retry-after,随快照返回
  • 主题适配:明/暗色均使用产品 token,暗色下更贴近页面背景

UI 两处:侧边栏设置按钮上方的圆角卡片(sidebar.footer.action,点击刷新,5 分钟自动轮询)、插件管理页「Plugins」中的额度监控页(plugins.item,仅当 Host 正在提供 quota-monitor 命名空间时注册)。

安装

从 npm registry 安装(推荐):

dsh plugin --profile web add deepseek-harness-quota-monitor
# 然后重启 dsh web 服务

dsh plugin 会把参数转发给 pnpm,包名会从 npm registry 拉取。若本机 pnpm 不在 PATH 导致失败,可用 corepack 手动安装(效果相同,之后需手动把包名追加进 profile package.json 的 dsh.profile.bundles):

corepack pnpm --dir "$DSH_HOME/profiles/web" add deepseek-harness-quota-monitor

开发模式(本地目录安装,改动即时生效):

dsh plugin --profile web add <本仓库路径>

安装后 profile 的 package.json 应形如:

{
  "dependencies": { "deepseek-harness-quota-monitor": "link:<本仓库路径>" },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "deepseek-harness-quota-monitor"   // ← 必须在这一层里,否则插件不会被挂载
      ],
      "patchReload": "live"
    }
  }
}

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-harness-enterprise 下一个 Next dsh-plugins-store →