b8yg7vjstj-ctrl/dsh-llamacpp-bridge

DeepSeek Harness plugin: local llama.cpp (llama-server) as a first-class model provider — process/router management, catalog sync with mmproj vision pairing, auto-start, stop-then-load switching, and a sidebar terminal monitor panel.

Project Overview项目介绍

dsh-llamacpp-bridge is a native double-bundle plugin built specifically for DSH's web profile, designed to integrate a local llama.cpp llama-server runtime as a first-class model provider called llamacpp inside DSH's model selector. The package is split into a Node ESM host that registers the llamacpp route, manages llama-server child processes, synchronizes the models directory, and exposes a same-origin HTTP/SSE data plane, while the browser-side client bundle renders a sidebar entry row, a self-contained terminal-output monitoring panel, and a graphical settings page. Installation is performed via dsh plugin --profile web add ./dsh-llamacpp-bridge-<version>.tgz from the Releases page, and the command automatically maintains ~/.dsh/profiles/web/package.json under dsh.profile.bundles; after installation the host must be restarted and the browser hard-refreshed with Cmd/Ctrl+Shift+R.

The typical workflow starts when a user picks a local GGUF model under the llamacpp group in the selector and sends a message: the plugin's ensure(model) step first stops the previously running model, then launches the target llama-server in either single-model -m <model> mode or --models-dir router mode, waits until the OpenAI-compatible port is actually ready, and only then routes the request. Vision projector files (mmproj-*.gguf) are paired with their base models via a three-tier mechanism that combines manual binding, a <model>-mmproj.gguf suffix convention, and a normalized-name prefix fuzzy match, after which the projector is passed automatically through --mmproj. The sidebar terminal panel streams SSE output in real time, supports keyword filtering, clearing, model switching, and a true terminal Ctrl+C → Y graceful stop. The plugin targets developers who want to power DSH conversations with local llama.cpp models, particularly on Apple Silicon Macs.

