Introduction¶
The DeepSeek Harness (DSH) plugin ecosystem allows developers to extend functionality through plugins. When configuring a local vLLM model (for example, Qwen 3.8 27B) as a vision model backend, a common issue arises: vLLM’s default parameter --limit-mm-per-prompt image=1 limits each request to include only one image. However, the LLM adapter built into DSH restricts images only by byte size, not by count. As a result, when a conversation contains multiple images across turns, or when a tool call returns multiple images, the backend directly returns a 400 error.
The dsh-vision-3090-fix plugin is designed specifically to solve this problem. It runs as a local HTTP reverse proxy and, before forwarding a request to the backend, replaces extra images with text placeholders, thereby bypassing the backend’s count limit.
Plugin Overview¶
This is a DeepSeek Harness plugin that sets the maximum number of images per single request to 1 for a self-hosted vLLM backend. It does not modify backend logic; instead, it intercepts requests and rewrites their content at the proxy layer.
Core Features¶
- Limit image count: Forces the number of images in each request to be limited to a specified maximum (default is 1).
- Local reverse proxy: Launches as a standard Cordis plugin and runs inside the DSH process.
- Placeholder replacement: Replaces older images beyond the limit with stable text placeholders.
- Supports streaming responses: Preserves the streaming characteristics of backend responses and forwards them byte by byte.
- Cross-message processing: Supports handling
image_urlcontent parts in themessagesarray and in tool calls.
Installation and Enabling¶
Use the following command to install the plugin into the specified DSH configuration profile:
dsh plugin --profile web add /path/to/dsh-vision-3090-fix
After installation, you need to configure the basic proxy parameters in cordis.patch.yml and change the provider’s baseURL to point to this proxy.
- Configure
upstreamOrigin,listenHost,listenPort,maxImagesPerRequest, andmodelsincordis.patch.yml:
- id: vision-3090-fix
name: dsh-vision-3090-fix
config:
upstreamOrigin: http://10.204.100.243:1234 # 真实后端地址,不含路径
listenHost: 127.0.0.1
listenPort: 8931
maxImagesPerRequest: 1 # 匹配你的服务器 --limit-mm-per-prompt 参数
models: [qwen3.8-27b] # 可选,不填则对所有模型生效
- Modify
settings.yamlto point the provider’sbaseURLto the proxy address:
llm-pi-ai:
providers:
pure:
displayName: pure
apiKeyEnv: PURE_API_KEY
api: openai-completions
baseURL: http://127.0.0.1:8931/v1 # 指向本地代理
models:
- id: qwen3.8-27b
Use Cases and Notes¶
- Use cases: Self-hosted vision model environments where vLLM is deployed and
--limit-mm-per-prompt image=1is set. - Notes:
- The plugin fully buffers the request body before forwarding (to parse and rewrite the JSON), so it is not suitable for handling large file uploads.
- There is no retry logic or request queueing mechanism; it is a lightweight pass-through proxy.
- It assumes the backend uses OpenAI’s
image_urlline format; if the backend format is different, the plugin will not recognize it. - The plugin will not crash the proxy due to timeouts; timeouts are logged and the current request is terminated.
- Check the source code and license (MIT) before installation.
Summary¶
dsh-vision-3090-fix provides a low-cost way to resolve the image-count conflict between DSH and restricted backends without modifying the vLLM server configuration.