Leafyezi233/dsh-llm-rate-limiter
Project Overview项目介绍
dsh-llm-rate-limiter is a native Cordis plugin built for DeepSeek Harness (DSH) that enforces per-model rate limits on every llm/stream waterfall call. It targets one provider/model pair at a time, tracking concurrency, requests per minute, and burst size independently for each combination. Installation is done through dsh plugin add <your-profile> @leaf233/dsh-llm-rate-limiter (npm) or dsh plugin add <profile> ./path/to/dsh-llm-rate-limiter (local path), and the cordis.patch.yml bundle entry is picked up automatically by reconcilePlugins. Plugin 0.3.x requires DSH 0.1.7-rc.1 or newer because the client services it depended on were removed in 0.1.7, while plugin 0.2.x remains the supported line for DSH 0.1.5 where connection.rpc.handle() was still usable.
Two algorithms ship in the box: Token Bucket, which lets bursts through up to a configured ceiling, and Sliding Window, which enforces a strict rolling RPM ceiling. When a request would exceed the limit the operator can pick Queue mode — throttled calls park in a waiter list and drain as tokens become available — or Reject mode, which returns a RATE_LIMIT error immediately for dsh-llm-retry to back off and retry. The configuration UI lives under DSH Settings → Plugins → Configurable as a collapsible card with hot-reload; expanding it reveals a live status panel that polls /llm-rate-limiter once per second and backs off to 2s/4s/8s after failures, while a collapsed card stops polling entirely and leaves the rest of the form functional.
Beyond the 375-assertion unit test suite (covering strategies, status RPC, real client bundle on a miniature React runtime, host integration via real apply(ctx, config), the self-registered fallback route, and the Config schema contract), the project ships pnpm run verify:live which performs 19 live HTTP checks against a real DSH webserver socket and exits with code 2 when DSH is absent. Cordis ≥4.0.0 is the only runtime dependency, the source is MIT licensed, and a symlink install lets lib/ edits take effect on a Ctrl+Shift+R browser refresh without reinstalling. DSH 0.2.x and Cordis 5+ are explicitly listed as untested.
dsh-llm-rate-limiter 是面向 DeepSeek Harness(DSH)的原生 Cordis 插件,按 provider/model 维度为每一次 llm/stream 调用施加独立并发、RPM 与突发上限。通过 dsh plugin add <profile> @leaf233/dsh-llm-rate-limiter 或本地路径安装,cordis.patch.yml 由 reconcilePlugins 自动纳入,DSH 0.3.x 要求 0.1.7-rc.1 及以上,0.1.5 需固定 0.2.x。状态面板走 /llm-rate-limiter 鉴权通道,未启用时卡片其余功能不受影响。
插件提供令牌桶与滑动窗口两种算法,可选择排队等待或立即拒绝并交由 dsh-llm-retry 指数退避重试。配置入口位于 DSH 设置 → 插件 → 可配置项,采用可折叠卡片并支持热更新;v0.2.0 起卡片展开时轮询 1s,折叠后停止,内置每模型进度条与最近 8 条事件环形缓冲(容量 64)。典型用户是在多供应商/多模型下需要稳定节流并希望直观观察被拒、超时与排队时延的开发者与运维。
依赖方面仅要求 Cordis ≥4.0.0 与 DSH 0.1.7-rc.1+,测试套件共 375 项断言覆盖算法、状态 RPC、客户端 Bundle、宿主集成、自注册路由与配置 Schema;本地开发通过 pnpm test 验证,pnpm run verify:live 在真实 DSH 套接字上做 19 项 HTTP 校验。0.2.x 已覆盖 0.1.7-rc.1 移除 settingsScope/settings.plugin.item 后改用 configForms/plugins.item 与 Config 导出 Schema,DSH 0.2.x 与 Cordis 5+ 暂未测试,源码以 MIT 发布。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-llm-rate-limiter(Leafyezi233/dsh-llm-rate-limiter)
仓库:https://github.com/Leafyezi233/dsh-llm-rate-limiter
本站详情页:https://www.yhbd.top/plugins/leafyezi233-dsh-llm-rate-limiter/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-28 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:Leafyezi233/dsh-llm-rate-limiter
把 Leafyezi233/dsh-llm-rate-limiter 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-llm-rate-limiter
English | 中文
Per-model LLM call rate limiter for DeepSeek Harness with queue/reject support and interactive GUI configuration.
Features
- Per-model rate limiting — independent concurrency, RPM, and burst limits for each
provider/model - Two algorithms — Token Bucket (allows bursts) or Sliding Window (smooth, strict RPM)
- Queue mode — throttled requests wait in queue and are released when a slot opens
- Reject mode — throttled requests fail immediately (integrates with
dsh-llm-retryfor auto-backoff) - Interactive GUI — collapsible card in DSH Settings → Plugins → Configurable
- Live status panel — real-time counters, per-model progress bars and an event log (v0.2.0)
- Hot-reload — settings changes take effect immediately, no restart needed
- Every request checked — intercepts
llm/streamwaterfall, covering every LLM call in every agent turn
Status Panel (v0.2.0)
Expanding the card shows a live panel at the top of its body:
📊 实时状态 ● 实时 [清零]
请求 42 · 通过 38 · 拒绝 2 · 超时 1 · 中止 1 · 平均等待 214ms
deepseek/deepseek-chat [令牌桶] ▓▓▓▓▓▓▓░░░ 7.5/10 并发 2/5 排队 1
openai/gpt-4o [滑动窗口] ▓▓▓▓▓▓▓▓▓▓ 3/3 rpm 并发 1/5
12:00:03 timeout openai/gpt-4o 等待 1m
12:00:01 rejected openai/gpt-4o
12:00:00 granted deepseek/deepseek-chat 等待 4.2s
| Aspect | Behaviour |
|---|---|
| Data channel | Channel /llm-rate-limiter — authenticated (401/403 fence), POST+JSON, auto-cleaned with the plugin fiber |
| Carrier | Prefers the framework's connection.rpc.handle(); falls back to a self-registered prefix route that reuses connection.requestRejection() when the framework path is broken (see below) |
| Cadence | 1 s polling while the card is expanded; backs off 2 s → 4 s → 8 s after failures |
| Collapsed card | The panel unmounts, so no polling runs at all |
| Endpoints | snapshot (live counters) and reset (zero the statistics) |
| Without a channel | Shows "状态通道不可用" and leaves the rest of the card fully functional |
| Counters | requests / granted / rejected / timeouts / aborted / totalWaitMs, plus the last 8 events (ring buffer of 64) |
| Progress bars | Token bucket shows tokens/burstSize; sliding window shows countInWindow/maxRpm; both turn amber as the limit approaches |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
HOWILLMAKEIT/dsh-model-context-catalog
HiWhaleW/dsh-toolbox
SpookySandwich/dsh-plugin-message-edit
LouisHaoL/dsh-timer-agent