DeepSHPlugins
dsh-llm-vision-bridge 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-llm-vision-bridge

視覺與多模態JavaScriptMIT

DeepSeek 視覺橋接:註冊原生 LLM provider,聊天內貼上的圖片自動由視覺模型(pi-ai/llama.cpp 上的 Qwen3-VL)轉成文字描述後交給純文字 DeepSeek 作答——圖片准入、路由與會話壓縮全部走 harness 原生機制,帶 LRU 描述快取與 503 重試。

3 StarsEinskyle 更新時間 2026-08-14
訪問 GitHub 倉庫
dsh-llm-vision-bridge 專案預覽

專案介紹

中文

DeepSeek 視覺橋接:註冊原生 LLM provider,聊天內貼上的圖片自動由視覺模型(pi-ai/llama.cpp 上的 Qwen3-VL)轉成文字描述後交給純文字 DeepSeek 作答——圖片准入、路由與會話壓縮全部走 harness 原生機制,帶 LRU 描述快取與 503 重試。

English

Native LLM-provider vision bridge: images pasted in the chat are described by a vision model (Qwen3-VL via pi-ai/llama.cpp) and the text description is fed to text-only DeepSeek for the reply — image admission, routing and compaction all run through harness-native mechanisms, with an LRU description cache and 503 retry.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
Einskyle
倉庫
Einskyle/dsh-llm-vision-bridge
GitHub Stars
3
Forks
0
開發語言
JavaScript
許可證
MIT
最近推送
2026-08-14
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

55/ 100
維護活躍
81
文件與實用資訊
99
生態關注度
17
安裝便捷訊號
55
專案宣告訊號
100

README 含完整安裝與使用說明;關注度尚低(3)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

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

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

dsh-llm-vision-bridge

English | 中文

Awesome DSH Plugin

Let text-only LLMs (DeepSeek) "see" images in the dsh web GUI: paste an image into the chat and the plugin automatically routes it to a vision model (Qwen3-VL via your existing pi-ai / llama.cpp route), then feeds the resulting text description to DeepSeek, which continues the conversation as if it were a native multimodal model.

Features

  • Native LLM provider — registers deepseek-vision on the DSH LlmAdapter seam. Image admission, request routing, and session compaction all run through harness-native mechanisms; no UI changes, no front-end interception.
  • Zero overhead without images — image-free requests pass straight through to the fallback provider (default deepseek-official).
  • Vision-assisted replies — each image block is described by the vision model (attached user text is included in the prompt), then replaced with a [图片 N 描述] text block before the request reaches DeepSeek.
  • LRU description cache — the same image + prompt is never re-described; history replay and compaction do not re-run the vision model.
  • 503/429 auto-retry — tolerates the desktop GPU's single-card exclusive scheduling (vision gateway returns 503 while other tools occupy VRAM).
  • Configurable failure policy — placeholder (insert a failure note and continue) or error (fail the turn).

How it works

The chat composer natively supports image attachments: images enter the model request as {type:"image", attachment} content blocks. The DeepSeek chat-completions adapter rejects image blocks with UNSUPPORTED_CONTENT, so a text-only model cannot process them directly.

