dsh-usage-ledger
Identified★ 1Local usage ledger that reads this machine's session logs and reports per-day, per-model and per-workspace token consumption, cache hit rate, tool-vs-chat split and estimated cost, with an in-app edit
Usage Ledger(用量账本)
A local-first usage ledger for DeepSeek Harness: mines the session logs on this machine and reports per-day / per-model / per-workspace token consumption, cache hit rate, tool-vs-chat split, and an estimated cost.
本地用量账本插件:从本机会话日志统计每日 / 每模型 / 每工作区的 token 消耗、缓存命中率、工具请求占比,并按配置单价估算开销。
Install
Install it as a DeepSeek Harness plugin from this repository — in the desktop app open the plugin market (插件市场) install field and paste:
github:cp990207/dsh-usage-ledger
Or from a local clone, point the same field at the absolute path of the
checkout. The bundle patch registers the usage-ledger entry with the ledger
dashboard in the header; no extra configuration is needed.
Features
- Daily token & cost overview with today / 7d / 30d / all-time range filters
- Per-model table: requests, uncached input, cache read/write, output, hit rate, cost
- Share pies (tokens & cost), daily cost bar chart
- Workspace breakdown (sessions merged by cwd) and tool-call ranking
- Price configuration: a ⚙ Prices button in the header opens a per-model price editor (input / output / cache read / cache write, per 1M tokens)
How pricing works
- Built-in catalog — the plugin ships with USD list prices for the models it knows (Kimi, GLM, MiniMax, DeepSeek coding-plan models, verified against official pricing pages). Catalog prices follow plugin updates.
- Observed models — model names come from your own session logs, so the editor always lists exactly the models you actually used.
- Custom overrides — any row edited in the ⚙ dialog is persisted into your user profile patch (via the host's config editor) and takes precedence over the built-in catalog. Untouched rows keep following the catalog.
- Fallback — models without any price are estimated at the
*fallback row (default $0.50 in / $2.00 out per 1M tokens) and flagged in the UI.
Saving recomputes every stored cost (the ledger folds events at read time), so historical days are restated under the new prices immediately.
Configuration
The plugin's config is { currency: string, prices: Record<string, {input, output, cacheRead, cacheWrite}> }. Prefer the ⚙ dialog; hand-editing the
usage-ledger row of your profile's cordis.patch.yml works too:
- insert:
- id: usage-ledger
name: 'dsh-usage-ledger'
config:
currency: CNY # display currency label (USD default)
prices:
glm-5.3-flash: { input: 0.15, output: 0.5, cacheRead: 0.03, cacheWrite: 0 }
If the host environment has no config editor, the ⚙ button is hidden and the dashboard explains how to edit the patch instead.
Privacy
All data is computed locally from session logs. The HTTP endpoint listens on the loopback interface only and rejects cross-site requests.
Host requirements
The ⚙ Prices editor needs a host that mounts the configEditor service
(DeepSeek Harness desktop and web both do). On hosts without it the plugin
still folds the session log and serves the dashboard — read-only, priced from
the built-in catalog.
Changelog
- 1.1.1 — Resolve the host config editor through
ctx.fiber.entryandctx.get('configEditor')instead of injected service access, so the price editor is offered wherever the host provides one (and never crashes the save route when it does not). The config schema returns the user's own rows only, so resolved config no longer folds the built-in catalog into the profile patch. Entry lookup accepts any package name ending inusage-ledger.
License
MIT © 2026 白白酱 (cp990207)
Comments
Loading…
Similar plugins
by LAwLi3tCoding
DSH API usage and cost ledger with per-pool reports and CNY/USD display
★ 0
MIT
JavaScript
Sep 22, 2026
dsh plugin --profile web add dsh-api-ledgerby mike-lee0120
Cost dashboard for DeepSeek Harness: aggregates model input/output/cache tokens across all local sessions, prices them with a builtin table (including DeepSeek peak/off-peak), and shows daily trends p
★ 4
JavaScript
Sep 25, 2026
dsh plugin --profile web add dsh-cost-dashboardby fufuf-c
Local token usage and cost dashboard for DeepSeek Harness: four-segment token breakdown (miss/cache-hit/cache-write/output), cache savings estimate against the miss/hit price gap, per-session drill-do
★ 1
↓ 79/wk
MIT
JavaScript
Sep 22, 2026
dsh plugin --profile web add @fufuf-c/dsh-tokenby Ayowait
DSH ??????????:????????????????Token ?????
★ 1
MIT
JavaScript
Oct 23, 2026
dsh plugin --profile web add dsh-usage-insightsby zdt3476
DeepSeek Harness 的 Token 用量与成本看板:按模型/供应商/项目/会话统计调用与缓存命中,接入 OpenRouter 单价估算成本
★ 1
MIT
TypeScript
Oct 23, 2026
dsh plugin --profile web add @zdt3476/dsh-metricsby Ansonfishing
Per-model capability profiling for DSH: turns local session history into per-model dashboards of session counts, tool usage, error rates, and top error signatures, with time-range filters and multi-mo
★ 2
MIT
JavaScript
Aug 29, 2026
dsh plugin --profile web add dsh-cap-profile