npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-opencode-free-provider

v0.2.0

Published

Free OpenCode Zen models for DeepSeek Harness (DSH): native dsh-llm adapter plugin, no API key. No proxy, no auto-continuation.

Readme

dsh-opencode-free-provider

DSH 内原生可用的免费 OpenCode Zen 模型。

无需 API key。无需注册。无需额外进程。

English | 简体中文


dsh-opencode-free-provider 注册了一个原生 DSH LlmAdapter,直接从 OpenCode Zen匿名免费通道流式获取模型 — 也就是 OpenCode 自家 CLI 免账号使用的同一批模型,在 DSH 模型选择器里作为 名为 dsh-opencode-free-provider 的普通 provider 出现。

请求从你的机器发出去时,看起来与 OpenCode CLI 的流量完全一致(相同的 user agent、相同的关联请求头),模型目录通过三级回退链保持新鲜。无需登录, 无需托管任何东西。

亮点

  • 零凭证、零配置 — 匿名通道不需要 key;安装、重启、开聊
  • 原生 adapter,无 sidecar — 一个 npm 包,无子进程、无二进制、无本地端口
  • CLI 级伪装 — 携带 OpenCode CLI 同款 user agent 与按会话派生的 session/request/project 头集合
  • 实时目录 + 回退链 — 实时上游列表 ∩ 按价格元数据判定免费,叠加离线缓存与已验证静态列表兜底
  • 自愈 — 启动快速重试、周期刷新,并写入健康快照便于诊断
  • 诚实的错误面 — 上游失败(限流、鉴权、超时、传输)以分类后的 finish reason 到达 DSH,重试权交还 DSH
  • 不做魔法截断 — 无单请求输出上限、无自动续写:length 结束诚实地以 max-tokens 呈现,手动继续即可

安装

dsh plugin --profile web add dsh-opencode-free-provider

同一条命令可将已安装的版本更新到最新发布版;追加 @<version> 可锁定版本。安装后重启 dsh web

要求:带 web profile 的 DSH(DeepSeek Harness);Node.js ≥ 20(能跑 DSH 就自带);到 opencode.aimodels.dev 的出站 HTTPS。

配置

默认开箱即用。可通过 profile 的 cordis.patch.yml 覆盖:

- id: dsh-opencode-free-provider
  name: 'dsh-opencode-free-provider'
  config:
    providerId: dsh-opencode-free-provider
    refreshSeconds: 300  # 目录刷新周期

| 选项 | 默认值 | 说明 | | --- | --- | --- | | providerId | dsh-opencode-free-provider | DSH 中显示的 provider 名。 | | refreshSeconds | 300 | 实时目录刷新间隔。价格元数据每 24 h 刷新。 |

工作原理

DSH 会话
   │  harness chunks (block-start / text-delta / usage / finish …)
   ▼
ZenAdapter(已注册的 LlmAdapter)
   │  pi-ai openai-completions 流(默认)/
   │      openai-responses 流(Muse Spark 通道:仅 /v1/responses)
   ▼
https://opencode.ai/zen/v1        ← Authorization: Bearer public
   附带 CLI 级请求头:
     user-agent: opencode/…
     x-opencode-client, x-opencode-session, x-session-affinity,
     X-Session-Id, x-opencode-request, x-opencode-project
  • 会话关联 — session/project id 由会话首轮用户消息 SHA-256 派生 (按会话稳定、不可逆),每个请求再配一个全新的随机 id,与 CLI 一致。
  • 目录回退链 — S1:实时 GET /v1/models;S2:models.dev 价格元数据 判定"免费";S3:编译期已验证静态列表。磁盘缓存(约 7 天 TTL)覆盖上游 中断。
  • 韧性 — 插件启动即注册;若首次目录拉取撞上本机网络就绪竞态 (VPN/TUN 重连、DNS),会以较短周期(约 1 分钟)重试几次,再进入周期 刷新。

健康与排障

每次刷新后插件会写一份健康快照:

~/.dsh-opencode-free-provider/adapter-status.json
{
  "status": "ready",
  "total": 64,
  "exposed": 9,
  "lastError": "",
  "writtenAt": "2026-08-29T07:01:54.915Z"
}

| 现象 | 可能原因与修复 | | --- | --- | | 只有静态模型 | 启动拉取撞上了网络就绪竞态;约 1 分钟内重试落定。看 adapter-status.jsonlastError。 | | lastError: "fetch failed" 持续 | 到 opencode.ai 的出站 HTTPS 被挡;检查代理/VPN 规则。 | | 聊天中出现限流错误 | 匿名通道按 IP 配额;换网络节点或稍后再试。 | | 聊天中提示 API 密钥无效 | 网关拒绝了请求(通常是插件版本过旧,发出的 session-id 格式已与 CLI 不一致);更新插件到最新版并重启 dsh web。 |

安全

  • 不涉及任何秘密:匿名通道的 key 就是字面量字符串 public;不存储、不遥测。
  • 所有请求都从你的机器直连 opencode.ai / models.dev

开发

pnpm install
pnpm run check

检查链为 typecheck + 测试 + 构建;lib/ 已提交,profile 安装无需构建。本地 checkout 请重新装入 web profile(dsh plugin --profile web add file:...),重启 dsh web,刷新页面。模型选择器中的 provider 分组显示为 opencode-zen-free;健康信息写入 ~/.dsh-opencode-free-provider/adapter-status.jsonpnpm run deploy:local 可把 lib/ rsync 到 profile 副本(host 改动仍需重启 dsh web)。

致谢

License

MIT