A right-side session stats panel showing average cache-hit rate, session cost, runtime, request count, cumulative tokens and account balance.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:a1113622001/dsh-session-stats-panel
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A DeepSeek Harness (cordis) client plugin that shows a stats panel for the current session on the right side of the page:
| Metric | Description |
|---|---|
| Average hit | Share of cache-hit input tokens (cacheReadTokens / billed input, accumulated across whole-round logs, 3-decimal precision) |
| Session cost | Accumulated cost estimated with DeepSeek official pricing (DeepSeek models only, see pricing below) |
| Remaining balance | DeepSeek account balance (read by the host route; the key stays server-side; refreshes every 2 minutes) |
| Runtime | Accumulated LLM + tool execution time |
| Requests | Number of closed model steps (steps, i.e. model request count) |
| Cumulative tokens | Input (miss) + cache-read + cache-write + output, shown with thousands separators (e.g. 3,251,237) |
The panel registers in the framework's shell.overlay layer (a list slot — it stacks rather than replaces any existing UI), is pinned to the right edge of the page, and collapses to a small pill when you click the "–" in the title bar.
Data sources
tokenUsage(token-meter projection) → cumulative tokens, average hit, cost;sessionStats(session-stats projection) → request count, runtime;- The current model comes from the session models RPC (
session.models, same source as the model picker — chat nodes carry no model field themselves); - The remaining balance comes from the route
/plugins/session-stats-panel/balanceregistered by this plugin's host half (the server resolvesDEEPSEEK_API_KEYthrough the credentials service and calls the DeepSeek balance API; the key is never sent to the browser).
Pricing
Cost is estimated in the browser with a price table built into the plugin (CNY / million tokens, fetched from the DeepSeek official pricing page; cache writes are billed at the cache-hit price).
Official peak/off-peak pricing rules (peak windows are weekdays only, Beijing time 09:00–12:00 and 14:00–18:00; everything else — including all of Saturday and Sunday — is off-peak, priced at half the peak rate):
| Model | Period | Cache-hit input | Cache-miss input | Output |
|---|---|---|---|---|
| deepseek-flash | off-peak | 0.02 | 1 | 4 |
| deepseek-flash | peak (weekday peak hours) | 0.04 | 2 | 8 |
| deepseek-v4-pro | off-peak | 0.15 | 4.5 | 13.5 |
| deepseek-v4-pro | peak (weekday peak hours) | 0.30 | 9.0 | 27.0 |
CNY per million tokens; cache writes are billed at the cache-hit price.
deepseek-flash (DeepSeek-V4.1-Flash) and deepseek-v4-pro (DeepSeek-V4-Pro-0813) are the current official ids. The retired deepseek-v4-flash / deepseek-v4-flash-vision-exp ids are still callable — requests are served by DeepSeek-V4.1-Flash and billed at Flash prices — so they share the Flash row. Versioned ids (deepseek-v4-pro-0813, deepseek-v4-flash-0731) resolve to their family rather than the fallback, and any other deepseek-* model falls back to the Flash price.
The plugin auto-selects the price tier at "view time" (peak / off-peak; hover the cost row to see the tier). Session cost is an estimate: cumulative tokens cannot be sliced by time, so the whole amount is priced with whichever tier is active at view time.
Installation (web profile)
Via the bundle manifest (recommended)
dsh plugin add github:a1113622001/dsh-session-stats-panel
The plugin ships a cordis.patch.yml bundle patch, so the plugin add command installs it as an installable plugin that activates automatically (no manual loader row needed).
Manually from a local directory
Install the dependency (equivalent to
dsh plugin --profile web add <this directory>):corepack pnpm --dir "$env:USERPROFILE\.dsh\profiles\web" add "C:\Users\baiyec\Desktop\Harness\plugins\dsh-session-stats-panel"Append a loader row to
$env:USERPROFILE\.dsh\profiles\web\cordis.patch.yml:- insert: - id: session-stats-panel name: 'dsh-session-stats-panel'Restart the web service (
dsh web). Afterwards, edits tolib/client.jsare picked up by client-hot-reload (no browser refresh needed).
Project structure
lib/index.js— host half (registers the/plugins/session-stats-panel/balanceroute that resolvesDEEPSEEK_API_KEYserver-side);lib/client.js— browser half (window.__ModuleLoader__bundle format, registers theshell.overlayslot);lib/pricing.js— pure pricing/derivation/formatting logic, kept dependency-free so it can be unit-tested (mirrors the in-bundle constants inlib/client.js);cordis.patch.yml— bundle patch sodsh plugin add github:...installs and activates the plugin;package.json— declaresdsh.client.platform: "web"; client-modules scans and serves/plugins/dsh-session-stats-panel/client.js.
Development
npm test # run the pricing/derivation unit tests
node --check lib/*.js # syntax-check every JS file
See CONTRIBUTING.md for house rules.
License
Links
More in this category
bowenliang123/dsh-context★ 1880
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 375
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 245
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 204
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 170
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
PolinniZhong/dsh-personal-center★ 118
Personal center for DeepSeek Harness: cross-session usage statistics, per-model cost estimation, global custom instructions, a global font-size adjuster, a data-driven desktop pet with bitmap & vector skins, and a conversation status overview, all local and offline.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.