sulfide2085/dsh-llm-wechat 预览 preview

sulfide2085/dsh-llm-wechat

Plugin插件 Native原生 ⭐ 5 Notifications & Remote通知与远程

DeepSeek Harness 微信网关适配插件:复用 DeepSeekAdapter + 流式 think 标签转译

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables DSH to use the Deepseek-v4-flash model provided by WeChat Mini Program Coding Plan via the chatapi.weixin.qq.com gateway as an official DeepSeek model. It reuses the core DeepSeekAdapter from the official dsh-llm-deepseek package, only adding a streaming translation layer on the response side to handle WeChat's non-standard response formatting quirks. It does not require any modifications to the core DSH or pi-ai source code to work correctly on your local instance.

Installation can be done via the official DSH plugin command, which automatically adds the package to your DSH profile and applies the required cordis patch without any manual file edits. After installation, you need to add your WeChat API token to your DSH credentials file, then configure optional settings like default reasoning effort and max tokens in your DSH settings YAML file. Once configured, the WeChat DeepSeek V4 Flash model will appear in DSH's model selector with a pre-configured dropdown for reasoning effort levels, ready to use immediately after a DSH restart.

There are several important known limitations that users should be aware of before installing and using this plugin. WeChat's gateway has inherent constraints that the plugin cannot resolve, including a 60-second hard request timeout, a quota of roughly 1200 requests every 5 hours, and a maximum concurrency limit of only 6 concurrent requests. The plugin itself also requires note that it copies private code from the official adapter, so major DSH version upgrades may break compatibility until the plugin code is manually re-aligned with upstream changes.

这是一个专为DeepSeek Harness(DSH)开发的原生适配插件,功能是让DSH可以将微信小程序「Coding Plan」提供的Deepseek-v4-flash模型(通过chatapi.weixin.qq.com网关)当作官方DeepSeek模型使用。它复用了官方dsh-llm-deepseek的核心适配器,仅在响应侧增加流式转译层处理微信网关的返回格式差异,无需修改任何DSH或pi-ai的原生源码。

适合需要使用微信提供的免费DeepSeek V4 Flash API的DSH用户。安装完成后,用户需要在DSH的凭证配置文件中存入微信API令牌,之后就能在DSH的模型选择器中看到「WeChat → Deepseek-V4-Flash」选项,还可以自由选择推理等级(off/high/max三档)。如果用户之前手动配置过微信通道,必须删除旧配置才能避免适配器冲突。

插件存在一些已知限制,包括微信网关本身有60秒请求超时、每5小时约1200次请求配额、并发上限为6,这些都是微信侧固有问题插件无法解决。插件自身也需要注意,DSH大版本升级后可能需要重新对齐官方适配器代码,当前暂未发布到npm,可通过本地链接方式完成安装。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add @deepseek-ai/dsh-llm-wechat

把 sulfide2085/dsh-llm-wechat 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

@deepseek-ai/dsh-llm-wechat

中文 | English

独立公开仓库:本插件从项目内独立维护,源码位于 dsh-llm-wechat 仓库。

DeepSeek Harness 的微信网关适配插件:让 DSH 把微信小程序「Coding Plan」的 Deepseek-v4-flash(chatapi.weixin.qq.com)当作官方 DeepSeek 使用——思考进思考块、工具调用正常、正文无标签。

复用官方 dsh-llm-deepseek 的 DeepSeekAdapter(请求序列化、错误映射、模型解析、重试策略全部继承),只在响应侧加了一层流式转译。不修改任何 DSH / pi-ai 源码。

为什么需要这个插件

微信网关的返回有三个官方 DeepSeek 没有的怪癖,DSH 原生解析器无法处理:

微信的怪癖 插件处理
思考内容不放 reasoning_content,而是连同 </think> 标签整个塞进 content 流式拦截器把 </think> 之前的文本剥离并重排进 reasoning_content,正文只留纯净答案
工具调用流式 delta 的后续片段显式发 id: null / name: null,覆盖首个 delta 的正确值 只接受非空字符串更新 id/name
DSH 的工具结果以 tool-result 块存放,序列化时需展开为 role: tool 消息 对齐官方完整版(含 (no output) 兜底)

工作原理

微信流:  "We need answer... final.  </think>141.3717"   (思考+标签全在 content)
              │
              ▼  WechatAdapter.request(拦截器:parseSse 与 translate 之间)
DSH 流:   reasoning_content: "We need answer... final."
          content:           "141.3717"                (标准格式,DSH 上层无感)
  • 请求侧:微信端点协议与官方 DeepSeek 完全一致(OpenAI 兼容),原样透传,仅映射思考档位 off/high/max → thinking: {type} + reasoning_effort。
  • 响应侧:translate 前插入 ThinkTagSplitter 状态机(处理标签跨 chunk 被切开、思考含尖括号、思考未闭合兜底等边界)。
  • system 增强:微信模型对"工具只能通过 run_code 调用"的遵循较弱,插件在 system 末尾追加一段强约束(仅 wechat 通道生效)。

安装

方式一:dsh plugin(推荐,官方规范)

# 在包含 dsh-llm-wechat 目录的位置执行
dsh plugin --profile web add ./dsh-llm-wechat

dsh plugin add 会把包以 link: 方式装进 profile,并把 dsh.bundle 声明的 patch 层(cordis.patch.yml)追加到 dsh.profile.bundles——无需手动改任何文件。

发布到 npm 后(待发布):

dsh plugin --profile web add @deepseek-ai/dsh-llm-wechat

方式二:手动

  1. 把包复制到 DSH 安装树的 node_modules/@deepseek-ai/dsh-llm-wechat;
  2. 在 $DSH_HOME/profiles/web/package.json 的 dependencies 加 "@deepseek-ai/dsh-llm-wechat": "link:<绝对路径>",跑 pnpm install(生成 lock);
  3. 在 $DSH_HOME/profiles/web/cordis.patch.yml 加:
- insert:
    - id: llm-wechat
      name: '@deepseek-ai/dsh-llm-wechat'

配置 credentials

在 $DSH_HOME/.credentials.yaml 存微信 Token(也可以在启动环境导出 WECHAT_API_KEY):

WECHAT_API_KEY: <微信 Coding Plan 的 API Token>

配置(settings.yaml)

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-agency-agents-zh 下一个 Next dsh-liang-slider →