Bundle
llm-deepseek-image-admit
DSH 插件:接管 DeepSeek 官方 provider 路由并补 image 输入模态声明,让图片消息通过 apiproxy 准入预检(实际图片由 image-bridge 等插件在 agent/pre-step 转成文字)
- Source
- Seryta
- License
- MIT
- Updated
- Updated 3 days ago
Readme
# llm-deepseek-image-admit — DeepSeek 图片准入
DSH 插件:接管 DeepSeek 官方 provider 路由,给模型元数据补 `image` 输入模态
声明,让图片消息通过 apiproxy 的准入预检。图片真正进入 agent 循环后由
[image-bridge](https://github.com/Seryta/dsh-image-bridge)(或同类插件)在
`agent/pre-step` 转成文字——**DeepSeek API 永远不会收到图片**。
## 为什么存在
DeepSeek 官方模型声明 `inputModalities: ['text']`,apiproxy 在图片消息进入
agent 循环前按此拒绝(`MODEL_DOES_NOT_SUPPORT_IMAGES`)。harness 的三处图片
门禁(发送预检 / 切换模型检查 / `read_image` 工具)全部由
`adapter.resolveModel` 返回的 `inputModalities` 驱动,因此**只包装
`resolveModel` 即完整解锁**,无需改 `listModels` 或其他面。
## 方案
- 禁用官方 `@deepseek-ai/dsh-llm-deepseek` 行(cordis.patch.yml 已带),
由本插件接管同一 provider 路由 `deepseek-official`——**对用户透明**,
模型选择器不变;
- 本插件 = 官方 apply 逻辑的照抄(同一配置面 / settings 集成 / 凭证解析),
唯一差异:`resolveModel` 返回 `{ ...info, inputModalities: ['text', 'image'] }`;
- 直接 import dsh 安装树里已构建的官方产物,零 pnpm / 零构建。
## 安装
```sh
dsh plugin --profile web add github:Seryta/llm-deepseek-image-admit
```
安装后重启 `dsh web`。
**安装树位置**:默认按 `~/.npm-global/lib/node_modules/@deepseek-ai/dsh`
推导;dsh 装在其他位置时设置环境变量 `DSH_NPM_ROOT`(dsh 安装根,
其下 `node_modules/@deepseek-ai/...`)。
## 上游漂移与检测
本插件照抄官方 apply glue(见 `upstream-baseline.txt` 基线快照)。升级 dsh 后
运行漂移检测:
```sh
node diff-upstream.mjs
```
脚本核对三件事:① `DeepSeekAdapter / resolveAdapterOptions / Config` 三个
import 符号仍存在;② `resolveModel(provider, model, signal)` 签名未变;
③ 基线关键 apply 片段仍在官方产物中。任一不满足则非零退出,按输出提示
更新本插件或基线。缺省官方产物路径按 homedir 推导,可用 `DSH_NPM_ROOT`
覆盖,或把官方产物路径作为第一个参数传入。
## 与同类解法的差异
| 项目 | 暴露方式 | 本插件的取舍 |
|---|---|---|
| [dsh-vision-proxy](https://github.com/Flyvhidbwo/dsh-vision-proxy) | 注册新 provider route,需手动切换模型 | 本插件接管官方路由,对用户**零切换透明** |
| [modlens](https://github.com/liustack/modlens) | 生成模型变体入口 | 本插件不新增模型入口 |
取舍代价:照抄官方 apply glue 有升级漂移面,由 `diff-upstream.mjs` 兜底;
若官方大改配置面需同步本插件。
## 已知限制
- 本插件**只放行图片、不转录图片**;不搭配 image-bridge 等 pre-step 转录
插件时,图片会带着原始图片块到达 DeepSeek 适配器被 API 拒绝。
- 依赖官方包产物路径布局(`node_modules/@deepseek-ai/dsh-llm-deepseek` 等);
dsh 改变安装布局时用 `DSH_NPM_ROOT` 适配。
## License
MIT
Install
dsh plugin --profile web add github:Seryta/llm-deepseek-image-admit
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install llm-deepseek-image-admit from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.