dsh-model-pin
Manifest valid★ 1DeepSeek Harness plugin: keep every model request inside an allowed set per provider, redirect or refuse the rest, and warn when a request would make a llama.cpp router reload models
dsh-model-pin
A DeepSeek Harness plugin for machines that cannot afford model roulette: keep every model request inside an allowed set per provider, redirect the rest to a fallback (or refuse them), and get a warning whenever a request would make a llama.cpp router reload models.
The problem it fixes
dsh lets every chat pick its own model, and background helpers can request yet another one. On a machine that can only keep one local model loaded, each stray request either fails or evicts the loaded model: minutes of reloading, prompt cache gone (discussion #3199). Worse, subagents inherit the model their parent session was CREATED with, not the one it currently uses, so they quietly land on stale or wrong routes (#455, #1581).
dsh-model-pin enforces an allow-list at dsh's own resolution layer (the agent/request waterfall, whose documentation calls returning a replacement "the sanctioned switch path"). Every request from every session is resolved against the list at step boundaries: subagents, retries, and, once the pinned route is logged, session-title and compaction calls too. Persisted session data is never rewritten.
Install
dsh plugin --profile web add dsh-model-pin
Then in ~/.dsh/profiles/web/cordis.patch.yml:
- id: model-pin
config:
providers:
llamacpp:
allow: [qwen3.8-q4-long, qwen3.8-fast] # a one-entry list = single-model mode
fallback: qwen3.8-q4-long # default: the first allowed entry
action: redirect # redirect (default) | reject
warnOnSwitch: true
Unconfigured providers are never touched.
What it looks like
model-pin: llamacpp session=059a680f turn 3 redirecting qwen3.8 -> qwen3.8-q4-long (not in allow)
model-pin: llamacpp model switch qwen3.8-q4-long -> qwen3.8-fast (a --models-max 1 router reloads now; the previous model's prompt cache is lost)
With action: reject, a disallowed request fails the turn with a clear message instead (model-pin: model "x" is not in the allowed set for provider "llamacpp" (allowed: ...)), and dsh's retry never loops on it.
What you should know
- The web model picker does not know about the pin: it may keep displaying the model you clicked while every request actually runs on the fallback. The redirect line in the terminal (or /logs, if dsh-logbook is installed) shows what actually ran.
- The pin has the last word over the picker because it registers at profile load, before any agent exists (first-registered waterfall listeners are outermost in cordis). Another root plugin loaded before this one could still override it.
- The switch warning is observation only; it cannot block a reload. Pair it with a one-entry allow-list if you want reloads gone entirely.
- Cross-provider redirection is out of scope for v1: requests for a provider you did not configure pass through, including a subagent stuck on a deleted provider.
- Related work: dsh-model-switch is the opposite personality: a polished per-role model router with web UI panels, deliberately without global enforcement. dsh-model-pin is config-first, headless-friendly, and about restriction, not routing.
License
MIT
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.1.0 | — | — |
Comments
Loading…
From the same category
by Devin-AXIS
Enterprise-grade, local-first Agent Workbench for people and agent teams. A unified multi-engine workspace for Codex Harness, DeepSeek Harness, and OpenCode, with unified plugins and Skills, multi-age
★ 6.8k
↓ 424/wk
NOASSERTION
TypeScript
Oct 10, 2026
dsh plugin --profile web add deepseek-idesignby NanmiCoder
AgentTeams plugin for DeepSeek Harness
★ 2k
↓ 8.6k/wk
MIT
JavaScript
Oct 11, 2026
dsh plugin --profile web add @nanmicoder/dsh-agent-teamsby Clearailhc
ClearAI is a native DSH plugin that brings the Epistemic Loop to DeepSeek Harness.
★ 1.3k
↓ 889/wk
Apache-2.0
JavaScript
Oct 10, 2026
dsh plugin --profile web add clearai-dshby tong-io
Modality-First GenAI Platform
★ 1k
↓ 458/wk
AGPL-3.0
TypeScript
Oct 8, 2026
dsh plugin --profile agent add dsh-tongflowby LiPu-jpg
dsh-Openwrite:OpenWrite 的 DeepSeek Harness 小说创作插件,含统一创作 Agent、90 个小说工具、原生工作台与标准审稿 DAG
★ 811
↓ 1.4k/wk
Apache-2.0
TypeScript
Oct 10, 2026
dsh plugin --profile agent add dsh-openwriteA DSH plugin for novel writing and short-drama production, powered by Oh Story and Drama Skills.
★ 460
MIT