AI Agent Hub
Back to plugins
🧠

dsh-usage-stats

Memory Updated 2026.09.16

Run the following command in DeepSeek Harness:

dsh plugin install lengduan/dsh-usage-stats

Paste the following prompt into your AI chat to install this plugin:

Install dsh-usage-stats: source at https://github.com/lengduan/dsh-usage-stats — run dsh plugin install lengduan/dsh-usage-stats inside a DeepSeek Harness Web profile, then restart dsh web; a Usage tab appears at the top of the session view.

About this plugin

DSH has no built-in cross-session usage view: the moment you delete a conversation, its token spend vanishes. dsh-usage-stats writes every model call's input, output, cached-hit, and cached-write tokens into a standalone local SQLite ledger. Deleting sessions or clearing their logs leaves the already-recorded numbers intact, turning ephemeral call data into a persistent, auditable record.

The core design is bucketing and separation. Records are grouped by day, provider, and model, with filters for today, this week, a specific date, or the full history. Two scopes let you isolate primary chat calls from DSH internal calls (compression, summarisation, title generation). Three ingestion paths—session/event for chat, llm/stream for internal work, and an incremental backfill of pre-install history—share a composite primary key with INSERT OR IGNORE, so no call is double-counted. The API is loopback-only, there are no outbound requests, no configuration knobs, and no secrets; everything lives in one or two files under $DSH_HOME.

It is for anyone who wants to verify token consumption per day or per model and needs a clean split between user-facing conversations and DSH's own background work. It is not for cost calculation (raw tokens only, no unit-price multiplication), multi-machine roll-ups, or TUI / headless environments.

Use Cases

  • Check daily token usage across providers and models in one table
  • Separate primary chat calls from DSH internal calls (compression, summarisation, title generation) in the usage view
  • Recall historical token records from the local ledger even after sessions are deleted

Best For

  • DSH users who need to verify token consumption by day or model
  • Developers who want to track chat vs. internal DSH calls separately
  • DSH Web GUI users who care about persistent, outlive-the-session usage records