Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In multi-agent development scenarios, cost control is an essential requirement. openplancc/dsh-fuse is a plugin focused on cost strategy. It provides per-call billing and an offline fuse mechanism: enforce budget, model, and reasoning effort limits before tokens are consumed.
Core Features¶
This plugin has the following capabilities:
- Multi-agent cost strategy: Supports cost management in multi-agent environments.
- Per-call billing: Accurate metering for every call.
- Offline Fuse: Enforces local budget, model, and reasoning effort limits, typically responding in under 100ms.
- SaaS dashboard synchronization: Synchronizes data with
https://dsh.openplan.ccand displays organization, project, and personal spend. - Zero native build: Uses
@libsql/clientas local storage and can be distributed without compilation (requires Node >= 20). - Device flow authentication: Uses device flow (RFC 8628) for user authentication by default.
- Status query tool: Provides the
dsh_budget_statustool, allowing models to read policy status at runtime.
Installation and Enablement¶
The plugin is activated through a dsh.bundle declaration. During installation, DSH reads this declaration and loads the plugin layer.
Install via registry (recommended):
dsh plugin --profile <perfil> add @openplan/dsh-fuse
Install via local tarball:
pnpm pack
dsh plugin --profile <perfil> add ./openplan-dsh-fuse-<versão>.tgz
Install via Git:
dsh plugin --profile <perfil> add github:<org>/<repo>#<sha>
Configuration¶
The plugin operates in local mode by default. To enable SaaS synchronization or customize policies, edit the cordis.patch.yml file in the profile directory. This configuration layer sits above the bundle layer.
The configuration structure is as follows:
# ~/.dsh/profiles/<perfil>/cordis.patch.yml
- id: fuse
name: '@openplan/dsh-fuse'
config:
project: meu-projeto
dev: eu@empresa.com
# Use for machine/CI environments without a browser
orgKey: !!js process.env.DSH_ORG_KEY
baseUrl: https://dsh-api.openplan.cc
# Local budgets (enforced by Fuse when offline):
budgets:
- limitUsd: 50
window: month
- limitUsd: 5
window: day
# Policy limits:
policies:
maxReasoningEffort: medium
allowedModels:
- deepseek/deepseek-v4-flash
denylistedProjects:
- projeto-cliente-confidencial
# Pricing configuration (optional; automatically resolved from the registry/gateway by default):
pricingTable:
deepseek/deepseek-v4.1-flash:
inputCentsPerM: 15
outputCentsPerM: 60
# Fallback pricing for unpriced models (prevents zero cost):
unpricedFallback:
inputCentsPerM: 15
outputCentsPerM: 60
Authentication Methods¶
- Device flow (default): When a human user connects, run the following command:
dsh plugin --profile <perfil> exec dsh-fuse-connect
This process opens a browser for authorization, saves the token with read-only permissions, and it can be revoked at any time in the dashboard.
- Org Key: In headless environments or CI, pass it via the environment variable
DSH_ORG_KEY.
Pricing Resolution Logic¶
The plugin automatically retrieves pricing from the registry (models.dev) or the gateway and resolves model pricing in the following order:
1. Explicit mappings in pricingAliases.
2. The local configured pricingTable.
3. provider/model routing pricing in the Registry or Gateway.
4. The Adapter ID itself.
5. Fallback matching by progressively removing prefixes.
If a model has no pricing, the plugin marks it as unpriced and logs it, unless unpricedFallback is set.
Usage¶
After installation and configuration, you can perform operations with the following commands:
Connect to the dashboard:
dsh plugin --profile <perfil> exec dsh-fuse-connect
Check the configuration layer (without starting the Harness):
dsh --profile <perfil> --dump-config
Agent status query:
When the @deepseek-ai/dsh-tools service starts, the plugin registers the dsh_budget_status tool. Models can query the current budget status, used quota, and remote 429 limits during a session to adapt their strategies. This tool can be disabled with budgetStatusTool: false.
Notes¶
- Environment requirements: Requires Node.js >= 20.
- Local mode: If
baseUrlororgKeyis not configured, the plugin runs in local mode, does not sync with SaaS, and relies solely on local Fuse limits. - Permissions: The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT) before installation.