1035041186/dsh-llm-ollama

dsh-llm-ollama 是一个为 DeepSeek Harness(dsh)开发的社区插件,让 Harness 通过 Ollama 原生协议(/api/chat) 接入本地 Ollama 服务。即插即用:不改动 dsh 官方任何文件,安装后自动在「设置」中多出一个 Ollama 页面,并在会话模型选择器中提供该提供方的模型。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness that connects DSH to local or remote Ollama LLM services. It uses Ollama’s native /api/chat protocol to handle streaming requests, so it supports all native Ollama features like tool calling, multimodal image inputs, and reasoning output rendering. The plugin automatically patches your DSH web profile after installation, so you do not need to manually edit any configuration files to enable it. To install the plugin, you can run the command dsh plugin --profile web add git+https://github.com/1035041186/dsh-llm-ollama.git, then restart DSH web to activate it. If you are upgrading from an older version, remove the old manual entry from your configuration before reinstalling to avoid duplicate entry errors.

After installation, you can access the dedicated Ollama settings page from DSH’s main settings menu. You just need to enter your Ollama service’s base API URL, then click “Get available models” to pull the full list of models already pulled to your Ollama server. You can select which models to add to DSH’s model selector, and configure per-model settings like context window size, maximum output tokens, and reasoning behavior. The plugin automatically detects if a model supports reasoning, so you only need to manually adjust this setting if the automatic detection is incorrect. You can also run the /ollama-context command in an active chat to temporarily override the context window size for that specific session only.

This plugin requires a DSH web profile version of 0.1.1-rc.2 or newer, and a running Ollama service that is reachable from your DSH instance. It also requires curl, which is pre-installed by default on Linux, macOS, and Windows 10 and newer. The plugin is released under the open source MIT license, and is a community-developed non-official plugin. Currently, the API key field only stores credential references and is not sent with requests, so authentication for remote Ollama deployments must be handled by a reverse proxy in front of the Ollama service. Image inputs only work with vision-capable multimodal models, and pure text models will return an error if you send an image.

这是专为 DeepSeek Harness 开发的原生插件,用于接入 Ollama 大语言模型服务。它通过 Ollama 原生 /api/chat 协议连接本地或远程部署的 Ollama 服务,在 DSH 中新增完整的 Ollama 设置页面,支持一键拉取发现已部署模型,同时兼容工具调用、多模态图片附件和推理过程展示,可直接将上下文窗口、最大输出令牌等参数透传给 Ollama,避免了 OpenAI 兼容适配层带来的参数映射差异问题。

安装完成后,用户可在 DSH 设置页进入 Ollama 配置界面,填入 API 地址后一键拉取已有模型,勾选后即可加入模型选择目录。用户可针对每个模型单独配置上下文窗口、最大输出令牌和推理控制参数,默认会自动识别模型是否支持推理,无需额外调整。还可通过输入 /ollama-context 命令快速调出面板,为当前会话临时覆盖上下文窗口大小,该配置仅对当前会话生效。

