DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-cost-governor

y

dsh-cost-governor

Manifest valid

Cost governance & budget enforcement for DeepSeek Harness: per-model token-cost accounting, multi-provider pricing, budget warn thresholds, and a usage dashboard.

hasBundlePatch

dsh-cost-governor

Cost governance & budget enforcement for DeepSeek Harness.

A finance-grade "cost governor" layered on top of DSH's built-in token metering: it turns the harness's already-disjoint token buckets (input / output / cache-read / cache-write / reasoning) into money, then enforces a budget — soft warn → hard ceiling → block or steer to a cheaper model — with a polished in-app dashboard.

Not another "cost counter". The counter exists (dsh-token-meter). This plugin is the budget keeper that says how much you're spending, what it will cost by month-end, and stops you when you told it to.


Why this one

Capabilitycore dsh-token-metertypical community cost pluginsdsh-cost-governor
Disjoint token buckets✅partial✅ (reuses core)
Compaction-safe accounting✅⚠️ often drifts✅ (official projection seam)
Multi-provider precise pricing—mostly DeepSeek-only✅ catalog + cache/reasoning buckets
Budget warn—display only✅ threshold events + webhook
Budget enforce (block / steer)—❌✅
Cross-session trends + CSV—❌✅
Model cost comparison + savings tip—❌✅

Features

  • Per-model cost accounting on the official sessionProjections seam — stays correct through compaction and cold reads, and re-prices history instantly when you edit a price.
  • Multi-provider price catalog (DeepSeek, OpenAI, Anthropic, Google, xAI, Qwen, GLM, Moonshot) with separate cache-read/write and reasoning rates. Fully overridable.
  • Budget governance: daily | weekly | monthly | unlimited budget, warnRatio soft threshold, hardRatio ceiling, and a hardAction of notify-only | block-new-requests | steer-to-cheaper-model.
  • Webhook notifications (Slack-style / Feishu / DingTalk) on threshold crossings — fail-soft.
  • Dashboard (Settings → Usage & Cost): KPI cards, animated budget bar, per-model spend table, daily chart, savings tip, CSV export.
  • Compact HUD budget ring for the sidebar rail.

Install

# 1. install the plugin
npm i -g dsh-cost-governor          # or add it to your project

# 2. add to your DSH composition (cordis.yml)
- name: dsh-cost-governor
  config:
    currency: USD
    budget:
      period: monthly
      budgetUsd: 20
      warnRatio: 0.8
      hardRatio: 1.0
      hardAction: notify-only      # notify-only | block-new-requests | steer-to-cheaper-model
    notifyWebhook: ""              # optional
# 3. restart dsh — the dashboard appears under Settings → Usage & Cost

Configuration

keydefaultdescription
currencyUSDdisplay currency
budget.periodmonthlydaily | weekly | monthly | unlimited
budget.budgetUsd20period cap
budget.warnRatio0.8soft-warn at 80%
budget.hardRatio1.0ceiling at 100%
budget.hardActionnotify-onlyceiling behavior
notifyWebhook—optional webhook URL
priceCatalogbuilt-inper-model overrides (USD / 1M tokens)

Architecture

client dashboard / HUD
        ▲  session/projection frames + settings scope
host   UsageCost service ── BudgetGovernor · CostLedger · Notifier
        ▲  ctx.sessionProjections.register(costUsage)
costUsage projection   (pure fold: raw per-model token buckets)
        ▲  reuses core token buckets (request/context → model attribution)
dsh-token-meter · dsh-llm (TokenUsage)

The costUsage projection stores raw token buckets only — never currency — so it is replay-safe and a price-table edit re-prices history without refolding the log.

Development

pnpm install
pnpm build          # tsc (see PUBLISHING.md for the full DSH toolchain notes)

Open preview/dashboard.html for a zero-build visual preview of the dashboard.

Limitations

  • Only final assistant/message usage is billed; input spend of a request that fails before assembling a message is not captured (a provider still charges it). This matches the harness's own usage-carrier semantics and is a documented edge, not a miscount.
  • block-new-requests / steer-to-cheaper-model are exposed as a governance gate (BudgetGovernor.gate) and emitted events; wiring them into the LLM waterfall is the one integration point to verify against the official DSH plugin docs at first build.
  • Prices in the built-in catalog are community placeholders — verify against each provider before trusting absolute dollar figures.

License

MIT

Comments

Loading…

Similar plugins

dsh-budget

by PerryLink

Cost governance for DeepSeek Harness: aggregated token/cost metering per model, session and day, budget caps with threshold alerts and over-limit policies, carbon footprint estimation, per-model laten

Security & AuditManifest valid

★ 10

↓ 854/wk

Apache-2.0

TypeScript

Oct 31, 2026

dsh plugin --profile web add dsh-budget

by LinHyu-2006

Balance and per-session spend HUD for DeepSeek Harness, with budget alerts, peak-hour warnings and opt-in official price sync.

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 2

MIT

JavaScript

Oct 23, 2026

dsh plugin --profile web add dsh-balance-hud

by Arun1016

Account balance and per-session cost pill for DeepSeek Harness (dsh) web GUI: official peak/off-peak pricing, per-model breakdown, no credentials stored.

Tools & CapabilitiesTerminal & ClientsSessions & MessagesManifest valid

★ 1

MIT

TypeScript

Oct 30, 2026

dsh plugin --profile web add dsh-cost

by kam74515-boop

DeepSeek Harness token usage and estimated cost dashboard

Manifest valid

★ 0

MIT

TypeScript

Aug 15, 2026

dsh plugin --profile web add dsh-show-me-how-much

by juhe291

A corner HUD for DeepSeek Harness that shows your session's token pressure, per-model cost, and daily/monthly usage at a glance, with an editable budget and balance that tracks spending for you. 右下角常驻

Development & InfrastructureModels & ProvidersManifest valid

★ 6

↓ 127/wk

MIT

TypeScript

Aug 17, 2026

dsh plugin --profile web add dsh-token-panel

by mike-lee0120

Cost dashboard for DeepSeek Harness: aggregates model input/output/cache tokens across all local sessions, prices them with a builtin table (including DeepSeek peak/off-peak), and shows daily trends p

Tools & CapabilitiesModels & ProvidersManifest valid

★ 4

JavaScript

Sep 25, 2026

dsh plugin --profile web add dsh-cost-dashboard