cqnxnzg/dsh-llm-openai-compatible

cqnxnzg★ 0JavaScript最后同步: 2026-08-19

在 GitHub 打开

MIT License Copyright (c) 2026 cqnxnzg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell cop

README 摘要

dsh-llm-openai-compatible(万能插头) 让 DeepSeek Harness 接上 任意 OpenAI 兼容端点 :本地 vLLM / LM Studio / llama.cpp 服务器、Ollama 的兼容层、或任何远程网关(OpenRouter、Together、Moonshot 等)。 装完 + 配好端点就能跑 ——不需要装 Ollama,也不需要改 dsh 核心。 设计目标:这个插件自己就是一个「万能插头」——一个 provider 路由( openai-compatible ),任何说 OpenAI Chat Completions 协议的服务都能插上来。 特性 - 任意 OpenAI 兼容端点 : baseURL 配 http://127.0.0.1:8000 或 http://127.0.0.1:8000/v1 都行(自动归一化到 /v1 )。 - API key 可选 :本地服务通常不需要鉴权——没配 key 时请求匿名发出(本地端点忽略多余 Bearer 头);远程网关必须配 key,否则 401。 - 模型目录 : models 数组声明端点实际提供的模型(id / contextWindow / maxTokens / vision / thinking / defaultEffort)。 - Web 配置 :Settings → Plugins → llm-openai-compatible ,通用表单即可改端点、key、模型目录、重试策略,保存即时生效。 - 模型发现 : discoverModels() 读 GET /v1/models ,返回端点真实提供的模型 id 列表。 - 免 allowlist 安装 :仓库提交构建产物 lib/ (无 prepare 脚本),GitHub 安装不需要 pnpm 的 build-script 白名单。 安装 要求 DeepSeek Harness 0.1.0-rc.6+。 GitHub 安装无需 build-script allowlist:仓库提交了构建产物 lib/ (无 prepare 脚本),装完即可用。本地开发时改源码后记得 pnpm run build 再重装。 配置 最小配置(本地 vLLM 等) 默认 baseURL = http://127.0.0.1:8000/v1 ,默认模型目录里有几个常见本地模型 id。打开 Settings → Plugins → llm-openai-compatible ,把 models[].id 改成你本地服务 实际提供 的模型 id(见下文「UNKNOWN MODEL 怎么消除」),保存即可在模型选择器里选中聊天。 配置字段(全部可选) 字段 默认 说明 apiKeyEnv OPENAI API KEY 凭据引用…

在 GitHub 查看完整 README →
工具/开发deepseek-harnessdsh-pluginllm-provideropenai-compatiblevision

分类