New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

dsh-autotier

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsh-autotier

Automatic strong/cheap model-tier routing for DeepSeek Harness: intent-gated tier landing on the agent/request waterfall, plan-mode handoff (strong plans, cheap implements), deterministic high-risk guards on tools/pre-execute, failure escalation with TTL

latest
Source
npmnpm
Version
0.2.16
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

dsh-autotier

English | 简体中文 | Español | Português | हिन्दी

Automatic model-tier routing for DeepSeek Harness: one user instruction enters, one tier decision comes out — no manual model switching.

Gitee OpenSSF Scorecard License DSH plugin dsh-doctor DSH Market Node CI Version dshfind

Complex intent (architecture, planning, debugging, multi-step engineering) is planned on the strong tier and then implemented on the cheap tier. Simple intent (questions, retrieval, batch chores, daily work) is designed and implemented on the cheap tier directly. While the cheap tier executes, high-risk tool calls are denied by a deterministic guard, and repeated failures escalate to the strong tier with a TTL fallback.

  • Official repository: https://github.com/PerryLink/dsh-autotier
  • npm: dsh-autotier (bare, unscoped)

📖 Ecosystem knowledge base — measured data, not marketing: plugin development guide · plugin-selection data · maintenance criteria.

⭐ 如果它帮到了你

