@openllmsh/dsh:通过 OpenLLM 网关路由 DeepSeek Harness

DeepSeek Harness (dsh) 采用插件化架构,@openllmsh/dsh 是一个插件包,用于将 Harness 流量路由至 OpenLLM 网关,并注册 OpenLLM MCP 服务器。它将 OpenLLM 作为默认模型添加到内置 llm-pi-ai 适配器。这是一个纯配置 Cordis 补丁层,无运行时代码。

核心功能

该插件提供以下能力:

  1. LLM 路由器:在 dsh 的内置 llm-pi-ai 适配器中添加 openllm 提供者,指向本地网关 http://127.0.0.1:8787/v1,并将其设为默认模型。无 API Key,认证由守护进程处理。
  2. MCP 服务器:注册 openllm mcp stdio 服务器,提供 openllm、claude-context 和 supermemory 工具组。
  3. 纯配置层:通过 cordis.patch.yml 实现补丁,无运行时代码。

前置条件

在使用此插件前,必须满足以下条件:

  • 安装 OpenLLM:需先安装 OpenLLM。
  • 运行守护进程:必须确保 openllmd 正在运行。
  • Node.js 版本:引擎要求 Node.js ^22.19.0 || >=24.0.0。

安装与启用

插件安装到具体的 profile 中,请根据运行环境选择对应命令:

浏览器 UI (web profile):

dsh plugin --profile web add github:openllmsh/dsh

Headless / CLI (headless profile):

dsh plugin --profile headless add github:openllmsh/dsh

本地开发/调试 (demo profile):

dsh plugin --profile demo add .

安装后请重启对应的 profile。

工作原理

  • 通信机制:插件仅与本地网关 http://127.0.0.1:8787 通信。插件本身不持有密钥或来源。
  • 认证处理:网关无需插件提供认证,由 OpenLLM 守护进程自行读取 ~/.openllm/.env 并处理上游认证。
  • 运行位置:插件在宿主的 DeepSeek Harness 进程上运行,依赖宿主的 @deepseek-ai/dsh-base 提供的基础环境。

开发与构建

源码位于 src/index.ts(占位符),实际逻辑在 cordis.patch.yml。

pnpm install
pnpm build            # 使用 tsdown 编译 lib/index.mjs (+ .d.mts)
pnpm typecheck        # TypeScript 类型检查

dsh plugin --profile demo add .          # 链接到测试配置
dsh --profile demo --dump-config         # 检查插件树

注意:lib/ 目录已提交到仓库,直接从 GitHub 安装无需构建步骤。修改 src/ 后需重新构建并提交 lib/。

许可与链接

  • License: MIT
  • Owner: openllmsh
  • Repository: https://github.com/openllmsh/dsh
  • Catalog: https://www.skillhub.cn/plugins/openllmsh/dsh
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