This plugin's bridge provider (deepseek-vision) declares inputModalities: ["text", "image"], which satisfies the host's image-admission check (MODEL_DOES_NOT_SUPPORT_IMAGES is otherwise thrown before the message ever reaches the agent). Inside its stream():

  1. No image → yield* ctx.llm.stream({ ...options, provider: fallbackProvider }) — passthrough, zero cost.
  2. Has image → for each image block, call the vision model via a nested ctx.llm.stream() against the configured vision provider (e.g. pi-ai's llama route; image bytes are read automatically by the attachment service), then replace the image block with a [图片 N 描述]\n<description> text block and forward the rewritten messages to the fallback provider.

Session compaction reuses the provider of the most recent request, so image-bearing history is also bridged automatically. The optional autoRoute setting (default off) additionally rewrites deepseek-official agent requests to this provider, but it cannot bypass the host's image-admission check — it is only a fallback. To actually send images, set the main model to deepseek-vision.

Install

# From GitHub (plain JS, no build step, no allowBuilds needed)
dsh plugin --profile web add github:Einskyle/dsh-llm-vision-bridge

# Or from the npm registry
dsh plugin --profile web add dsh-llm-vision-bridge

# Restart the web service
pnpm dsh web

Manual install without pnpm (equivalent):

  1. Copy this package into %USERPROFILE%\.dsh\profiles\web\node_modules\dsh-llm-vision-bridge\
  2. Edit %USERPROFILE%\.dsh\profiles\web\package.json:
  • add "dsh-llm-vision-bridge": "file:<absolute path>" to dependencies
  • add "dsh-llm-vision-bridge" to dsh.profile.bundles
  1. Restart the web service

Quick start

  1. Open Settings → Models: the new provider 「DeepSeek(视觉桥接)」 appears with models deepseek-v4-flash / deepseek-v4-pro.
  2. Set the main model to the bridge provider — agent-default-model.provider: deepseek-vision. This is required: the host's image-admission check reads the session-selected model's inputModalities, and only the bridge model advertises image.
  3. Paste/upload an image (PNG/JPEG/WebP/GIF) in the chat composer, optionally with a question, and send. The image is described first (10–40s including cold load), then DeepSeek replies from the description.
  4. Switch the main model back to deepseek-official any time for pure text (image uploads are then rejected by admission, as expected).

Configuration (Settings → Models → llm-vision-bridge)

FieldDefaultDescription
enabledtrueMaster switch; when off the bridge provider degrades to pure passthrough
autoRoutefalseAdditionally rewrite deepseek-official agent requests to the bridge provider (cannot bypass image admission; fallback only)
fallbackProviderdeepseek-officialThe text-only provider that actually generates the reply
visionProviderllamaVision provider route (pi-ai)
visionModel/models/qwen3-vl-4b-thinking/Qwen3-VL-4B-Thinking-Q4_K_M.ggufVision model id
visionPrompt(built-in Chinese prompt)System prompt for the vision model
visionMaxTokens2048Vision output cap (keep ≥1024; thinking consumes tokens)
visionRetries3Max retries for retryable errors (503/429/timeout)
visionRetryDelayMs30000Retry delay
onVisionFailureplaceholderFinal failure policy: placeholder = insert a failure note and continue; error = fail the turn

Vision model options

The vision call goes through the pi-ai adapter (ctx.llm.stream against visionProvider/visionModel), so any OpenAI-compatible vision endpoint works — a local llama.cpp gateway is only the default, not a requirement.

TypeExampleAPI keyNotes
Local llama.cpp gateway (current default)Qwen3-VL-4B via http://<desktop-ip>:18081/v1NoFree, private, LAN-only; image bytes never leave your network
Cloud OpenAI-compatible APIsqwen-vl-max (DashScope), glm-4v-plus (Zhipu), gpt-4o (OpenAI), OpenRouter/ SiliconFlow, …YesStronger models; images are sent to the cloud provider

Example — add a DashScope route to settings.yaml (or Settings → Models → llm-pi-ai) and point the bridge at it:

llm-pi-ai:
  providers:
    dashscope:
      displayName: DashScope
      apiKeyEnv: DASHSCOPE_API_KEY
      api: openai-completions
      baseURL: https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1
      models:
        - id: qwen-vl-max
          name: Qwen-VL-Max
          input: [ text, image ]

llm-vision-bridge:
  visionProvider: dashscope
  visionModel: qwen-vl-max

Settings changes apply without a restart. Constraints: the endpoint must be OpenAI-compatible and accept image input; the vision provider must not be the bridge provider itself (deepseek-vision, recursion guard); cloud routes need a stored credential (apiKeyEnv → Settings → Models), otherwise pi-ai reports MISSING_CREDENTIAL.

Prerequisites

  • A vision model route on the pi-ai adapter, configured under Settings → Models → llm-pi-ai (e.g. the llama route: baseURL pointing at the desktop llama.cpp http://<desktop-ip>:18081/v1, model declaring input: [text, image]).
  • If the vision provider declares apiKeyEnv but the credential is not set, pi-ai reports MISSING_CREDENTIAL: store any placeholder value on the Settings page (local llama.cpp does not validate the key), or remove that apiKeyEnv.
  • Single-GPU exclusive scheduling on the desktop: while other tools occupy VRAM the vision gateway returns 503, which this plugin retries automatically per visionRetries.

Troubleshooting

SymptomFix
「DeepSeek(视觉桥接)」 missing in SettingsPlugin not loaded; check the web service startup log and confirm the bundle is in the profile
attachment-error / MODEL_DOES_NOT_SUPPORT_IMAGES on sendSession model is not the bridge model: set agent-default-model.provider: deepseek-vision, or select 「DeepSeek(视觉桥接)」 for the session
VISION_UNAVAILABLEVision model unreachable: check the llama provider baseURL, the desktop is powered on, and LLAMA_API_KEY is present
UNSUPPORTED_CONTENT after sendingRequest did not go through the bridge provider: confirm the main model is deepseek-vision, not deepseek-official
Slow vision repliesQwen3-VL cold load of 10–40s is normal; on frequent 503, wait for other desktop GPU jobs

License

MIT

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案