dncore/dsh-inhibition ↗★ 0

dsh-inhibition

Rate-limit plugin for DeepSeek Harness: FIFO queue per provider/model bucket with minIntervalMs and maxConcurrent 适合需避免触发接口频率限制的用户;可在 profile 中按桶配置参数。

パッケージ
dsh-inhibition
互換性
未検証
Harness ピア範囲
>=0.0.1-rc.1 <0.2
Cordis ピア範囲
>=4.0.1 <5
バージョン
0.1.2
最終更新
2026/08/20

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dncore/dsh-inhibition

ドキュメント

README 全文を読む ↗

在官方仓库中运行 CLI(或使用你已安装的 dsh)

dsh plugin --profile add /path/to/dsh-inhibition

配置

在 profile 的 ~/.dsh/profiles//cordis.patch.yml 中添加:

- id: inhibition
  config:
    enabled: true            # 总开关,默认 true;false = 全部直通
    default:                 # 所有未命中桶的兜底(缺省 = 不限流)
      minIntervalMs: 3000
      maxConcurrent: 1
    providers:
      deepseek:
        minIntervalMs: 5000
        models:
          deepseek-chat:     # 模型级覆盖
            minIntervalMs: 2000
            maxConcurrent: 2
      openrouter:
        minIntervalMs: 1000

参数语义

参数语义
minIntervalMs相邻两次请求开始下发的最小间隔(毫秒),即频率的倒数
maxConcurrent桶内同时在途请求上限;1 = 严格串行队列;缺省 = 不限制

字段级继承

每个字段独立沿 models[model] → providers[provider] → default 取就近定义值。例如 deepseek-chat 只覆盖了 minIntervalMs,则其 maxConcurrent 继承 providers.deepseek 或 default 的值。完全未配置的 provider(无 default 时)不限流、零开销。

⚠️ 桶拆分的聚合效应

只有当多个模型解析出相同参数时,它们才共享同一个队列。一旦给某个模型设置覆盖,它会分裂成独立的桶:例如 provider 级 minIntervalMs: 5000 + 两个模型各自覆盖,则两个模型各有一条 5s 间隔的独立队列——对同一个 API 的聚合速率可达 2.5s 一次,可能超出你的预期。

如果你要限制的是 provider 整体的请求速率(多数第三方 API 的限频口径),请把参数配在 provider 级或 default 级,不要给模型配覆盖,这样该 provider 的所有模型共享一条队列。