本插件要求 DSH web profile 版本不低于 0.1.1-rc.2,依赖已部署的 Ollama 服务(本地默认地址为 http://localhost:11434),系统自带的 curl 工具即可满足运行需求。它采用 MIT 许可证开源,属于社区非官方插件,当前 API 密钥功能仅支持保存凭据引用,远程部署 Ollama 时的鉴权需要在前端反向代理层处理。

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 git+https://github.com/1035041186/dsh-llm-ollama.git

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

READMEREADME

dsh-llm-ollama

DeepSeek Harness(dsh)的 Ollama 提供方插件:通过 Ollama 原生 /api/chat 协议接入本地或远程部署的 Ollama 服务,提供整页「Ollama」设置界面与一键模型发现。

功能特性

  • 整页设置界面:设置 → Ollama 管理提供方(通过 settings.section 扩展点实现)。
  • 原生协议对话:走 Ollama 原生 POST /api/chat(NDJSON 流式),支持工具调用(tool calls)、图片附件(多模态模型)与推理过程展示(把 Ollama 的 message.thinking 轨迹渲染为推理块)。
  • 模型发现:真实请求 GET /api/tags 拉取服务器上的模型,弹窗勾选加入模型目录;也可手动添加。
  • 参数直通 Ollama:
    • 模型级:上下文窗口 → options.num_ctx,最大输出 token → options.num_predict(填多少传多少;未填上下文窗口时默认发送 32K / 32768)。
    • 模型级:推理控制(thinkingCapable)→ 默认自动识别:按服务器 /api/tags 返回的每个模型 capabilities(含 thinking)判断,只有推理型模型才会在右下角模型选择器显示「推理等级」控制,非推理型不显示。自动识别在后台进行(绝不影响模型选择器加载)、结果带缓存;当服务器 /api/tags 响应慢/离线时按“非推理”安全处理,此时可用模型级 thinkingCapable: true/false 手动覆盖兜底;仅当自动判断不准时才需要手动覆盖为「始终显示 / 始终隐藏」。菜单默认只有开关两项(off → think: false、on → think: true)——这与大多数开源推理模型(Qwen3、DeepSeek-R1 / v3.1)只支持布尔 think 一致;仅当模型支持多档等级(如 GPT-OSS)时,把「推理等级类型」切到 levels,菜单才会多出 low / medium / high / max。可选默认推理等级作为该模型的默认值;不设置时菜单显示“Default”,请求不发送 think,跟随 Ollama 默认(支持推理的模型默认开启)。
    • 提供方级:保持时间 → keep_alive(如 5m,-1 表示常驻),温度 → options.temperature(范围 0–2),可选 API 密钥。
  • 会话级上下文覆盖:输入 /ollama-context 调出当前会话的上下文设置面板(预设 4K/8K/16K/32K/64K/128K、自定义值、跟随系统配置),覆盖值优先于模型配置作为 num_ctx;只作用于当前会话,新会话自动回到系统配置。右下角的上下文占用指示会同步反映覆盖值(仅对本插件管理的 Ollama 提供方会话生效,其他提供方的会话不受影响)。

接入 Ollama:本地或远程部署

Ollama 是本地/自托管的大模型运行平台。本插件通过其原生协议(/api/chat)接入,无论 Ollama 部署在哪里,配置方式完全一致——只需在设置页把提供方的 API 地址填成对应地址。

本地部署

  • ollama pull llama3.2:3b 拉取模型,ollama serve 启动服务,默认监听 http://localhost:11434。

远程部署

  • 把 Ollama 部署到另一台机器或 Docker 容器,确保 11434 端口对 dsh 可达;
  • API 地址填 http://<主机IP或域名>:11434 即可,本地与远程用法相同;
  • Ollama 自身不带鉴权,公网暴露时建议在前面加反向代理(nginx / caddy)做 TLS 与访问控制。

为什么走原生协议(而非 OpenAI 兼容端点)

  • 参数直通:上下文窗口 / 最大输出 / 保持时间 / 温度以原生 options 字段精确生效;OpenAI 兼容端点只暴露 OpenAI 参数子集,num_ctx、keep_alive 等 Ollama 专有参数无法直接控制。
  • 模型发现:GET /api/tags 直接列出服务器上已拉取的模型,设置页一键导入。
  • 无中间转换层:NDJSON 流式与工具调用都走 Ollama 原生实现,不受兼容层参数映射差异的影响。

环境要求

  • DeepSeek Harness web profile(已测试版本 0.1.0-rc.6;v0.1.9 起兼容 0.1.1-rc.2 及以上——该版本要求适配器实现 prepareCall)
  • Ollama 服务(本地默认 http://localhost:11434,远程填对应地址)
  • curl(Linux/macOS 自带;Windows 10+ 自带)

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-complete-notify 下一个 Next dsh-prompt-lab →