# @blue/dsh-image-model-router [English](README.md) · [简体中文](README.zh-CN.md) 一个 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件:**仅当用户消息包含图片时**,将 agent 请求路由到视觉模型;纯文本消息则保持原模型不变。 - 纯文本回合保持你的常规模型(例如 `deepseek-v4-pro`)。 - 携带图片的回合(截图、照片、图表)被路由到多模态模型 —— 默认 `deepseek-v4-flash-vision-exp`。 - 按 agent、按 step 生效:标志位用 `WeakMap` 以 agent 对象为键存储,因此绝不会跨 agent 或跨回合泄漏。 ## 安装 ```bash dsh plugin --profile web add @blue/dsh-image-model-router ``` 该行**默认禁用**,因此仅安装绝不会悄悄改变路由。在 profile 自身的 `cordis.patch.yml` 中启用它: ```yaml - id: dsh-image-model-router disabled: false config: provider: deepseek-official model: deepseek-v4-flash-vision-exp ``` 然后重启 profile(`dsh web`)并硬刷新浏览器。 ### 从 Git 检出安装(开发用) ```bash git clone https://github.com/Blue-2571/dsh-image-model-router.git cd dsh-image-model-router dsh plugin --profile web add . ``` ## 配置 | 键 | 默认值 | 说明 | | :--- | :--- | :--- | | `provider` | `deepseek-official` | 视觉请求路由到的 provider id。 | | `model` | `deepseek-v4-flash-vision-exp` | 视觉模型 id。任何 provider 已声明支持图片输入的路由均可。 | ## 工作原理 ``` 用户消息含图片 │ ▼ agent/pre-step (waterfall) ── 检测图片块 ──► 标记该 agent │ ▼ agent/request (waterfall) ── 已标记?──► 切换 provider/model,清除标记 │ ▼ 视觉模型作答 ``` 图片检测会像 harness 自身的图片策略一样递归遍历嵌套的 `tool-result` 内容,因此由工具结果产生的图片同样被视为图片输入。 ## License MIT