dsh-budget
Cost governance for DeepSeek Harness: aggregated token/cost metering per model, session and day, session/daily/monthly budget caps with threshold alerts (desktop notification + webhook) and alert/block/degrade over-limit policies, built-in carbon footprint estimation and per-model latency benchmarks, a Settings budget tab, and the /budget command
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PerryLink/dsh-budget说明文档
阅读完整 README ↗Configuration
All tunables are Schemastery Config fields (changeable from cordis.yml). cordis.patch.yml documents each key inline.
| Key | Default | Meaning |
|---|---|---|
prices | {} | Per-model USD prices per 1M tokens, merged over the built-in table |
defaultPrice | {input: 1.0, output: 3.0} | Fallback for models absent from both tables |
budgets.session / daily / monthly | 10 / 50 / 500 | Budget caps in USD per scope; omit for unlimited |
warnRatio | 0.8 | Alert once usage reaches this fraction of a cap (0..1) |
overLimit | alert | alert / block / degrade after a cap is crossed |
degradation | {} | Model id → cheaper model id of the same provider |
webhookUrl | (none) | Optional webhook URL for threshold alerts (POST JSON) |
webhookTimeoutMs | 5000 | Webhook request timeout |
alertsEnabled | true | Master switch for threshold alerts |
alertCooldownMs | 3600000 | Minimum ms between two alerts of the same scope |
desktopNotifications | false | Browser desktop notifications while the tab is open |
refreshIntervalMs | 5000 | Settings tab polling interval |
carbon.enabled / region / pue / energyKwhPerToken | true / global / 1.58 / 0.000007 | Carbon bridge (regions: global, us, eu, china, india, uk, france, iceland) |
latency.enabled / windowSize | true / 200 | Per-model latency percentiles and their window |
currency | {code: USD, rate: 1.0, decimals: 2} | Display currency (costs are computed in USD) |
outputLanguage | en | /budget output language: en / zh |
historyDays | 30 | Per-day usage history kept in the panel snapshot |
persistence.enabled / intervalMs | true / 10000 | Durable day/month persistence across restarts (storage domain); degrades to in-memory when the domain is absent |