这个插件是 DSH 插件家族的一员(40+ 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。

English: part of a 40+ plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.

What is dsh-autotier?

npm channel

git channel

Terminal demo of dsh-autotier: dsh-autotier — install, then the documented tier defaults behind /tier

Animated terminal demo of dsh-autotier

The same run, animated.

Compatibility

HarnessStatus
@deepseek-ai/dsh 0.1.2-rc.1no longer supported; that line predates the SettingsForms contract this plugin now targets
@deepseek-ai/dsh 0.1.5-rc.2no longer supported; the settings.register / settings/updated contract it exposes was removed upstream
@deepseek-ai/dsh 0.1.6-alpha.2no longer supported; same removal, first line to ship SettingsForms
@deepseek-ai/dsh 0.1.7-rc.2required; verified against the matching checkout (typecheck) and the published packages (typecheck:ci, 214 tests)
@deepseek-ai/cordis ^4.0.3, @deepseek-ai/cosmokit ^1.8.4, @deepseek-ai/schemastery ^3.18.3peer baseline

Peer ranges name all published lines explicitly (>=0.1.6-0 <0.2.0 || >=0.2.0-0 <0.3.0 || >=0.2.1-0 <0.3.0), because a semver range whose only prerelease comparator sits on an earlier version tuple does not admit a later alpha. They are refreshed per published wave. The declared range is deliberately wider than the verified one: it documents what the manifest accepts, not what has been tested.

This release is a breaking adaptation. The 0.1.6-generation harness removed the settings provider seam this plugin was built on: the @deepseek-ai/dsh-settings-file package is gone, ctx.settings is now SettingsForms (a schema→form projector, with no register), and settings/updated no longer exists. There is no shared surface that lets one plugin observe another plugin's settings document, so no version of this plugin can support both contracts at once. Configuration now flows through the host's volatile-config mechanism, and the per-session routing mode — the setting that actually changes behaviour at runtime — is unchanged.

The plugin is host-plane only. It needs no agent preset of its own: the host row applies to every session. A one-line prompt section in your preset is optional and only makes the router's decisions visible to the model (see Install & uninstall).

What you get

  • Intent gate — every turn is classified from deterministic signals (message text, tool names, image presence, conversation length). The zero-token rule layer decides when it is confident; only a low-confidence turn calls the cheap judge model, and never on a cooldown.
  • Tier landing on the official seam — the decision is applied on the agent/request waterfall by returning a replacement provider/model/effort triple. Sampling scalars the session already chose (temperature, maxTokens, stop) are preserved.
  • Plan-mode handoff — a complex instruction enters plan mode on the strong tier; leaving plan mode drops back to the cheap tier for implementation.
  • High-risk guard — while the cheap tier executes, destructive commands (rm -rf, sudo, mkfs, git push --force, credential-file writes, …) are denied with a corrective message telling the model to escalate instead.
  • Failure escalation — repeated failures (optionally same-signature) raise the tier for a TTL; a model/route failure walks the configured fallback chain.
  • Manual escape hatches — /tier auto|strong|cheap|off and the tier_status / tier_route tools. Setting routingMode: delegated (or /tier off) stops routing for a session that must keep its own model.
  • ctx.autotier service — a small read surface (status) plus the autotier/route veto waterfall and autotier/tier-changed event, so other plugins can observe or override a decision.

Quick start

dsh plugin --profile web add github:PerryLink/dsh-autotier
dsh plugin --profile web add dsh-autotier
npm i -g dsh1024
dsh1024 plugin --profile web add dsh-autotier

Then start (or restart) the harness. The row is appended to your profile's cordis.patch.yml; routing starts on the next turn with no further setup.

Install & uninstall

npm channel

dsh plugin --profile web add dsh-autotier
npm i -g dsh1024
dsh1024 plugin --profile web add dsh-autotier

git channel

dsh plugin --profile web add github:PerryLink/dsh-autotier
git clone https://github.com/PerryLink/dsh-autotier.git
cd dsh-autotier && pnpm install && pnpm run build
dsh plugin --profile web add .

Optional preset prompt section. The router works without it. To let the model know which tier it is running on, add one row to your agent preset (docs/preset-row.md has the exact block):

- insert:
    - id: autotier-prompt
      name: '@deepseek-ai/dsh-system-prompt'
      # sections: [...]  — see docs/preset-row.md

Uninstall

dsh plugin --profile web remove dsh-autotier

The row, its command, its tools and its listeners are all removed with the plugin. Configuration a user saved through the Plugins page lives in the active profile patch and belongs to that profile, not to this plugin; removing the row leaves it there untouched.

Configuration

Every key is validated at load time; an invalid value fails loudly instead of silently disabling routing. cordis.patch.yml in this repository documents the same keys inline.

KeyDefaultMeaning
tiers.strong.providerdeepseek-officialProvider for the planning/review tier.
tiers.strong.modeldeepseek-v4-proCatalog id of the strong model.
tiers.strong.efforthighAdapter vocabulary off | low | high | max.
tiers.strong.followSessionfalsefalse = this tier's effort overrides the session's.
tiers.strong.fallback[]Ordered provider/model landings when the tier is unavailable.
tiers.cheap.providerdeepseek-officialProvider for the implementation tier.
tiers.cheap.modeldeepseek-flashCatalog id of the cheap model.
tiers.cheap.effortlowAdapter vocabulary off | low | high | max.
tiers.cheap.followSessiontruetrue = inherit the session's effort so an explicit choice wins.
tiers.cheap.fallback[]Ordered provider/model landings when the tier is unavailable.
tiers.vision.providerdeepseek-officialProvider for image-carrying turns.
tiers.vision.modeldeepseek-flashThe catalog's image-capable model.
intent.ruleThreshold0.7Confidence at or above which the rule layer decides alone.
intent.attemptBand.enabledfalseStart the middle band on the cheap tier and escalate on a signal.
intent.attemptBand.tauLow0.45Lower bound of the attempt-first band.
intent.hysteresis.toStrong0.8Score that switches a cheap turn to strong.
intent.hysteresis.toCheap0.6Score below which a strong turn returns to cheap.
intent.rules[]Declarative rule table (when.patterns / when.tools / when.cwd, tier, priority).
intent.judge.enabledtrueAllow the low-confidence judge.
intent.judge.model''Judge model id; empty = first catalog model containing flash.
intent.judge.temperature0Judge sampling temperature.
intent.judge.maxTokens16Judge output cap (it answers with one word).
intent.judge.cooldownMs30000Minimum gap between two judge calls.
intent.judge.timeoutMs2000Judge call timeout.
intent.judge.unavailableSkip2Consecutive judge failures after which the turn skips it.
intent.scenariosall truePer-scenario switches: coding, review, planning, retrieval, batch, daily, longText, multimodal.
intent.costModebalancedAmbiguity arbitration: cost-first | quality-first | balanced.
guard.enabledtrueEnable the deterministic high-risk guard.
guard.tiers[cheap]Tiers the guard protects.
guard.whitelist[]Commands, tools or path prefixes that never trip the guard.
guard.protectedPaths['.dsh','AGENTS.md','package.json','.github/workflows']Self-modification surfaces that force strong-tier review.
guard.interopDefendautoRelationship with dsh-defend: auto audits coexistence, none stays silent.
escalation.threshold2Failures within the window that raise the tier.
escalation.windowMs60000Failure-counting window.
escalation.ttlMs180000How long an escalation stays in effect.
escalation.fallbackTtlMs300000TTL used after a fallback landing was taken.
escalation.signaturetrueCount same-signature recurrences instead of every failure.
routingModeautoauto | strong | cheap | delegated | off.

All keys can also be edited live from the plugin's card on the Plugins page; the Host validates the new value against the schema and commits it with loader/volatile-update, and this plugin then re-judges the whole configuration through the same cross-field judge the mount path uses. A value that violates a cross-field requirement (two tiers landing on the same route, a hysteresis pair that cannot stop flapping, a rule with neither a pattern nor a tool) leaves the last good policy routing instead of swapping in something unroutable.

routingMode is the one key that is not live: it is the composition default, and the runtime switch is the session-scoped override written by /tier, the composer pill and the card's selector. Making it live as well would give the same behaviour two owners.

Tools & surfaces

SurfaceKindPurpose
/tiercommandauto | strong | cheap | off | status; session-scoped override.
tier_statustoolCurrent tier, mode, escalation TTL and guard state.
tier_routetoolRoute one intent string without sending a request (dry run).
ctx.autotierservicestatus() read surface for other plugins.
autotier/routeserial eventThird parties may veto a proposed tier.
autotier/tier-changedemit eventObservability when the effective tier changes.

Permissions & data

  • Files — the plugin reads no file and writes none. Configuration is the host's: a value saved on the Plugins page is persisted by the Host into the active profile patch, and this plugin only reads the live snapshot it is handed.
  • Network — the only outbound traffic is the judge call, which goes through the normal ctx.llm path and the configured provider.
  • Session log — the plugin appends no custom session events. The routing trail is the plugin logger plus the live autotier/tier-changed bus event; the only append it makes is the plan/mode fallback when the plan-mode service is absent. Custom event types are fail-closed on 0.1.2-alpha.1 and later, so no durable plugin-owned record is written.
  • Secrets — no credential is read, logged or stored by this plugin.

Security boundaries

  • The guard is a defence in depth, not a sandbox. It denies the patterns it knows on the cheap tier and never weakens dsh-defend, the approval service, or the sandbox policy. Keep those enabled.
  • The guard protects only the tiers listed in guard.tiers (cheap by default). A strong-tier turn is not blocked by design: the strong model is the reviewer.
  • If the guard itself throws, the call is escalated to the strong tier rather than allowed — a broken guard must not become an open door.
  • /tier off disables routing entirely; the harness then behaves exactly as it did before the plugin was installed.

Known limitations

  • The rule layer is deterministic and therefore finite: a novel phrasing of a complex request may start on the cheap tier and escalate only after a failure or a guard denial. The judge call covers the low-confidence middle.
  • Escalation is per-agent and in-memory; a harness restart starts from auto.
  • Tier switching resets the provider prompt cache for the changed request, so very chatty sessions may see a small cache-miss cost on the switch turn. The hysteresis thresholds exist to keep that rare.
  • The plugin routes conversation requests. Compaction and title generation are separate host seams; align their own model settings with the cheap tier if you want the same cost profile (docs/supporting-lanes.md).
  • followSession: true on the cheap tier means an explicit session model choice wins; in that case the cheap tier cannot force its own model.
  • The Settings card and composer tier pill shipped in 0.2.0. The card (routing mode, live tier landings, model catalog) lives in the Plugins settings section and the pill cycles the session mode from the composer.
  • A model picked in the GUI is not detected automatically. The router does not watch the agent-default-model document, so switching models there does not by itself stop routing — use routingMode: delegated or /tier off.
  • Fingerprint posteriors are in-memory. They reset on restart and re-learn from the judge's cold-start fallback; persisting them through the settings document is planned for v0.2.
  • The attempt-first middle band ships disabled. intent.attemptBand.enabled stays false until the calibration corpus and its metric gate land (v0.2).

Development

pnpm install
pnpm run typecheck      # against the local harness checkout type faces
pnpm run typecheck:ci   # against the published 0.1.7-rc.2 faces (what CI runs)
pnpm test
pnpm run build
pnpm run verify:self-contained
pnpm run verify:artifacts
pnpm pack

pnpm run build emits lib/types (tsc declarations) and lib/index.js (tsdown bundle). Tests use the published host packages directly — real Context, real session/tools/commands services — plus one real Loader composition over a temporary cordis.yml. The settings service is the one stand-in: the host's real SettingsForms binds to configEditor, profileContext and the Loader's fiber graph, none of which this plugin consumes, while the plugin's whole contract with it is configure({ auto }) plus the Loader's loader/volatile-update event.

Interoperability with other DSH plugins

Verified against DSH 0.2.0-rc.2 (the runtime this README ships for) and the high-star plugin set surveyed on 2026-10-05.

This plugin does not interfere with other plugins, including the widely installed high-star ones:

  • No tool-name collision. Every tool is namespaced; no bare name owned by a shipped tool or another plugin is registered.
  • No service-key collision. It provides autotier; that key is not a built-in seam and is not provided by any surveyed high-star plugin.
  • No slot collision. It registers no client slot key, so it cannot contend for a shadows-shipped-ui seat.
  • No HTTP route collision. It registers no webServer prefix.
  • No patch-layer collision. The bundle patch only inserts its own row; it never overrides a built-in row's config.
  • No global mutation. It does not patch prototypes, rewrite process.env, or replace the global fetch dispatcher.

Shared event listeners are non-interfering by construction. It observes the ordering-sensitive events agent/created, agent/request, agent/request-error, tools/pre-execute with ctx.on() — Cordis's broadcast registration, where every listener runs and none can starve another. Every listener here delegates through next(), so the chain is never short-circuited, and a mutation is applied to the value next() produced rather than returned in its place:

  • agent/request — also used by dsh-agent-teams (1923★), which short-circuits by throwing without calling next().
  • tools/pre-execute — also used by cc-safety-net (1576★).

Static evidence: dsh-plugin-doctor K10–K13 report pass for every check on this repository.

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, router, model-tier, cost, auto.

Contributors

PerryLink. Issues and pull requests are welcome at https://github.com/PerryLink/dsh-autotier/issues.

Applicable DSH version: verified against dsh-v0.2.1-alpha.1 (the host release this build targets); requires >=0.1.7-alpha.1 <0.2.0.

This project is one of the 33 actively maintained DeepSeek Harness plugins from PerryLink — the roster is 42, of which 6 are frozen and 3 retired; every one keeps its row below, with the reason in the Status column. If this one helps you, the others likely will too:

PluginOne-linerStatus
dsh-auto-reviewSecond-model auto-review on the approval chain, fail-closed by default
dsh-autotierAutomatic strong/cheap model-tier routing with deterministic risk guards and a /tier command
dsh-background-agentsDurable background child agents with a Web UI sidebar, messaging and interrupt🚫 RETIRED — see the note above
dsh-budgetCost governance for DeepSeek Harness: budgets, carbon, and latency in one panel.🧊 FROZEN — see the repo README
dsh-catalogDSH Desktop Market standard catalog source for the PerryLink family
dsh-cert-mcpRead-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence
dsh-checkpoint-rewindClaude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-claude-moveMigrate Claude Code sessions, memory, skills and CLAUDE.md into DSH🧊 FROZEN — see the repo README
dsh-clickCross-platform native desktop control for DeepSeek Harness — Windows first.
dsh-composer-historyTerminal-style input history for the web composer: arrows, Ctrl+R search
dsh-data-qualityDataset quality checks and citation cross-checks (the optional numeric bridge consumed here)
dsh-defendPrompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness.🧊 FROZEN — see the repo README
dsh-doublecheckEngineering-discipline guard: requirements grill, test gates, adversary review
dsh-drawUnified static-image generation routing for DeepSeek Harness.🧊 FROZEN — see the repo README
dsh-fastRead-only performance diagnostics for DeepSeek Harness.
dsh-fund-researchDeterministic research reports for Chinese public mutual funds
dsh-githubGitHub PR/issues integration for DSH, every write gated by approval
dsh-industry-researchIndustry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble
dsh-layaLaya typed decisions (noul/choice/score) as a first-class Cordis service and model-visible tools
dsh-libraryLocal document knowledge base for DeepSeek Harness.
dsh-local-aiLocal-model (Ollama) integration for DeepSeek Harness.
dsh-lsp-actionsLSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-maskPII masking middleware: anonymize at the model boundary, restore at the display layer
dsh-mcp-panelRead-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-mementoApproval-gated cross-session memory: ctx.memory seam + SQLite + memory tool🧊 FROZEN — see the repo README
dsh-observeOpenTelemetry and Langfuse observability exporter for DeepSeek Harness.
dsh-output-stylesClaude Code outputStyles-equivalent runtime style switching
dsh-permission-rulesClaude Code-style declarative allow/deny/ask permission rules with audit
dsh-plugin-certificationCommunity certification registry with repro-checkable grades and badges
dsh-plugin-doctorZero-dependency static + sandbox smoke detector for DSH plugins
dsh-plugin-guidePlugin-development knowledge base as an on-demand agent skill
dsh-plugin-kitShared zero-runtime-dependency toolkit for the PerryLink DSH plugins
dsh-plugin-upgradeOne-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card
dsh-plugin-upgrade-015Merged 0.1.3-alpha.1 → 0.1.5-rc.1 upgrade corridor card plus a zero-dependency seam scanner🚫 RETIRED — corridors carried by dsh-plugin-upgrade
dsh-reachMulti-channel approval/question bridge: WeChat/Telegram/Feishu, session console🧊 FROZEN — see the repo README
dsh-research-reportVerifiable research-report engine: content-addressed evidence ledger and sealed versions
dsh-scoreMulti-dimensional quality scoring for DeepSeek Harness plugins.
dsh-session-pinPin sessions in the Web sidebar with durable ordering🚫 RETIRED — see the note above
dsh-session-syncCross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store.
dsh-skill-pack-securitySecurity-audit skill pack: secret scan, dependency and supply-chain review
dsh-talkVoice-first session loop for DeepSeek Harness: talk to it, hear it answer.
dsh-team-roomsCross-session team rooms: shared message bus, task board and timeline🚫 RETIRED — see the note above
dsh-test-driveIsolated install-and-smoke test drives for DeepSeek Harness plugins.
dsh-ticktickTickTick/Dida365 task bridge: session-header panel + 11 tools
dsh-translateVendor parameter translation and deterministic JSON repair for DeepSeek Harness.

License

Apache-2.0. See LICENSE and THIRD_PARTY_NOTICES.md.

Keywords

dsh

FAQs

Package last updated on 10 Oct 2026

Related posts