dshbase

Plugin directory / Developer / dsh-cost-tracker

dsh-cost-tracker

Verified · install-tested on dsh yflmq001

✓ Actively maintained Builds on 14 official DSH packages Pure TypeScript

View on GitHub ↗ ← Back to plugin directory

3Stars
0Forks
0Open issues
TypeScriptLanguage
2026-08-14Last push
Cross-platformPlatform

What it does

Token cost tracking for DeepSeek Harness

✅
Our take
Works — verified, early-stage project

Token cost tracking for DeepSeek Harness It installs cleanly and boots without issues in our testing. It's early-stage but functional.

“Verified” means our automated CI actually ran dsh plugin add in a clean profile and it booted — nothing more. Feature descriptions and version compatibility are the author’s claims. This is not a security audit and not an endorsement of third-party code.

README

dsh-cost-tracker

🇨🇳 中文说明

awesome · DSH plugin

Token cost tracking for DeepSeek Harness, with per-model configurable pricing and
peak/off-peak rates.

dsh-cost-tracker: per-session cost bar and the /cost command

What it does

  • Prices every finalized LLM call (assistant/message usage) against a
    per-model pricing table you configure — cache-hit / cache-miss input, output,
    and optional peak-window rates.
  • Publishes a per-session cost projection (total / peak / off-peak / per-model),
    consumed by the Web UI to show a live session cost readout.
  • Flags calls that land in a configured peak window.
  • Models without a pricing entry are surfaced as "unconfigured" with a
    placeholder, so you know to add them.

Installation

Install into a dsh profile straight from GitHub — the plugin ships a
dsh.bundle layer, so dsh plugin add enables it automatically:

dsh plugin --profile web add github:yflmq001/dsh-cost-tracker

Pricing starts empty (models: {}); fill in your models under the plugin's
config (see below). To override defaults, add a cost-tracker row to the
profile's own cordis.patch.yml — later layers win by row id.

The cross-session bill persists through dsh's storage domain; a profile
without a storage backend keeps the bill in memory only.

Configuration

Pricing lives under the plugin's config (Schemastery-validated). All prices are
currency units per million tokens; you fill them in manually (no scraping).

- name: 'dsh-cost-tracker'
  config:
    models:
      deepseek-v4-flash:
        inputMiss: 1.0        # cache-miss input
        inputHit: 0.02        # cache-hit input (omit if no cache tier)
        output: 2.0
        peak:                 # peak tier: hours + toggle + prices
          hours: ["09:00-12:00", "14:00-18:00"]   # Beijing time
          enabled: true       # false = peak off (base rates always); omit = on
          inputMiss: 3.0
          inputHit: 0.10
          output: 9.0
      gpt-4o:                 # any model the harness can reach
        inputMiss: 2.5
        output: 10.0

Session projection

The plugin registers the cost projection:

{
  totalCost, peakCost, offpeakCost,
  callCount, unconfiguredCalls, unconfiguredModels,
  byModel: { [model]: { inputHit, inputMiss, output, total } },
}

Cache writes are priced at the miss rate (providers bill the write at the miss
tier; the written tokens become cache hits on a later call).

Billing correctness

Two choices keep the numbers honest:

  • Cache writes are billed at the miss rate, not the hit rate. Providers
    charge cache writes at the cache-miss input tier (e.g. DeepSeek $0.14/M vs
    $0.0028/M hit) — pricing a write as a hit undercounts by ~50x whenever a
    session writes fresh context. Some cost plugins fold cache writes into the
    hit bucket; this plugin does not.
  • Unknown models are never silently priced. A model with no pricing entry
    is surfaced as "unconfigured" with a placeholder in the projection and UI,
    so a guessed default can't hide in your bill. You add the price, or you see
    the gap.

Known Limitations and Deferred Work

  • Per-session cost is a projection over the durable log (replayed); the
    cross-session global bill and /cost command are available.
  • Non-DeepSeek models need their pricing filled in manually; there is no
    automatic price lookup.
  • Developer preview: assistant/message.usage is absent when the adapter
    reports no accounting, and the session format has no compatibility promise.

Install

🧩 Let your agent install it (recommended)

Install the catalog once, then DeepSeek Harness can find and install any plugin from this site automatically:

dsh plugin add dshbase-catalog

Then say "install dsh-cost-tracker for me" — your agent finds it in the directory and installs it. Docs: dshbase-catalog · verified packs.

This plugin is GitHub source (not published to npm) — install it straight from the repo:

Web profile:

dsh plugin --profile web add github:yflmq001/dsh-cost-tracker

Headless (CLI) profile:

dsh plugin --profile headless add github:yflmq001/dsh-cost-tracker

Test report

Verified: L1 install + L2 load + L3 runtime from GitHub source on dsh 0.1.0-rc.6.

When to use it

Extend the agent's coding surface — give it a new tool, workflow, or integration so it handles a dev task it couldn't before.

Who it's for

Developers who want dsh to behave like a teammate on real codebases — editing, running, and verifying changes rather than just answering.

For developers — extending it

The tool/command surface is the seam: expose more of the SDK, add smarter context wiring, or tighten the loop between code changes and verification.

Security: not yet scanned — our daily static scan will cover it shortly.

Share this badge

More in Developer

Browse all 7797 plugins →