LeemanCheung/dsh-token-usage
Persistent token usage records and dashboard for DeepSeek Harness
dsh-token-usage is a local-first token observability, budget, and trajectory audit plugin for DeepSeek Harness. It persistently tracks token consumption across four provider buckets, surfaces trends over time, provides budget controls, displays public-rate cost estimates, and offers aggregated export. On demand it generates per-session usage and conversation trajectory reports via the current DSH model (opt-in AI analysis; all other tracking is local-first). Key capabilities: persistent token statistics (input, output, cache-read, cache-write tokens per provider per session and day); trend charts (daily/weekly/monthly token burn and cost estimates using public DeepSeek API pricing); budget alerts (configurable token and cost caps with in-UI warnings); allowlist privacy (only configured token fields are read; no conversation content surfaces); aggregated export (CSV/JSON for external analysis); session trajectory reports (model generates a structured audit of a selected session's tool use and task flow on request).
Install
dsh plugin --profile web add github:LeemanCheung/dsh-token-usageThis package is distributed as a GitHub source plugin only — it is not published to npm. Install a local checkout alongside your DSH directory with dsh plugin --profile web add github:LeemanCheung/dsh-token-usage (GitHub direct install) or clone and use dsh plugin --profile web add ./dsh-token-usage (local path install). The plugin has a client/UI component built with React and CSS; if you run DSH's pnpm run dev:web watcher in parallel, HMR works; otherwise restart DSH and refresh after a bundle rebuild. Remove with dsh plugin --profile web remove dsh-token-usage.
Compatibility
DeepSeek Harness web profile. Tracks four provider token buckets persistently. Reads token counts from DSH's session/event log (same hook as the official telemetry plugin) — no service injection. AI-powered usage analysis is opt-in and uses the current model; all other data is local-first. Allowlist privacy: only listed token fields are read; no conversation content is processed. Data export: aggregated CSV/JSON.
Details
- Repo: LeemanCheung/dsh-token-usage
- Category: Coding & Development
- Stars: 12
- Version: GitHub source install from LeemanCheung/dsh-token-usage (not published to npm; 2026-08-23)
- Last push: 2026-09-12
- First seen: 2026-08-14
Recent updates
The current README documents: four-bucket token tracking, persistent statistics, trend charts, cost estimates with public DeepSeek pricing, budget controls, allowlist privacy model, opt-in AI trajectory reports, aggregated export, install paths (GitHub direct and local checkout), the HMR development note, and the source-only distribution (not published to npm).
FAQ
- Is it published to npm?
- No — dsh-token-usage is distributed as a GitHub source plugin only. Install with dsh plugin --profile web add github:LeemanCheung/dsh-token-usage or clone locally.
- Does it read my conversation content?
- No — the allowlist privacy model reads only configured token count fields from DSH's session/event log; no conversation text is processed unless you explicitly request an AI trajectory report.
- What token buckets does it track?
- Four provider buckets: input tokens, output tokens, cache-read tokens, and cache-write tokens — tracked per provider, per session, and per day.
Alternatives
bpc-oss/dsh-web-billing · crazywoola/dsh-balance · jelly-000/dsh-balance-monitor