Introduction¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” When building agents with dsh, a common pain point is the mixture of task types: sometimes the model needs to read screenshots, perform OCR, or analyze images (requiring a vision model), while other times it only needs fast chat or code completion (using the default model). Manually switching models interrupts the workflow, while always using a vision model is costly and slow. dsh-model-auto-hot-switch aims to solve this issue by automatically distinguishing task types within the same session and enabling hot switching of models.
Plugin Purpose¶
This is a DSH plugin maintained by SHUJILAI, focused on automated routing for model inference scenarios. It does not rely on any official @deepseek-ai/* runtime packages and works solely through DSH’s agent/request extension point.
Core Features¶
- Image-aware automatic routing: The plugin checks whether each task step contains image blocks. If an image is detected, the task is automatically routed to a vision-capable model (for example,
deepseek-v4-flash-vision-exp); otherwise, the user-configured default model is retained. - Zero additional token consumption: The task classification logic is executed entirely in local code (by checking for the presence of image blocks). It does not invoke an additional classifier model, rewrite prompts, or duplicate requests.
- No context interference: Only the
providerandmodelfields in the request configuration are replaced. Message content, system prompts, and session state are not modified. - One-click control: Users can toggle the feature by clicking a floating button in the Web interface or by configuring the
enabledfield in the configuration file.
Installation and Enablement¶
Installing this plugin requires a DeepSeek Harness (dsh) Web profile.
# 从 npm 安装
dsh plugin --profile web add dsh-model-auto-hot-switch
# 或直接从 GitHub 安装
dsh plugin --profile web add github:SHUJILAI/dsh-model-auto-hot-switch
After installation, restart the dsh web service. A floating ⚡ button will appear in the lower-right corner of the interface. Click it to enable automatic hot switching. You can also modify the config.json configuration file and set enabled to true to control this feature.
Prerequisites¶
- DSH environment: You must be using
dshwith a Web profile. - Vision model: The provider catalog must include a vision-capable model (for example,
deepseek-v4-flash-vision-exp). The plugin automatically discovers such models viallm.listModels. - Tool gating: The gating for the
read_imagetool must be able to access the vision model listed above.
How It Works¶
During the agent/pre-step phase, the plugin checks whether the current step contains an image. If it does, the plugin replaces the model field in the configuration with a vision model during the subsequent agent/request phase; if it does not, the original configuration is returned. This design ensures that each task, including sub-agent sessions, can be routed independently.
Use Cases and Notes¶
This plugin is suitable for DSH users who need to handle mixed text-and-image tasks within the same session. Note that the plugin runs with the permissions of the current dsh process, so it is recommended to review the source code and license (MIT) before installing. It supports both Web and Headless profile modes, but in Web mode, state is managed through the /plugins/dsh-model-auto-hot-switch/state route.