Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture. The official API currently provides only text models and lacks vision capabilities. dsh-plugin-vision registers the vision_describe tool, allowing the main model to call any OpenAI-compatible vision API to describe images. This addresses the need to process images when the main model does not have a native vision model.
Installation¶
Use the official installation script to attach the plugin to the corresponding profile.
git clone https://github.com/MoneShadow/dsh-plugin-vision && cd dsh-plugin-vision
./install.sh # 安装到 web profile
./install.sh headless # 安装到其他 profile(如 headless 模式)
The script automatically detects the DSH installation location, copies the plugin files to the global dependency tree, and creates symbolic links.
Note: Do not use the
dsh plugin add file:command to install this plugin. This injects a copy of the@deepseek-ai/dsh-toolsdependency into the profile, conflicts with the global dependency tree, and causes tool call crashes (Cannot read properties of undefined (reading 'prepare')). You must use the installation script above.
Configuration¶
Edit ~/.dsh/settings.yaml and add or modify the vision: section at the end of the file.
vision:
enabled: true
autoPath: true # 桌面端粘贴图片自动转路径(DSH Desktop 功能)
baseURL: https://api.openai.com/v1 # 任意 OpenAI 兼容服务地址
apiKey: "" # 视觉模型 API 密钥
model: gpt-4o-mini # 视觉模型名称(如 qwen-vl-max)
timeoutMs: 60000
cache: true # 启用答案缓存
cacheTtlSeconds: 3600 # 缓存有效期(秒)
cacheMaxEntries: 200 # 缓存条目上限(LRU 淘汰)
After saving, the engine automatically watches for file changes and hot-updates the configuration without a restart.
Core Features and Usage¶
1. Tool Registration and Invocation¶
The plugin runs on the engine side and registers the vision_describe tool with the global Agent.
The main model can directly call this tool during a conversation, passing an image argument:
vision_describe(image, prompt?)
Supported image sources include:
* Local file paths
* file:// protocol paths
* http(s) URLs
2. Answer Caching¶
To reduce API consumption, the plugin includes a built-in answer caching mechanism.
* Cache key: image content hash + endpoint URL + model + prompt content.
* Behavior: When the same image and prompt are requested again, the cached result is returned directly without making a duplicate request to the vision API.
* Error handling: Failed descriptions are not cached.
* Policy: Based on TTL (time to live) and LRU (least recently used) eviction.
3. Configuration Toggle¶
When enabled: false, the vision_describe tool is still registered, but it returns an explicit informational message. Upon receiving the message, the main model typically guides the user to enable the feature.
4. API Key Security¶
API keys are stored with the secret role and are not visible in the official settings interface (write-only), preventing plaintext leakage.
Integration with DSH Desktop¶
Note: The “automatically convert pasted images to paths” feature is implemented by DSH Desktop and is not part of this plugin.
DSH plugins run on the engine (dsh process) side and cannot detect browser paste events. DSH Desktop injects a patch into the official UI iframe, listens for paste operations, saves the image to disk, and automatically inserts [图片] /real path. The main model then calls this plugin’s vision_describe tool to view it.
The autoPath field in the configuration is read by DSH Desktop and controls this behavior. If DSH Desktop is not installed, you must manually pass the image path/URL to the tool.
Notes and Dependencies¶
- Dependencies: This plugin depends on
@deepseek-ai/dsh-toolsand@deepseek-ai/schemastery(both under the MIT License). - Official API limitation: DeepSeek’s official API currently has no vision models; you must use a third-party OpenAI-compatible service (such as Tongyi Qianwen, Zhipu, SiliconFlow, etc.).
- Troubleshooting: If, after installation, any tool call (including bash) causes the engine to crash, check whether you inadvertently used
dsh plugin add file:to install the plugin, then reinstall it or uninstall it and reinstall it according to the installation script instructions.