READMESource: main@b51b5cff
dsh-official-vision
直连 DeepSeek 官方视觉 API 的 DeepSeek Harness (DSH) 插件 — 注册官方多模态模型
deepseek-v4-flash-vision-exp 为 provider 路由,图片直接送入官方 API,不经任何第三方模型。
Direct DeepSeek official vision API bridge for DeepSeek Harness: registers the
official multimodal model deepseek-v4-flash-vision-exp as a provider route and
streams images straight to https://api.deepseek.com — no third-party vision model.
为什么需要它 / Why
- 官方 Harness 0.1.1-rc.1 起内置该模型,但旧版本(如 0.1.0-rc.8)没有;
- 市场现有视觉插件全部是"桥接第三方模型"(GLM / Gemini / InternVL / mimo), 没有直连官方 API 的;本插件填补该空白。
- 纯文本请求零开销:无图时透传官方
deepseek路由。
安装 / Install
dsh plugin --profile web add dsh-official-vision
配置 / Config
在 设置 → 插件 → dsh-official-vision 或 profile 的 cordis.patch.yml 中:
- id: dsh-official-vision
name: 'dsh-official-vision'
config:
apiKeyEnv: DEEPSEEK_API_KEY # 官方 API key 的环境变量名(credential-ref)
baseURL: https://api.deepseek.com
delegateProvider: deepseek # 无图请求委托的路由
detail: auto # low | high | original | auto
maxImagesPerRequest: 600
preferFilesApi: false # true = 走 Files API(file_id,支持 >32MiB 图)
使用:模型选择器中选择 DeepSeek-V4-Flash-Vision-Exp 路由,直接粘贴图片提问。
官方 API 事实 / Official API facts
| 项 | 值 |
|---|---|
| 模型 | deepseek-v4-flash-vision-exp |
| base_url | https://api.deepseek.com |
| 图片格式 | JPEG / PNG / GIF / WebP |
| 计费 | 图转 token,一张最多 384 tokens,价格同 V4-Flash |
| 限制 | 请求体 ≤48MiB;单图 base64 ≤32MiB;Files API 单图 ≤64MiB;单请求 ≤600 图 |
图片传输方式 / Image transport
| 模式 | 机制 | 适用 |
|---|---|---|
| base64 内联(默认) | data:image/*;base64,... |
本地图片,≤32MiB |
Files API(preferFilesApi: true) |
先 POST /files 上传,请求中引用 file_id(带 digest 去重缓存) |
大图(>32MiB)/ 多次复用同一图 |
开发 / Development
pnpm install
pnpm build # tsc → lib/
pnpm test # vitest
License
MIT
No comments yet. Be the first to write one.