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

dsh-usage-meter-harness

安全与运维JavaScriptMIT

DeepSeek Harness 实时用量、费用与余额计量:官方 API 实时查询余额、计费误差 0.02 元内,分本轮/本次会话/整个模型三级费用台账,实时分色档位 Token 速度,输入框旁弹窗即点即看。

3 Starsfaith1688 更新时间 2026-09-06
访问 GitHub 仓库
dsh-usage-meter-harness 项目预览
dsh-usage-meter-harness 界面截图dsh-usage-meter-harness 界面截图

项目介绍

中文

DeepSeek Harness 实时用量、费用与余额计量:官方 API 实时查询余额、计费误差 0.02 元内,分本轮/本次会话/整个模型三级费用台账,实时分色档位 Token 速度,输入框旁弹窗即点即看。

English

Real-time usage, cost and balance meter for DeepSeek Harness: official-API balance, cost accuracy within ¥0.02, per-turn / per-session / per-model cost ledger, live color-tiered token speed and a docked one-click popup.

项目信息与收录信号

快照 2026-09-11
作者 / 组织
faith1688
仓库
faith1688/dsh-usage-meter-harness
GitHub Stars
3
Forks
0
开发语言
JavaScript
许可证
MIT
最近推送
2026-09-06
Manifest
数据中检测到声明

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

数据评分

60/ 100
维护活跃
97
文档与实用信息
100
生态关注度
17
安装便捷信号
80
项目声明信号
100

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

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

安装与使用

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

dsh plugin --profile web add github:faith1688/dsh-usage-meter-harness

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

项目截图

仓库 README

GitHub 原文

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

dsh-usage-meter-harness

English | 简体中文

A real-time usage / cost / balance meter plugin for DeepSeek Harness (DSH). See tokens, spending and real wallet balance right next to the chat input — for the official DeepSeek models and any custom model registered in DSH.

settings

Install

Prerequisite (methods 1 & 2): the DSH CLI itself runs on pnpm — install it once per machine:
npm install -g pnpm (or corepack enable), then verify with pnpm --version.

Pick one of the three methods. Methods 1 and 2 need pnpm (a one-time machine setup used by the DSH CLI itself): npm install -g pnpm or corepack enable.

Method 1 — npm registry via DSH CLI (needs pnpm)

dsh plugin --profile web add --verbose @faith1688/dsh-usage-meter-harness@latest

(--verbose shows the install progress; drop it if you prefer a quiet install. @latest explicitly requests the newest release — always install this way.)

Method 2 — GitHub via DSH CLI (needs pnpm)

dsh plugin --profile web add --verbose github:faith1688/dsh-usage-meter-harness

(--verbose shows the install progress.)

Method 3 — one-line installer, no pnpm (recommended)

npx -y @faith1688/dsh-usage-meter-harness@latest

One command: installs into the DSH web profile and registers the bundle (idempotent). (@latest explicitly requests the newest release — always install this way.)

Prefer not to use npx? The same logic ships as scripts in the repo:

Windows (cmd):

curl -fsSL https://raw.githubusercontent.com/faith1688/dsh-usage-meter-harness/main/scripts/install.cmd -o "%TEMP%\um-install.cmd" && "%TEMP%\um-install.cmd"

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/faith1688/dsh-usage-meter-harness/main/scripts/install.sh | sh

The script does everything for you: cd into the DSH web profile, installs the package with visible progress, and registers the bundle in dsh.profile.bundles (idempotent — safe to re-run after upgrades).

Note: Method 3 uses plain npm and does not do pnpm coordination. If your
profile is managed with pnpm (the default for dsh plugin), prefer Method 1.

After any method: restart dsh web.

Updating

Two cases — pick the right one:

Fresh install (never had the plugin), or the npx method: just run the install command; it always fetches the latest release.

Upgrading an existing install (plugin already present): the profile's package.json / pnpm-lock.yaml may be pinned to an old version, and a bare add can be skipped by pnpm as "already satisfied". Always ask for the new version explicitly:

dsh plugin --profile web add @faith1688/dsh-usage-meter-harness@latest

or, from inside the profile directory (~/.dsh/profiles/web):

pnpm update @faith1688/dsh-usage-meter-harness

(You may also pin an exact version, e.g. [email protected].)

