abdounasser202/dsh-deepseek-budget ↗★ 0
dsh-deepseek-budget
DeepSeek spend and budget meter for DSH: real provider-reported token usage from local session logs, priced against a USD budget. 适合需要监控和控制DeepSeek API使用额度与花费的开发者。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:abdounasser202/dsh-deepseek-budgetドキュメント
README 全文を読む ↗How it finds usage
DSH keeps a dedicated adapter, because its log is zstd-compressed and carries stream
timing. Everything else is found by content discovery: the plugin walks the home
directory, keeps any .json/.jsonl file whose bytes contain deepseek, and parses it
with one generic record reader that understands the provider/model/usage shapes every
harness writes.
That means a harness nobody anticipated is still counted, and a log that merely mentions DeepSeek in prose is not — the parser only accepts records that carry token usage on a DeepSeek route.
| Harness seen on this machine | DeepSeek calls |
|---|---|
| DSH | ✅ counted (dedicated adapter) |
| Pi (incl. every subagent transcript) | ✅ counted (discovery) |
| Claude Code, Codeg, Copilot, opencode | ❌ installed, but no DeepSeek calls |
Only DeepSeek routes are counted. A harness that also drives Claude or a local model contributes just its DeepSeek calls; everything else is reported separately and kept out of the budget.
Duplicates
A harness may write the same call into two files — a subagent's transcript and its parent session. Copies are collapsed globally by the provider's own response id, falling back to a strict fingerprint of time, route and token counts. On this machine that removed 593 of 1,419 Pi records; the raw count would have overstated spend by 72%.