dsh-custom-provider
dsh(DeepSeek Harness)Web 设置页扩展插件:新增「模型能力 / Model capabilities」设置分区(排在 Models 之后),补上官方 Models 页面不提供的能力编辑——
- 图片输入支持(逐模型)
llm-pi-ai路由:每个模型的input(目录路由写入modelOverrides.<modelId>外科覆盖,声明路由整表重写models);llm-deepseek路由:每个模型的inputModalities(与官方页面一致的整表重写语义)。
- Reasoning effort 映射
llm-pi-ai:每个模型的reasoningEfforts—— 勾选的等级会出现在模型选择器中,其值是请求发送到线路的拼写;off可留空(发送该等级时不上传参数);false= 声明非推理模型。另提供路由级默认 effort(写入路由的reasoning字段,off/minimal/low/medium/high/xhigh/max,off= 不设置默认)——设置后模型选择器不再显示「不发送参数」的 Default 项,选模型时默认即该档;不支持该档的模型自身仍回退为 Default。llm-deepseek:effort 集合固定(off/low/high/max)且适配器把thinking/reasoningEffort锁定在路由级(部署级设置),无法逐模型设置——此页提供路由级字段并注明该限制;逐模型映射请使用 pi-ai 路由。
- 子代理模型(页面顶部卡片,全部下拉选择,不手填)
- 委派时模型自选:启用后
subagent工具增加可选provider/model/reasoning_effort参数并注册list_subagent_models工具,每次委派可从白名单自选; - 默认模型(静态
agentOptions):为所有未自选模型的子代理固定一条 provider/model/reasoningEffort/maxTokens 路由,并覆盖从父会话继承的路由。
- 委派时模型自选:启用后
只显示已激活的路由;休眠(未配置)路由隐藏并在顶部提示隐藏条数。写入走官方 Models 页同一 wire(settings.mutate path ops + namespace revision 围栏),两页共存不冲突,保存即生效无需重启。
安装
dsh plugin --profile web add "github:homily707/dsh-custom-provider"
# 本地开发:dsh plugin --profile web add link:<本仓库检出路径>
dsh plugin add 只管依赖,装完还需把 dsh-custom-provider 加进 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 数组才会被加载。重启 dsh web(或 dsh --profile web)后刷新页面,设置面板即出现「模型能力」分区。
工作方式
- 浏览器半侧(
client.js)以window.__ModuleLoader__.load({id, factory})的 lazy-CJS 工厂格式手写,经dsh.client/exports["./client"]由 client-modules 半侧扫入 boot graph,从/plugins/dsh-custom-provider/client.js提供,无需重建 Web app;注册进settings.sectionlist slot。 - Host 半侧(
index.js)注册GET/PUT /model-capabilities/subagentwebserver 路由:子代理卡片写入$DSH_HOME/cordis.patch.yml(home 级用户补丁层)中由本插件托管的标记块(# >>>/<<< dsh-custom-provider subagent (managed))——只改写标记块内内容,文件中其他手工条目与注释逐字节保留;写前整文件 parse 校验,写用 tmp+rename。web profile 的 patchReload 为live,保存后 dsh 热加载补丁行;其他 profile 需重启。仅对之后创建的会话生效。 - 取数:
api.llm.providers({})、ctx.settingsScope.describe()mirror、api.llm.models({})、remote.llm.listProviders+remote.session.modelCatalog(下拉选项)。 - 冲突(
settings-conflict)时提示收起重开;推送来的 invalidation 会自动刷新页面数据。
已知限制
- deepseek 路由无逐模型 effort 映射(适配器锁定在路由级);pi-ai 逐模型字段只有能力映射,没有「每模型默认档」——默认档只有路由级一档。
- 子代理模型自选策略在会话创建时采样记录,改动只对之后的新会话生效。
- loader patch 的
config是整键替换,托管块全量重声明dsh-base的tool-subagent基线;dsh 升级若改变基线需同步index.js的BASE_TOOL_CONFIG。
English
A dsh (DeepSeek Harness) web Settings extension adding a "Model capabilities" section: per-model image-input support and reasoning-effort mapping for llm-pi-ai / llm-deepseek routes, plus a dropdown-driven subagent delegation-model card (fixed default agentOptions and/or a per-delegation allow-list) that manages a marker block of $DSH_HOME/cordis.patch.yml. Writes go through the same settings.mutate wire as the Models page, so both coexist; saves hot-apply on the web profile.
License
MIT
No comments yet. Be the first to write one.