DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-task-budget

d

dsh-task-budget

Identified

Per-task cost dashboard and budget guard that prices each model call at peak or off-peak rates, turns the remaining budget into a per-turn work envelope in the system prompt, and stops the task at its

Task budget (dsh-task-budget)

A DeepSeek Harness plugin with a left-sidebar panel for per-task spend, a per-task cost cap, and a live budget brief that is generated for the model on every turn.

What it does

  • Left sidebar → 任务预算 / Task budget. Lists every task (session) with its token totals, actual CNY cost, a budget bar, and status. Click a row to see:
    • every model call: time, peak/off-peak tier, model, input / cache / output tokens, that call's cost, and the running total;
    • the exact budget brief the model sees for that task (collapsible).
  • Per-task cap. One number (default ¥0.5) applies to each new task or conversation. It is never shared across tasks.
  • Hard stop at the cap. The next step is forced to ask you with ask_user_question, and every tool except ask_user_question is denied until a human answers. One reply of yours buys a full continuation allowance: the cap becomes at least spent + continuationStepCny.
  • Approvals survive reloads. Grants are persisted in $DSH_HOME/budget-guard/grants.json, so a plugin/Host restart does not ask again for a task you already approved.

How the budget reaches the model

The prompt has two sections:

  1. Rules (budget-guard:rules, static): real rates, the money scale (¥0.05 ≈ 1 short answer, ¥0.15 ≈ 2-3 calls, ¥0.30 ≈ 5 calls, ¥0.50 ≈ 8-10 calls, ¥1 ≈ 15 calls), and the shortest-path discipline.

  2. Task brief (budget-guard:brief, dynamic, per answering agent): rebuilt for every step with live numbers:

    【本任务预算简报 · 自动生成,优先级高于其他计划】
    上限 ¥2.306|已花 ¥1.306|剩余 ¥1.000|谷时|平均每次调用 ¥0.050(约可再调用 20 次)
    本轮请求:把左侧栏入口的价格显示改成“元/百万 token”…
    判定:小改动(精简执行)|本轮上限:4 次调用 / 1 个文件
    策略:精简执行。直接改完并做 1 次最小验证;最多 4 次调用、1 个文件。
    硬约束:以上次数/文件数是硬上限…;不扫描全仓库…
    

The budget → prompt algorithm

All local and free (no extra model call):

  1. Classify the request from the latest substantive user message: length, keywords (重构/迁移/全量 weigh 2; 新增/实现/修复/测试/文档 weigh 1), multi-file phrases, and whether it is a pure question. Result: answer | small | feature | large.
  2. Measure the real burn rate: average CNY per model call from this task's own committed usage (default ¥0.06 before the first call).
  3. Convert money into a work envelope: affordable = floor(remaining / avg) and pick a strategy — full, lean, minimal, diagnose (diagnose only, no edits), answer (no tools), or stop (not enough for one call).
  4. Emit hard limits into the prompt: maximum model calls, maximum files, search/read limits, the required one-line budget estimate, and the stop rule when less than one call's money remains.

The model therefore sees not just "the cap is ¥0.5", but "you have ¥1.00 left, about 20 calls, this request is a small change, use at most 4 calls and 1 file".

Settings

The panel writes $DSH_HOME/budget-guard/settings.json:

{
  "enabled": true,
  "capCny": 0.5,
  "continuationStepCny": 0.5,
  "warnRatio": 0.8,
  "inputIncludesCache": true,
  "peakWindows": [{ "start": 1, "end": 4 }, { "start": 6, "end": 10 }],
  "holidays": [],
  "models": {}
}
  • peakWindows uses UTC hours (1–4 and 6–10 are 09:00–12:00 and 14:00–18:00 Beijing).
  • models overrides rates, e.g. {"deepseek-flash": {"offPeak": {"cacheHit": 0.02, "cacheMiss": 1, "output": 4}, "peak": {"cacheHit": 0.04, "cacheMiss": 2, "output": 8}}}. A model entry with only cacheHit/cacheMiss/output is priced flat.
  • inputIncludesCache follows DeepSeek accounting: inputTokens already contains cache-hit tokens, so the miss count is input - cacheRead - cacheWrite.

Notes

  • Cost is folded from committed assistant/message usage events, priced at each call's own timestamp (peak/off-peak), so it is reconstructable from the log. Historical sessions are read on demand (the newest 12 are queued when the panel opens; older rows compute when opened) and cached in memory.
  • Real prices: off-peak CNY 0.02 / 1 / 4 per 1M tokens (cache hit / miss / output); peak is double. Peak = Beijing Mon–Fri 09:00–12:00 and 14:00–18:00; weekends and holidays are off-peak all day.
  • Subagent sessions are separate tasks and are listed with a 子任务 badge.

Comments

Loading…

Similar plugins

dsh-cost-tracker

Per-model token cost tracking with configurable cache-hit/miss, output and peak-window pricing, a live session cost bar, and unconfigured-model flags.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 0

dsh plugin --profile web add dsh-cost-tracker

by Existence001100

🏦 给 DSH (DeepSeek Harness) 的每次任务加一条预算线。支持按金额或 Token 限制消耗、自动拦截/手动放行,防止 Agent 过度消费。 🏦 Draws a budget line across every task in DSH (DeepSeek Harness). Cap consumption by CNY or token count, with auto-interception and burn-rate estimates to prevent runaway costs.

Security & AuditDevelopment & InfrastructureManifest valid

★ 1

MIT

JavaScript

Nov 8, 2026

dsh plugin --profile web add dsh-budget-guard-plugin

by ZiOstudio

Session budget brake for DeepSeek Harness — meters every call against the official price table, halts the run when the budget runs out, and leaves a resumable handoff snapshot. · DSH 会话预算刹车

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 1

MIT

TypeScript

Oct 22, 2026

dsh plugin --profile web add dsh-budget-handoff

by Jannchie

Cost tracking priced from an online catalogue (models.dev + OpenRouter, 8000+ models, each call priced at its own instant): a per-turn cost line, a Cost tab attributing spend to tool output / model ou

Tools & CapabilitiesDevelopment & InfrastructureModels & ProvidersManifest valid

★ 10

↓ 951/wk

MIT

JavaScript

Oct 23, 2026

dsh plugin --profile web add dsh-bill

Shows token and CNY cost per turn and per session in the harness's own statistics form, a whole-account bill over 1/7/30-day windows with cost-per-unit-of-work trends, and an advisor that re-measures

Tools & CapabilitiesManifest valid

★ 0

dsh plugin --profile web add dsh-cost-audit

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