If your package.json binds the plugin via a file: path or a pin that add won't override (you see Already up to date / downloaded 0), use the one-line installer instead — it always requests @latest, which rewrites the binding to ^<latest> and upgrades in a single command:

npx -y @faith1688/dsh-usage-meter-harness@latest

(Re-running this same command is the permanent update path: it is idempotent and upgrades regardless of whether you currently bind via file:, a pin, or ^.)

After updating: restart dsh web (or reload the browser page). Note that restarting alone never fetches a new version — it only reloads what is already in node_modules.

Why this never duplicates the mount entry and never touches your config:

  • The mount entry lives inside the package (cordis.patch.yml, the

dsh.bundle mechanism). Every release ships its own complete entry; DSH reads it from the installed package at startup — installing a newer package automatically brings the correct entry with it.

  • Installers only edit the profile's package.json (dsh.profile.bundles,

de-duplicated) and node_modules. They never write the profile-root cordis.patch.yml, so anything you added there yourself (or your other plugin configs) stays untouched.

  • A duplicate mount entry can only happen if you manually added the same id to

the profile-root cordis.patch.yml yourself — the installers never do that.

Features

Conversation usage card (next to the chat input)

FeatureDescription
Live costSession cost in CNY or USD, updated every step
Token breakdownInput (miss) / cache hit / cache write / output
Turn usage panelPer-turn subtotals with unit prices tagged peak/off-peak
Token speedLive tokens/s while streaming; resets cleanly when output stops or tools run
Cache hit rateShare of cached tokens for the session
Account balanceReal DeepSeek wallet balance; local-ledger estimate for other providers
Budget & remainingSet a budget, see used / remaining / over-budget

Billing engine

FeatureDescription
6 billing templatesBasic · Cache hit/miss · Peak/off-peak (DeepSeek official hours) · Cache write+hit · Combined input+output · Batch half price
Custom price rowsUp to 4 user-defined rows; the popup mirrors your setup verbatim
Peak/off-peak billingBeijing-time weekday + hour windows, cross-midnight supported; each request is billed by its start time
Per-model pricingCurrency (CNY/USD), unit prices and balance per model
Shared provider walletOne balance shared by all models of a provider — single checkbox
Official price prefillDeepSeek official models come pre-filled with official prices and the official peak schedule
Built-in price table137 models across 19 vendors bundled; optional LiteLLM-shaped remote price source
Exchange rateUSD→CNY fetched automatically, refreshed when older than 24 h
Legacy migrationOld manual initial-balance/top-up settings migrate into provider wallets automatically

Settings & UX

FeatureDescription
Bilingual UI中文 / English switch at the top-right of the settings page; applies everywhere instantly (popup included). Display only — saved data never changes
In-use lockWhile a model is generating, its editor is locked so a running turn keeps consistent prices
WYSIWYG popupUsage-card rows are copied verbatim from your template selection
Non-intrusiveStandard DSH cordis plugin; touches no other plugin and no DSH core files

Supported models

  • DeepSeek official models (deepseek-chat, deepseek-reasoner, …): official

prices pre-filled; real wallet balance via API Key.

  • Any custom model registered in DSH (OpenAI-compatible providers, Ollama,

OpenRouter, …): set unit prices and balance yourself; everything else works the same.

Screenshots

Settings page:

settings

Usage popup:

popup

Configuration

All settings live in the usage-meter settings namespace and can be edited directly in the plugin UI:

KeyTypeDefaultDescription
currencystringCNYDisplay currency
budgetnumber–Session budget; shows "remaining" when set
priceSourceUrlstring–LiteLLM-shaped price JSON URL; optional
refreshIntervalMsnumber4 hPrice / balance / rate refresh interval
deepseekApiKeysecret–Only used to query the DeepSeek balance (stored AES-encrypted; never read from the DEEPSEEK_API_KEY env var)

Compatibility

  • Node.js ≥ 22.
  • Peer versions track the supported DSH releases (see package.json); updating

DSH does not break the plugin, and it never modifies your other plugins.

License

MIT © faith1688

Privacy

  • The plugin makes no telemetry and no analytics calls.
  • Network requests are limited to two optional ones: querying the **official

DeepSeek balance API** with the API key you configure yourself, and fetching a public USD→CNY exchange rate. Nothing else leaves your machine.

  • The source is MIT-licensed and fully readable on GitHub.

使用前核对

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

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

同类项目