BruceLanLan/dsh-tier-router 预览 preview

BruceLanLan/dsh-tier-router

Plugin插件 Native原生 ⭐ 5 MIT Models & Routing模型与路由

Project Overview项目介绍

dsh-tier-router is a native model routing plugin built exclusively for DeepSeek Harness. It implements a tiered routing strategy that assigns different models based on task complexity, letting the more powerful deepseek-v4-pro handle high-difficulty work like planning, architecture design, and code review while using the lower-cost deepseek-v4-flash for routine day-to-day implementation. It also supports per-tier fallback chains, automatic escalation on repeated step failures within a configured time window, and tiering for subagents, and integrates via DSH’s official extension APIs to provide slash commands, built-in tools, and a web-based settings UI.

The plugin supports multiple routing modes, with the default auto mode following the opusplan style that runs steps on the strong tier during planning and automatically switches to the cheap tier during execution. Users can manually override the tier for the current active session at any time, or call on the strong tier on demand to get targeted decision advice or a full structured code review. A built-in security guard blocks high-impact actions like deleting multiple sensitive files when run on the cheap tier, prompting users to switch to the strong tier before retrying the action. This tool is ideal for DSH users who want to control overall LLM API costs without sacrificing output quality for complex tasks.

dsh-tier-router is released under the permissive MIT license, so it is free to use and modify for any purpose without any paid costs. All custom user configuration is stored persistently in DSH’s tier-router settings namespace, so it survives full application restarts. Known limitations include that tier switches only take effect starting from the next step after the switch, and the subagent policy is process-wide with built-in subagents inheriting the parent’s current route. If the /tier command does not appear after installation, users must add the plugin row to their current active agent preset, then restart dsh web to properly activate it.

dsh-tier-router是专为DeepSeek Harness开发的原生分层模型路由插件,实现了根据任务强度分配不同模型的路由策略。它默认让能力更强的deepseek-v4-pro处理规划、架构设计和代码评审这类高复杂度任务,让成本更低的deepseek-v4-flash处理日常编码实现工作,还支持层级失败回退链、任务失败自动升级和子代理分层。插件通过DSH官方接口集成,提供了斜杠命令、内置工具和Web设置界面多种管理方式。

它支持多种工作模式,默认自动模式遵循opusplan风格,规划阶段运行在强模型层级,执行阶段自动切换到便宜层级。用户也可以手动切换当前会话的层级,或是随时调用强模型给出决策建议或进行代码评审。遇到高影响操作(比如批量删除文件),防护机制会阻止廉价层级执行,提示用户切换到强层级后重试。这个插件适合需要控制大模型调用成本,同时希望复杂任务能得到高质量输出的DSH用户使用。

插件以MIT许可证开源,无付费门槛,配置会持久保存在DSH的tier-router设置命名空间中,重启后不会丢失。已知限制包括层级切换会在下一个步骤生效,子策略是进程全局的,内置子代理会继承父进程的路由配置。首次安装后如果看不到/tier命令,需要检查当前会话使用的代理预设是否已经添加了这个插件行,添加后重启dsh web即可正常使用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
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 dsh-tier-router

把 BruceLanLan/dsh-tier-router 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-tier-router — Tiered model routing for DeepSeek Harness

license dsh-plugin

handles planning / architecture / review**, while a cheap tier (deepseek-v4-flash by default) handles day-to-day implementation, with per-tier fallback chains and task-intensity reasoning effort. Inspired by Claude Code's /advisor (consult a stronger model for hard decisions) and opusplan (strong model in plan mode, cheap model for execution), implemented on DeepSeek Harness through its official seams, with an escalation gate, failure auto-escalation, and subagent tiering on top.

English · 中文

How it works

