frozo-ai/dsh-budget

frozo-ai★ 0JavaScript最后同步: 2026-08-19

在 GitHub 打开

Spend enforcement for DeepSeek Harness: hard budget caps, auto-downgrade, chargeback. Blocks over-budget calls before they are billed.

README 摘要

dsh-cost-gate Spend enforcement for DeepSeek Harness — not another dashboard. The dsh ecosystem has plenty of cost plugins. Every one of them measures : ledgers, statistics, heatmaps, balance widgets. They tell you what you spent after you spent it . This one stops the call . llm/stream is a cordis waterfall — the decision happens before next() runs, which is the only place enforcement can actually work. Install Set dryRun: true to log decisions without blocking — roll out safely, then turn it on. Design notes Integer micro-dollars. Costs accumulate as integers, never floats. A test runs 10,000 calls and asserts zero drift, because this decides whether people get blocked. Cache tokens are disjoint. Per dsh's TokenUsage contract, cacheRead and cacheWrite are not included in inputTokens , so they're added at their own rates rather than folded in. Atomic ledger writes. Temp file plus rename — a torn write must not lose budget state. UTC period boundaries , so a daily budget resets at a time everyone agrees on. Fails open, deliberately. No limitUsd means metering only. Enforcement is opt-in: a budget plugin that accidentally blocks your whole team is worse than one that doesn't block a…

在 GitHub 查看完整 README →
工具/开发cost-managementdeepseek-harnessdshdsh-pluginfinops

分类