Dependencies include Node ≥ 20, an installed DSH web profile that can load the plugin's client half-bundle, and a locally built llama-server; macOS and Linux are supported, with Apple Silicon explicitly verified and Windows untested (the gracefulStop routine falls back to a pipe mode there). The models directory stays in sync through a startup full rescan, fingerprint-based lazy rescans, fs.watch, plus a 30-second polling fallback, and display names longer than 30 characters are truncated to the first 30 characters followed by ... while the internal id remains intact. First-run caveats include killing the host listening on port 3080 via lsof -nP -iTCP:3080 -sTCP:LISTEN then relaunching with dsh web, force-refreshing the browser to clear stale bundles, and avoiding ERR_PNPM_IGNORED_BUILDS by adding allowBuilds: { fsevents: true, sharp: true } to the profile's pnpm-workspace.yaml. Source builds require npm install first and then npm run link:dsh to link the @deepseek-ai/* type packages shipped alongside DSH, and the type layer uses minimal structural typing to keep the plugin compiling across DSH revisions. The license is MIT.

dsh-llamacpp-bridge 是一个面向 DeepSeek Harness(DSH)web profile 的双包原生插件,把本机 llama.cpp(llama-server)接入为 DSH 模型选择器中的 llamacpp 一等 Provider。它由 Node ESM 端的 host 与浏览器端的 client bundle 组成:host 注册 llamacpp 路由、管理 llama-server 子进程并提供同源 HTTP/SSE 数据面;client 在侧边栏渲染入口行、自持终端监控面板与设置页图形引导。安装方式为从 Release 下载 tgz 后执行 dsh plugin --profile web add ./dsh-llamacpp-bridge-<版本>.tgz,插件会自动写入 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles。

典型工作流:用户在模型选择器中选定 llamacpp 分组下的本地 GGUF 模型并发起消息,插件先确保旧模型停止、再 ensure 启动目标 llama-server(单模型模式或 --models-dir router 模式),就绪后才走 OpenAI 兼容端口;mmproj 视觉投影通过手动绑定、<模型名>-mmproj.gguf 后缀约定与 mmproj-*.gguf 前缀模糊配对三级机制自动跟随加载。侧边栏「llama.cpp 终端输出监控」面板提供实时 SSE 日志、关键字过滤、清屏、模型切换与 Ctrl+C → Y 优雅退出。它适合想用本机 GGUF 跑 DSH 推理的开发者,尤其是 Apple Silicon Mac 用户。

依赖与首次运行注意事项:要求 Node ≥ 20、DSH web profile、本机已编译出 llama-server;macOS / Linux 可用,Windows 未验证。模型目录通过启动全量重扫、目录指纹按需重扫、fs.watch 与 30 秒兜底轮询保持同步;显示名超过 30 字符会自动截断为前 30 字加 ...,但内部 id 保持完整。安装后必须重启 host(lsof -nP -iTCP:3080 -sTCP:LISTEN 取 PID 后 kill,再 dsh web)并在浏览器 Cmd/Ctrl+Shift+R 强制刷新,否则会撞上旧 bundle 缓存报错。从源码构建需先 npm install,再 npm run link:dsh 链接本机 DSH 的 @deepseek-ai/* 类型包,类型层采用最小结构类型以兼容 DSH 版本演进;遇到 ERR_PNPM_IGNORED_BUILDS 需在 profile 的 pnpm-workspace.yaml 中放行 fsevents/sharp。许可证为 MIT。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
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 github:b8yg7vjstj-ctrl/dsh-llamacpp-bridge

把 b8yg7vjstj-ctrl/dsh-llamacpp-bridge 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-llamacpp-bridge

把本地 llama.cpp(llama-server) 变成 DeepSeek Harness 的一等模型 Provider:进程与路由管理、模型目录同步、按需自动启动、先停旧再起新的模型切换,以及侧边栏「llama.cpp 终端输出监控」面板。

English | 中文

license platform dsh llama.cpp node


这是什么

DeepSeek Harness(DSH)默认使用云端模型。本插件让你把本机的 llama.cpp 接入进来:在 DSH 的模型选择器里直接选 llamacpp 分组下的本地 GGUF 模型,发消息时自动拉起 llama-server,并把视觉投影文件(mmproj)、上下文长度、GPU 层数等一并交代清楚。

插件是标准的 DSH 双包插件(host + client):

  • host(Node ESM):注册 llamacpp 模型路由、管理 llama-server 子进程、同步模型目录、提供同源 HTTP/SSE 数据面;
  • client(浏览器 bundle):侧边栏入口行 + 自持面板 + 设置页图形引导。

特性

能力 说明
模型路由 注册 llamacpp provider,与云端 provider 并存;只拥有自己的路由,不干扰其它 provider 的模型订阅
按需自动启动 调用前 ensure(model):服务器没跑就先跑起来,就绪后才走 OpenAI 兼容端口
先停旧再起新 切换模型时先把先前模型停下来,再启动目标模型(日志会写明这两步),避免显存里同时挂着两个模型
两种运行模式 单模型直启(-m <model>)与 router 模式(--models-dir + /models/load、/models/unload 动态装卸)
目录同步 启动全量重扫 + 读取时按目录指纹按需重扫 + fs.watch + 兜底轮询;目录稍后才出现也能自愈监听
mmproj 视觉配对 三级配对:手动绑定 → 后缀约定 <模型名>-mmproj.gguf → 前缀模糊配对 mmproj-*.gguf(按归一化名打分);配上就自动带 --mmproj
终端输出监控面板 侧边栏入口行(与任务看板同级)→ 自持面板:实时 SSE 日志、流别标签、时间戳、关键字过滤、清屏、模型切换、刷新
优雅退出 面板按钮走真终端交互:Ctrl+C(SIGINT 到前台进程组)→ 发送 Y 确认 → 等退出;不直接强杀(详见下文)
图形化引导 设置页自动探测 ~/llama.cpp/build/bin 等位置,列出候选可执行文件与模型目录,也可手动浏览选择
显示名截断 模型显示名超过 30 字符自动截断为前 30 字符 + ...(id 保持完整,不影响选择与调用)

P0–P3 需求覆盖

项 状态 实现位置
① 后端模型切换(非启动脚本全量列表) ✅ model-store 扫描整个模型目录,与“启动脚本里的列表”解耦
② Web UI 侧边栏入口(Ollama 风格图标 + 模型切换 + 终端输出) ✅ DOM 注入入口行 → 自持面板:模型切换 + SSE 实时日志
③ 对话开始时自动启动 llama.cpp ✅ adapter.stream() → server.ensure()(真正连接端口前等待就绪)
④ 切换模型前先卸载旧模型 ✅ ensure():先 stop() 旧模型并确认停止,再启动目标模型
⑤ 不挂钩其它模型订阅 ✅ 仅 llm.registerAdapter(['llamacpp'], …)
⑥ 安装即生成模型配置 ✅ 自有设置命名空间 llamacpp-bridge + 发现命名空间(含模型/投影器配对情况)
P1 目录新增模型自动同步 ✅ 启动重扫 + 指纹按需重扫 + fs.watch + 兜底轮询
P1 mmproj 与模型一同加载 ✅ 三级配对 + --mmproj 参数
P2 依显存设置上下文长度 ✅ autoContext + pickContextLength 启发式
P3 长上下文提示(会话内询问) ⚠️ 上下文长度可在设置页设定;“对话中询问”尚无官方交互缝,未实现

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-plugin-subagent-delete 下一个 Next raphael-loop →