Skip to content

ximengxiaolan/dsh-vision-bridge

30Last commit Aug 14, 2026

dsh-vision-bridge DSH plugin

dsh-vision-bridge patches DSH to allow pasting images into the input box for pure-text models. It intercepts image attachments before sending to the LLM, calls an OpenAI-compatible vision model to generate a text description, and replaces the image with that description. The image is still displayed in the chat for user reference.

How to install the dsh-vision-bridge DSH plugin

dsh plugin --profile web add dsh-vision-bridge

Copying does not run this command. Review the repository and version before installing the dsh-vision-bridge DSH plugin.

dsh-vision-bridge DSH plugin data source

dsh-vision-bridge DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-vision-bridge DSH plugin can do

  • Automatically detects and converts pasted images to text descriptions using a configured VLM.
  • Caches descriptions per image (by attachmentId) within the same process to avoid redundant API calls.
  • Gracefully degrades on VLM failure: shows an error message instead of breaking the conversation.
  • Supports configuration of API key, base URL, model, and language via environment variables or profile YAML.
  • Passes through original images when the routed model natively supports image input.

Where the dsh-vision-bridge DSH plugin fits

  • Send images in conversations with pure-text models like DeepSeek V4 or V4-Flash.
  • Get visual understanding without switching to a multimodal model.
  • Avoid repeated billing for the same image by caching descriptions.
  • Use any OpenAI-compatible VLM (e.g., qwen-vl-max, GLM-4V) for image recognition.

Who the dsh-vision-bridge DSH plugin is for

  • Users of DeepSeek V4/V4-Flash or other pure-text models who need to include images in their prompts.
  • Developers who want to integrate visual capabilities into DSH without changing the underlying model.

dsh-vision-bridge DSH plugin limitations

  • Requires a self-hosted or third-party OpenAI-compatible vision model API key and base URL.
  • Subagent conversations do not support image pasting due to DSH kernel restrictions.
  • Accuracy of the description depends on the selected VLM; may produce incorrect or incomplete descriptions.

dsh-vision-bridge DSH plugin: from the repository README

Quoted from the ximengxiaolan/dsh-vision-bridge README, the upstream source of the dsh-vision-bridge DSH plugin. Copyright remains with the original authors.

让纯文本模型(DeepSeek V4 / V4-Flash)在对话里"看见"图片:**在输入框直接粘贴图片并发送,插件自动调用一个 OpenAI 兼容的视觉模型(VLM)把图片识别成文字描述,再把描述喂给 DeepSeek 继续处理。** 会话中图片照常显示;只有发给模型的内容变成文字。 ## 原理 DSH 对纯文本模型会在提交时拒绝图片(`MODEL_DOES_NOT_SUPPORT_IMAGES`)。本插件打通两个官方扩展点: 1. **准入放行**:给 `ctx.llm.resolveModelInfo` 打补丁,声明当前模型支持 `image` 输入,让图片附件能进入会话。 2. **发模型前转换**:包装 `llm.streamWithRegistration`,每次请求发往模型前扫描所有消息中的图片块,调用配置的 VLM 生成文字描述,替换成: ``` [用户附上的图片已由视觉模型自动识别(qwen-vl-max)] <描述内容> ``` 如果路由到的模型**原生支持图片**,则放行原图、不做转换。 ## 安装 ```sh # 前置:dsh CLI 与 pnpm dsh plugin --profile web add dsh-vision-bridge # 或从 git 安装: dsh plugin --profile web add https://github.com/<your-name>/dsh-vision-bridge ``` 安装后重启 profile(`dsh web`)。 ## 配置 唯一需要的是一个 **OpenAI 兼容多模态模型**(`/chat/completions` + `image_url`),例如阿里云百炼 `qwen-vl-max`、智谱 GLM-4V 等。 环境变量: ```powershell $env:VISION_API_KEY = "sk-..." $env:VISION_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1" $env:VISION_MODEL = "qwen-vl-max" $env:VISION_LANG = "zh" # zh | en ``` 或在 profile 的 `cordis.patch.yml` 中配置(优先于环境变量): ```yaml - id: dsh-vision-bridge config: apiKey: 'sk-...' baseURL: 'https://dashscope.aliyuncs.com/compatible-mode/v1' model: 'qwen-vl-max' lang: z

Read the full READMERepository license: MIT

dsh-vision-bridge DSH plugin questions

What models does dsh-vision-bridge work with?

It works with any model that DSH routes to, but it is specifically designed for pure-text models like DeepSeek V4 and V4-Flash. If the model natively supports images, the plugin passes through the original image without conversion. The visual model used for description must be OpenAI-compatible (e.g., qwen-vl-max, GLM-4V).

How do I configure the vision model?

You can set environment variables like VISION_API_KEY, VISION_BASE_URL, VISION_MODEL, and VISION_LANG. Alternatively, add the configuration under the plugin's config in cordis.patch.yml. The base URL must point to an endpoint that supports /chat/completions with image_url.

Does it cache image descriptions?

Yes, within the same process, descriptions are cached by the attachmentId of the image. This means if you send the same image multiple times, the plugin will reuse the previous description and not call the vision model again, saving cost and time.

What happens if the vision model fails?

If the VLM call fails for any reason (timeout, error, etc.), the plugin will not break the conversation. Instead, it replaces the image with a text like '[Image recognition failed: reason]' so you can continue the dialogue.

Can I use this plugin with subagents?

No, subagent conversations are still subject to DSH kernel restrictions and do not support image pasting. This plugin only works in the main chat interface.