dsh-cost-ledger

Auditable token-cost ledger for DeepSeek Harness: wraps the llm/stream waterfall and records every call with provider, model, input/output/cache-hit/cache-write tokens, usage source and integer nano-CNY cost from an explicit price table. Aggregates by hour, day and session; exports JSON or CSV with a no-write dry-run preview; keeps a manually entered official platform bill in a parallel column with actual-minus-estimate diff. Unknown provider/model routes stay explicitly unpriced. Zero runtime dependencies; no balance query, notifications or animations.

Overview

Auditable token-cost ledger for DeepSeek Harness: wraps the llm/stream waterfall and records every call with provider, model, input/output/cache-hit/cache-write tokens, usage source and integer nano-CNY cost from an explicit price table. Aggregates by hour, day and session; exports JSON or CSV with a no-write dry-run preview; keeps a manually entered official platform bill in a parallel column with actual-minus-estimate diff. Unknown provider/model routes stay explicitly unpriced. Zero runtime dependencies; no balance query, notifications or animations.

Installation

Install from GitHub

dsh plugin --profile web add github:dingchenhui0618-arch/dsh-cost-ledger

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.