dsh-vision-LMstudio
文件与数据 活跃维护

dsh-vision-LMstudio

TiankunDai/dsh-vision-LMstudio

统一接口直接调用LM Studio加载的本地视觉模型,支持图像输入与视觉问答。自动封装连接和请求格式,只需传入图片与提示词即可返回结果,离线环境使用流畅。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
TypeScript
主要语言
BSD-3-Clause
开源协议
69 KB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:TiankunDai/dsh-vision-LMstudio
git clone https://github.com/TiankunDai/dsh-vision-LMstudio.git
git clone git@github.com:TiankunDai/dsh-vision-LMstudio.git
README.md main

dsh-vision-LMstudio

English | 中文

Local LM Studio vision recognition plugin for the DSH (DeepSeek Harness) Web GUI —
recognize, describe, and OCR local images or clipboard screenshots with a local
vision model. All inference happens on your own machine; images never leave it.

Features

  • Agent tools (registered host-side, available in every session)
    • lmstudio_vision — recognize a local image file by absolute path
    • lmstudio_clipboard — recognize the current clipboard image (screenshot / copied image), no file path needed
    • lmstudio_models — list loaded models and mark the most recently loaded one (the auto-selected one)
  • Settings panel: "Settings → LM Studio Vision" — configure server URL / model / default
    prompt / temperature / max tokens, refresh the model list, and one-click recognize a
    local image or the clipboard
  • Automatic model selection — without an explicit model, the most recently loaded
    model is used (the first entry of the server's model list; the native /api/v0/models
    endpoint is filtered by state, so models that are JIT-visible but not loaded never
    get picked). No specific model is preset.
  • Persistent config — ~/.dsh/dsh-lmstudio-vision.json (atomic writes), shared by the
    panel and the agent tools

Requirements

  • DSH (DeepSeek Harness) with the web profile
  • LM Studio with a vision model loaded and the local server started
    (Developer → Start Server, default port 1234)
  • Windows for the clipboard tool (uses Windows PowerShell 5.1 Get-Clipboard -Format Image)

Install

pnpm install
pnpm build
dsh plugin --profile web add link:<path-to-this-repo>/packages/dsh-lmstudio-vision

Then restart DSH (dsh web) and refresh the page. dsh plugin appends the package
to dsh.profile.bundles automatically (the package declares dsh.bundle).

Configuration

Configurable from the settings panel or by editing ~/.dsh/dsh-lmstudio-vision.json:

{
  "baseUrl": "http://127.0.0.1:1234",
  "model": "",
  "prompt": "Describe this image in detail.",
  "temperature": 0.2,
  "maxTokens": 1024
}

Leave model empty to auto-select the most recently loaded model, or set an
explicit model id to override it.

Repository layout

  • packages/dsh-lmstudio-vision/src/index.ts — host half: LM Studio engine, API routes,
    agent tools, system-prompt announcement
  • packages/dsh-lmstudio-vision/src/client/ — browser half: the settings panel
  • packages/dsh-lmstudio-vision/cordis.patch.yml — bundle patch plugin row
  • shared/tsdown.client.ts — build preset (follows the dsh-web-ui clientBundle convention)

License

BSD-3-Clause