Introduction

When processing sessions containing images using text-only models within DSH, a common issue arises: images uploaded in chats must be persisted to disk. The native read_image may inadvertently include image chunks in text-only endpoint requests, whereas subsequent recognition requires calling a vision model. xiaoxianyu-office/dsh-image-tools is a DSH plugin package designed to equip text-only models like deepseek-v4-pro / deepseek-v4-flash with image recognition capabilities within sessions. It handles automatic disk persistence for uploaded images, dynamically disables the native read_image, and provides a conversational image_recognize tool to delegate to a vision sub-agent, such as xiaomi/mimo-v2.5.

Below, we introduce its positioning, core capabilities, installation steps, and precautions.

What is it

xiaoxianyu-office/dsh-image-tools is maintained by xiaoxianyu-office and is licensed under MIT. It mounts at the host layer, covering standard / code / minimal / cordis preset sessions, and dynamically determines whether to intercept or bridge based on the current model’s capability declaration in the session.

Core Features

  • Images sent in chat are automatically persisted to <workspace>/uploads/, and the message displays [Image] filename.
  • When the bridged model calls the native read_image, it is disabled and replaced with image_recognize.
  • image_recognize executes image recognition tasks in a conversational manner and can delegate to a vision sub-agent, such as xiaomi/mimo-v2.5.
  • Takes effect globally at the host layer and is applicable to standard / code / minimal / cordis preset sessions.
  • Dynamically determines whether to intercept/bridge based on the current model’s capability declaration in the session.
  • Provides a first-time installation wizard and automatic self-diagnosis for failures.
  • Image recognition output follows strict specifications: positions use pixel coordinates or explicit directions, colors use #RRGGBB hex values; content not in the image answers “not present in the image”, and when uncertain, answers “cannot confirm from the image” and explains the reason.

Installation and Activation

First, confirm the prerequisites: pnpm is required, and the model routes must already exist in the settings layer. The plugin only mounts the plugin line and does not create routes for you.

npm i -g pnpm

Install pnpm first; the subsequent plugin installation uses it.

Pre-set model routes in ~/.dsh/settings.yaml. The bridge declaration is only used to allow upload access; for example, add image to the input override for deepseek-v4-pro / deepseek-v4-flash.

# ~/.dsh/settings.yaml
# Bridge declaration: only used to allow upload access
deepseek-v4-pro:
  input: [ text, image ]
deepseek-v4-flash:
  input: [ text, image ]

This step only affects upload access and whether the plugin bridges the model. Do not manually write input declarations for truly multimodal models; removing the input declaration disables bridging for that model.

Configure the recognition model token in ~/.dsh/.credentials.yaml.

# ~/.dsh/.credentials.yaml
XIAOMI_API_KEY: <your-key>

Fill in XIAOMI_API_KEY here for use by the recognition sub-agent.

Execute the official installation command:

dsh plugin --profile web add -w github:xiaoxianyu-office/dsh-image-tools#v0.3.7

After execution, restart the dsh web service to make the plugin code take effect within the process.

Typical Usage

After the steps above, upload images in a bridged model session. The images will be automatically persisted to <workspace>/uploads/, and the message will display [Image] filename.

The bridged model should not call the native read_image. Calling it will disable it, and you should use image_recognize instead. image_recognize requires passing a targeted reading task, i.e., explaining what you want to obtain from the image.

When calling image_recognize again on the same image path, it automatically connects to the previous Q&A, allowing continuous follow-up questions.

If the old session history contains residual image messages causing a 400 error, open a new session.

Configuration and Upgrading

The config field in cordis.patch.yml supports the following configuration options:

uploadsDir: uploads
provider: xiaomi
model: mimo-v2.5

Here, uploadsDir is the image persistence directory relative to the workspace; provider is the model route for the recognition sub-agent; and model is the model for the recognition sub-agent.

When upgrading, repeat the execution of add and specify the latest tag; do not use update to select a Git reference:

dsh plugin --profile web add -w github:xiaoxianyu-office/dsh-image-tools#v0.3.7

The example uses the verified v0.3.7; for actual upgrades, replace it with the latest tag in the repository’s Releases.

After uninstalling, the plugin layer leaves no residue, but the routes and default models in settings.yaml need to be restored manually. ~/.dsh/image-tools-state.json is an optional cleanup item.

Applicable Scenarios and Precautions

Suitable for developers who need deepseek-v4-pro / deepseek-v4-flash to process images in DSH web sessions while retaining the native multimodal model chain.

Note the following points:

  • Requires pnpm; Node engines are ^22.19.0 || >=24.0.0.
  • peerDependencies include @deepseek-ai/cordis ^4.0.1, @deepseek-ai/schemastery ^3.18.1, and @deepseek-ai/dsh-tools ^0.1.0-rc.6.
  • The plugin runs with the current dsh process permissions; check the source code and MIT license before installation.
  • The host interface uses a loopback address + Host exact verification + random page token, and limits request methods: GET for read-only, POST for execution.
  • The bridge declaration is only used to allow upload access; after deleting the bridged model’s input override, uploads will be denied access.
  • The DSH community directory is an independent site with no official affiliation with DeepSeek / Hypersphere.

Links

GitHub: https://github.com/xiaoxianyu-office/dsh-image-tools

Directory Page: Verified data does not provide a verifiable directory page URL, so this article does not list specific links. It is based on the actual display in the DSH community directory.