OpenAI 网关适配器 drscrewdriver/dsh-llm-openai-completions
DeepSeek Harnessv0.4.0让自定义网关模型正确接收系统提示与图片输入
30.8/100
综合分
1
GitHub 星标
1,393
npm 周下载
—/5
用户评分
数据截至 2026/9/16 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add dsh-llm-openai-completionsnpm 源 · dsh-llm-openai-completions 的发布者账号已校验与本仓库一致
状态速览
判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态信任档位:已验证
图例:✓ 通过! 需注意— 未判定 / 无数据· 「未判定」= 本站尚无数据,不代表插件有问题
档位由哪些信号合成
本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。
依赖的 DSH / Cordis 模块
@deepseek-ai/schemastery@deepseek-ai/cordis@deepseek-ai/dsh-llm给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个
功能亮点
- 接收系统提示
- 接收图片输入
OpenAI Completions 服务商插件,给 dsh 接上 OpenAI 兼容的补全 API。
README
由 DeepSeek 最新模型翻译生成dsh-llm-openai-completions
OpenAI-completions 兼容适配器,用于自定义网关(vLLM / LM Studio / 自托管 OpenAI 代理)—— 与 llm-deepseek 和 llm-pi-ai 并列的"第四种适配器类",行为从不猜测:
- system 角色始终映射为 role: "system"——自定义网关永远不会收到 developer 角色,因此即使启用了 thinking,Unexpected message role 400 错误也已消失(pi-ai 的 detectCompat 为非标准 URL 默认 supportsDeveloperRole: true,一旦 reasoningEfforts 表标记模型为推理模型,就会破坏所有自定义网关)。
展开完整文档(README 剩余 1 节)
dsh-llm-openai-completions
OpenAI-completions 兼容适配器,用于自定义网关(vLLM / LM Studio / 自托管 OpenAI 代理)—— 与 llm-deepseek 和 llm-pi-ai 并列的"第四种适配器类",行为从不猜测:
- system 角色始终映射为 role: "system"——自定义网关永远不会收到 developer 角色,因此即使启用了 thinking,Unexpected message role 400 错误也已消失(pi-ai 的 detectCompat 为非标准 URL 默认 supportsDeveloperRole: true,一旦 reasoningEfforts 表标记模型为推理模型,就会破坏所有自定义网关)。
- Thinking 由模型的 compat.thinkingFormat 驱动:
- qwen → 发送 enable_thinking: boolean(Qwen3.6 风格;无 reasoning_effort、无 budget)
- qwen-chat-template → chat_template_kwargs.enable_thinking(+ 保留)
- 具备 effort 能力的 → reasoning_effort 透传(Qwen3.8 风格)
- 接收端将 Qwen3 风格的 response 内容拆分——将 thinking 文本提取为独立的 reasoning block(vLLM 将 thinking 渲染到 content 中,无 reasoning_content 字段)——不再出现 thinking 文本混入正文。
🎉 重大更新:视觉模型图片输入(v0.2.0)
视觉模型现在可以接收用户上传的图片(单张或多张,多图按序保留,文本与图片交错):
- 目标模型在 llm-pi-ai 配置中声明视觉能力(input 含 image,由 dsh-thinking-levels 能力卡片写入 ['text','image'])时,用户消息中的 image 内容块会被序列化为 OpenAI-compatible 的多段 content 数组——每个 image_url 为一个 data:;base64, data URI(附件字节经附件存储 readImage 读取并 base64 编码)。同一消息内支持多张图片且顺序不丢。
- 非视觉模型仍对图片大声拒绝(UNSUPPORTED_CONTENT),绝不静默丢弃。
- 依赖说明:读图需要宿主提供 ctx.attachments(附件存储);纯文本模型不受影响。
配置位于 llm-pi-ai 设置区(设置 → 模型):baseURL、models、reasoningEfforts、compat.thinkingFormat、input。本插件仅替换你列出的提供者的 wire 行为。
能力识别配置:视觉/思考/是否支持 reason-effort/档位均读取 llm-pi-ai 模型条目的 input / reasoningEfforts / compat 字段(官方基础编辑器不提供这些确认项)。它们由 dsh-thinking-levels 能力卡片按用户操作写入、或手工编辑 settings.yaml。完整字段表与 wire 契约详见 docs/settings-spec.md §4.1。
界面预览
实际运行截屏——联合 dsh-thinking-levels:自定义模型的「可思考」档位下拉(Default / Off / On),这正是能力识别与接管链路二合一的演示:
联合 dsh-thinking-levels 的能力卡片 + 接管链路:同一份 llm-pi-ai 配置,卡片负责识别(写入 input/reasoningEfforts/compat),本适配器负责接管 wire(按 compat.thinkingFormat 发送 enable_thinking / reasoning_effort)。
安装
npm(推荐)
dsh plugin --profile web add dsh-llm-openai-completions -w
本地 link(开发)
dsh plugin --profile web add link:E:/test/rewrite-agently/dsh-llm-openai-completions -w
dsh web
启用
本插件替换你列出的提供者的流(默认关闭;llm-pi-ai 拥有的现有路由会被包装,而非重新注册,因此不会冲突)。短路设置契约——llm-openai-completions 命名空间、其字段、接管语义和 wire 行为——详见 docs/settings-spec.md。 想与本接管机制协作的第三方插件(如 dsh-thinking-effort 控制层)应遵循标准的 docs/takeover-spec.md(接管控制规范)。
~/.dsh/profiles/web/cordis.patch.yml(或 设置 → 插件 → dsh-llm-openai-completions) llm-openai-completions: enabled: true providers:
- local-35b
你的 local-35b / Qwen3.6-35B-A3B 配置在 llm-pi-ai 中保持不变:
llm-pi-ai:
providers:
local-35b:
api: openai-completions
baseURL: http://192.168.100.242:8200/v1
models:
- id: Qwen3.6-35B-A3B
reasoningEfforts: { off: null, high: 'high' }
compat:
thinkingFormat: qwen # 仅 enable_thinking,无 reasoning_effort
已知限制 (v0.2.0)
- 非视觉模型不支持图片:未在配置声明视觉能力(input 含 image)的模型收到图片会返回 UNSUPPORTED_CONTENT(图片字节存在于附件服务中,仅在视觉模型路径解析)。
- 无 thinking_budget(有意为之:避免截断意外)。
- thinking 级别的选择器仍然来自模型的推理元数据(llm-pi-ai + dsh-thinking-levels 的 Off/On 切换);本插件控制 wire 行为。
- 安装后重启 dsh web;wrap 在 llm/adapters-updated 时重新应用。
开发
npm install
npm run typecheck # tsc --noEmit
npm test # vitest(serialize / sse / translate)
npm run build # tsc → lib/
E2E 检查:node /scripts/... 或 tests 中的本地 SSE 服务器测试工具(system 角色 / enable_thinking / 拆分针对模拟 vLLM)。
上游提案
本插件同时作为 llm-pi-ai / pi-ai 兼容性差距的参考实现:自定义 URL 应默认 supportsDeveloperRole: false,接收端应拆分 内容,compat 应暴露 supportsDeveloperRole 供真正支持的网关使用。
License
MIT预览分享卡片长什么样 ↓
分享 · DeepSeek Harness Hub
drscrewdriver/dsh-llm-openai-completions
让自定义网关模型正确接收系统提示与图片输入
相关插件 · 市场 / 管理
插件精选列表awesome-dsh-plugin/awesome-dsh-plugin
DeepSeek Harness(dsh)插件精选列表
★ 22,225未汉化DSH
73.6
新词雷达zhuyansen/new-term-radar
new-term-radar新词雷达
★ 2,049已汉化MCP
72.8
插件生态导航0xsline/awesome-deepseek-harness
安装 贡献指南 DeepSeek Docs 公开插件目录 Issues
★ 1,188已汉化DSH
72.6
技能注册中心iflytek/skillhub
企业级开源智能体技能注册中心——发布、发现并管理组织内可复用的技能包。
★ 5,370已汉化DSH
71.9
插件市场目录imsai-sh/awesome-deepseek-harness-plugins
面向 DeepSeek Harnessdsh生态的社区插件目录,共收录 13941 个插件含 PR 收录与…
★ 355已汉化DSH
71.8
插件精选清单Anil-matcha/awesome-dsh-plugin
DeepSeek Harnessdsh精选指南——DeepSeek…
★ 1,013已汉化DSH
71.7
这个插件是你维护的吗?
作者本人可认领并核对本条目;认领通过后,详情页会显示「作者已认领」标记。