Introduction

When using pure text models like DeepSeek in the web version of DSH, image input may fail the model capability check, making it difficult for messages with images or image content to enter the model. dsh-vision-bridge is used to solve this problem. It is a DSH plugin maintained by 342949145 and is licensed under the MIT License.

Its function is to automatically hand over images to an external vision model (Alibaba Cloud Qwen-VL) for recognition before they enter the current model, and then feed the recognition results to the current model in text form, allowing pure text models to process image content.

This plugin only serves the web version of DSH, such as profiles/web/ under ~/.dsh. The desktop version of DeepSeek Harness EAC uses the built-in plugin dsh-tool-vision for image recognition, configured under the tool-vision namespace in %DSH_HOME%/settings.yaml, so there is no need to install this plugin; the two sets of configurations do not interact with each other.

Core Features

Image Upload Approval

The plugin wraps ctx.llm.resolveModelInfo to supplement the declaration of image input capability for the target provider’s model (default deepseek), allowing the model capability check to pass. The effect is that DeepSeek and other pure text model sessions can now attach images normally without the prompt “Current model does not support images”.

Automatic Image-to-Text Recognition

The plugin wraps the stream method of the target provider adapter. Before the message is serialized, it extracts image blocks one by one, calls the Qwen-VL Vision API for recognition, and then replaces them with text blocks. This covers scenarios such as images, read_image tool results, tool-result nesting, and history replay.

Model Fallback Chain

The vision model chain is:

qwen-vl-max → qwen-vl-plus → flash

Automatic fallback occurs when encountering recoverable errors.

Text-to-Image

When instructing the model to “draw…” or “generate an image…”, you can call Qwen-Image via generate_image to generate the image and save it as an attachment; the model can view the generated result.

Recognition Caching and Reuse

Recognition results are cached, and the API is not called repeatedly for the same image. Cache locations include memory and %DSH_HOME%/storages/, allowing reuse across sessions/restarts.

lib/vision.js also exports the following interfaces for reuse:

describeImageUrl
ocrPrompt
describeImagesCompare
dataUrlFor

They can be used in scenarios such as URLs, OCR, and multi-image comparison.

Installation and Activation

npm Installation

First, execute:

npm install dsh-vision-bridge

Then enable it in the DSH profile (e.g., ~/.dsh/profiles/web/). Add to the insert list in cordis.patch.yml:

- insert:
  - id: dsh-vision-bridge
    name: dsh-vision-bridge

You can also add dsh-vision-bridge to the dsh.profile.bundles list in package.json.

Local Development Mounting

For local development, you can use:

npm install link:./tools/dsh-vision-bridge
# or
npm link

Configuration

Minimal Configuration

You need to configure the Alibaba Cloud Qwen-VL API Key. You can copy .env.example to .env and write:

DASHSCOPE_API_KEY=sk-xxxxxxxx

This plugin does not include a real API Key or local paths; .env is already in .gitignore, so it is recommended to provide configuration via .env or environment variables.

Configurable Items

The plugin supports the following configuration items:

DASHSCOPE_API_KEY
DASHSCOPE_BASE_URL
VISION_MODEL
VISION_FALLBACK_MODELS
VISION_PROMPT
VISION_MAX_TOKENS
VISION_MAX_EDGE
VISION_JPEG_QUALITY
VISION_PROVIDERS
VISION_CACHE
VISION_GEN_MODEL
VISION_GEN_SIZE
VISION_SKILL_DIR

The configuration priority is:

Environment Variables > Plugin Directory .env > .env / vision.js in the directory pointed to by VISION_SKILL_DIR

If using the settings page integration, the runtime priority is:

Settings Page > Environment Variables > .env > claude-vision-skill

Conflict with dsh-tool-vision

If DSH has enabled the built-in dsh-tool-vision, you need to set the following in the tool-vision section of %DSH_HOME%/settings.yaml:

tool-vision:
  bridgeTextOnly: false

Otherwise, the new built-in plugin will replace the top-level image block in the session log with a text prompt; when disabled, this plugin completes the image recognition conversion at the adapter.stream layer.

Typical Usage

  1. Install and enable dsh-vision-bridge;
  2. Configure DASHSCOPE_API_KEY;
  3. If dsh-tool-vision is enabled, set bridgeTextOnly to false;
  4. Send an image in a DeepSeek session in the web version of DSH, or instruct the model to call read_image;
  5. The plugin automatically calls Qwen-VL for recognition and passes the text results to the current model.

You can also instruct the model to call generate_image, such as “draw an image…”, and the generated result will be saved as an attachment.

Applicable Scenarios and Notes

Suitable for scenarios where pure text models like DeepSeek are used in the web version of DSH and users wish to continue using image input, image recognition, or text-to-image. The desktop version of DeepSeek Harness EAC is not applicable to this plugin because it relies on dsh-tool-vision for image recognition.

This plugin runs with the permissions of the current DSH process. It is recommended to check the source code and license before installation. The verified DSH version is 0.1.0-rc.6; upstream DSH is in developer preview, so please keep an eye on the repository’s Release and Issues for any breaking changes.

Links

Directory page:

https://www.skillhub.cn/plugins/342949145/dsh-vision-bridge

GitHub:

https://github.com/342949145/dsh-vision-bridge