dsh-plugin-modality-fallback
在终端中运行以下命令:
dsh plugin install lilei0311/dsh-plugin-modality-fallback
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在终端执行 dsh plugin install lilei0311/dsh-plugin-modality-fallback 即可将插件(源码地址:https://github.com/lilei0311/dsh-plugin-modality-fallback)安装到当前 dsh profile 中,安装后在 cordis.patch.yml 里配置回退路由即可生效。
插件介绍
Running multimodal conversations in dsh has a small but recurring friction point: the entire session is locked to a single model, and if that model does not declare image-input support, the moment an image appears in the conversation history the built-in read_image tool refuses outright while ApiProxy blocks the outbound send. The usual workaround is switching the entire session to an image-capable model, which means surrendering the specific model chosen for code generation, long-form reasoning, or any other non-visual task in the same conversation.
dsh-plugin-modality-fallback takes a narrower approach: leave the session alone, redirect only the single request that actually needs the missing modality. The plugin hooks into the dsh request waterfall and, before a message is dispatched, inspects the session-derived history for content that exceeds the resolved model declared input modalities (currently images). When a mismatch is found and a fallback route is configured, it swaps provider and model for that one request only. Once the request completes, the session original model selection is untouched; subsequent requests resolve normally as soon as the image scrolls out of context or the user changes models. No core deepseek-harness code is modified; this is a standard Cordis plugin that loads alongside the rest of the composition.
If the dsh workflow mixes visual-understanding tasks with work that benefits from a specific model reasoning or coding strengths, and bouncing between two models every time an image shows up feels like unnecessary overhead, this plugin removes that friction. Configuration is a single modality-to-model mapping in cordis.patch.yml; the routing hook handles the rest automatically.
使用场景
- 会话中插入了图片但当前模型不支持图像输入时的自动单请求降级
- 避免为处理一条含图消息而切换整个会话模型设置
- 多模态按需分配,非视觉请求继续使用首选模型保持输出风格一致
适合人员
- 在 dsh 中混合使用图像理解与纯文本推理的对话用户
- 需要按请求粒度而非会话粒度管理模型能力的 dsh 管理员
- 希望在不修改 deepseek-harness 核心代码的前提下扩展多模态路由的开发者