echo-escape/dsh-workbench--plugins-cost-governor1

@echo-escape/dsh-cost-governor

DeepSeek Harness plugin for token auditing, live monetary cost estimation, dynamic model routing, and automatic context compaction gating.

AI 분석

提供会话级别的 Token 消耗审计与费用估算,支持预算控制。适合需要严格监控和优化大模型 API 账单成本的用户。

패키지
@echo-escape/dsh-cost-governor
버전
1.0.0
최근 업데이트
2026. 8. 13.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

Configuration

Configure the plugin in your session's cordis.yml:

plugins:
  cost-governor:
    enabled: true
    config:
      currency: "USD"
      maxSessionBudgetUsd: 5.0
      compactionThresholdPercent: 80
      modelRates:
        deepseek-chat:
          inputPerM: 0.27
          outputPerM: 1.10
          cacheHitInputPerM: 0.07
        deepseek-reasoner:
          inputPerM: 0.55
          outputPerM: 2.19
          cacheHitInputPerM: 0.14

Usage

The plugin automatically registers the get_cost_stats tool on ctx.tools. An agent or caller can execute this tool to retrieve structured cost statistics:

{
  "status": "success",
  "currency": "USD",
  "totalTokens": 150000,
  "promptTokens": 100000,
  "completionTokens": 50000,
  "cacheHitTokens": 20000,
  "totalCostUsd": 0.0806,
  "recordCount": 5,
  "byModel": {
    "deepseek-chat": {
      "promptTokens": 100000,
      "completionTokens": 50000,
      "costUsd": 0.0806
    }
  }
}