GooDAnDReaDY/dsh-key-rotation3

@goodandready/dsh-key-rotation

Per-provider API key rotation for DeepSeek Harness: a key pool per provider, auto-created clone routes, and switching to the next key on quota/rate-limit errors. Includes a Settings section (Key Rotation) to edit the key pools, cooldown and switch codes.

包名
@goodandready/dsh-key-rotation
版本
0.8.7
许可证
MIT
最近更新
2026年9月12日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:GooDAnDReaDY/dsh-key-rotation

⚙️ Configuration Reference (settings.yaml)

dsh-key-rotation:
  switchCodes:
    - QUOTA
    - RATE_LIMIT
    - SERVER
    - TIMEOUT
    - TRANSPORT
    - EMPTY_RESPONSE
    - UNKNOWN_MODEL
    - AUTH
  cooldownMs: 60000
  # v0.8.0 circuit breaker
  circuitBreakerEnabled: true
  circuitBreakerThreshold: 5
  circuitBreakerOpenMs: 30000
  circuitBreakerHalfOpenProbes: 1
  concurrencyLimit: 5
  quotaResetWindow:
    type: midnight_utc
    hour: 0
  cascade:
    - provider: backup-provider-id
      model: your-backup-model-id
  webhookUrl: "https://api.telegram.org/bot/sendMessage?chat_id="
  providers:
    - provider: your-primary-provider
      rpmLimit: 60
      tpmLimit: 100000
      keys:
        - PRIMARY_API_KEY
        - PRIMARY_API_KEY_2
        - PRIMARY_API_KEY_BACKUP
    - provider: secondary-provider
      keys:
        - SECONDARY_API_KEY
        - SECONDARY_API_KEY_2

Parameter Reference

ParameterTypeDefaultDescription
switchCodesstring[][QUOTA, RATE_LIMIT, ...]List of error codes that immediately trigger failover.
cooldownMsnumber60000 (1 min)Base penalty duration (in ms) for quarantined keys.
circuitBreakerEnabledbooleantrueEnable per-provider circuit breaker (v0.8.0).
circuitBreakerThresholdnumber5Consecutive failures before opening the circuit.
circuitBreakerOpenMsnumber30000How long the circuit stays open (ms).
circuitBreakerHalfOpenProbesnumber1Probe requests allowed in half-open state.
verboseLoggingbooleanfalsePer-request rotation logs (noisy; off by default).
concurrencyLimitnumber0 (disabled)Max concurrent in-flight streams per key (0 = unlimited).
quotaResetWindowobjectnullCalendar reset alignment (midnight_utc, midnight_pst, rolling_24h).
cascadearray[]Fallback provider chain when primary pool is completely exhausted.
webhookUrlstring""Target URL for interactive Telegram, Discord, Slack, or generic alerts.
providersarray[]List of { provider, keys, rpmLimit, tpmLimit, modelPools } definitions.