flowchart LR
    subgraph main["Main session (header-driven)"]
      U["User message"] --> IN["agent/inbox/inserted"]
      IN -->|"auto mode"| HW["write session request/header"]
      PM["plan/mode flip"] --> HW
      HW --> API["api-proxy selection layer"]
      API --> STEP["each step's model = header tier"]
    end
    subgraph child["Subagents (agent/request swap)"]
      W["tier_worker dispatch"] -->|"agentOptions injection"| C["subagent"]
      C --> AR["agent/request waterfall"]
      AR -->|"swap provider/model per tier"| STEP2["subagent steps"]
    end
    G["tools/pre-execute guard"] -.->|"cheap tier + high-impact pattern"| DENY["deny + escalation hint"]
    E["agent/error failures"] -.->|"within window"| ESC["temporary strong tier (TTL)"]
sequenceDiagram
    participant U as User
    participant S as Session (main agent)
    participant A as Strong v4-pro
    participant C as Cheap v4-flash
    U->>S: /tier plan (enter plan mode)
    S->>S: write header -> strong
    S->>A: planning / architecture / design
    U->>S: approve plan, leave plan mode
    S->>S: write header -> cheap
    S->>C: routine implementation
    S->>A: tier_advisor (hard decisions) / tier_review (final review)
    Note over S,C: high-impact actions (rm -rf / credential files) are denied by the guard until the strong tier is selected

Features

  • Automatic tiered routing (auto mode, opusplan-style): steps run on the strong tier while plan mode is active and on the cheap tier during execution. Before a loop builds its first or resumed request, the router synchronizes the agent's model options and durable request/header; later route changes preserve unrelated request settings such as maxTokens.
  • Per-session scoping: /tier strong|cheap|auto|delegated|off affects only the current session; other sessions in the process keep their own tier (global default auto). In delegated mode the main session stays on its model-picker selection while only subagents use tier routing; /tier auto remains an explicit per-session override. Sessions that should not be managed can opt out with a single /tier off.
  • On-demand advice (advisor-style): the /advisor <question> command and the tier_advisor tool hand one decision question plus gathered evidence to the strong tier and return advice / evidence / risks / acceptance criteria; implementation stays on the current tier.
  • Review phase: the tier_review tool and /tier review <focus> ask the strong tier to review a change set and return an APPROVE / NEEDS-CHANGES / BLOCKED verdict with issues ranked by severity.
  • Failure auto-escalation: repeated step errors within a window (default 2 errors / 60s) temporarily escalate the session to the strong tier (default 180s), expiring via TTL; sessions in off mode never escalate.
  • Configurable tiers (durable): /tier set <strong|cheap> <provider> <model> [effort] or the tier_configure tool can point either tier at any registered provider/model, configure the strong tier to follow the session selection, and set ordered fallback chains. Configuration persists in the tier-router settings namespace and survives restarts (pass sessionOnly: true for a transient change).
  • WebUI settings: the Tier routing settings page configures providers, models, reasoning effort, follow-session behavior, fallback chains, routing mode, and the subagent policy. It uses the live model catalog when available and preserves custom routes when it is not.
  • Per-tier fallback chains: if the primary model is unavailable (unknown model, quota, rate limit, missing/invalid credential, server/transport error, or any status >= 500 failure), the router changes route at the supported request-error boundary and retries the same step on the next entry. Remove every entry to disable fallback. Fallback state is per agent and tier, returns to the primary after the fallback TTL (default 5 min, state.fallbackTtlMs), and never crosses from a cheap chain to a strong chain during a plan transition.
  • Task-intensity reasoning effort: the strong tier follows your session model selection by default (/tier set strong follow-session); the cheap tier starts at medium and raises itself to high/max (bounded by the model's declared efforts, e.g. deepseek models declare off/high/max) on cheap-tier retry errors, high-impact guard denials, or the tier_escalate_effort tool; /tier effort <medium|high|max> sets it manually. tier_configure and /tier set validate every effort against llm.resolveModelInfo when metadata is available.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-blue-whale 下一个 Next dsh-kanban-flow →