证据快照复核于 2026-09-10GitHub 数据核对日期: 2026-08-21
证据已验证Plugin Bundle模型与路由Web Profile

dsh-local-ai

为 DeepSeek Harness 接入 Ollama 和其他本地 OpenAI 兼容模型,并提供按规则启用的本地路由与模型工具。

快速了解

它能做什么

为 DeepSeek Harness 接入 Ollama 和其他本地 OpenAI 兼容模型,并提供按规则启用的本地路由与模型工具。

本站提供的是中文说明,不代表该项目或 Plugin 自身提供中文界面;语言支持请以上游文档为准。

使用场景
模型与路由模型路由配置自动化
适配技术
deepseek-harnessollamalm-studiovllmllama-cpp
兼容性

Web Profile
DeepSeek Harness 0.1.2-rc.1 and 0.1.5-rc.1 declared

可信度与状态

证据已验证
核对日期 2026/9/10 UTC 13:58

有代码证据的贡献

它为 DSH 增加什么

本地模型路由与 Ollama 工具

注册本地 Ollama 与 OpenAI 兼容提供商、路由规则、模型管理工具、健康检查和 /ollama 命令。

机制证据

选择前先看

此 DeepSeek Harness 插件包注册 Ollama 提供商,并可选接入 LM Studio、vLLM 和 llama.cpp 兼容后端。你可按任务类型、关键词或全量本地规则将匹配请求发送到本地模型;未匹配的请求继续使用云端提供商。它还提供模型列表、详情查看、拉取、删除、健康检查工具以及 /ollama 状态命令。

适合谁

运行 Ollama 或其他本地 OpenAI 兼容服务,并希望可控地路由本地模型的 DeepSeek Harness 用户。

常见任务

  • 将包含“confidential”或“offline”等关键词的请求路由到本地 Ollama 模型。
  • 使用本地模型完成会话压缩,同时让其他请求保留在云端提供商。
  • 在 Harness 中查看本地模型清单和健康状态,或拉取、删除模型。

权限与数据

会向你配置的端点发起出站 HTTP 请求,并使用本地 Ollama CLI 探测健康状态。

权限
  • network:outbound
  • 声明不使用原生代码。
数据处理
  • 提供的文档称,展示前会清理并限制端点详情、本地路径和错误内容。
  • 工具和命令结果会通过 Harness 的工具与命令接口记录。
外部服务
  • 默认使用 http://127.0.0.1:11434 的 Ollama HTTP API。
  • 可选使用 LM Studio、vLLM 或 llama.cpp 等本地 OpenAI 兼容后端。
凭据
  • 提供的文档称插件不存储或读取凭据。
  • OpenAI 兼容后端可选配置 API 密钥。

局限

  • 只有添加路由规则后才会自动路由;也可显式选择 Ollama 提供商。
  • 仅在本地模型开始输出前失败时才回退到云端;流式输出开始后的失败会被直接转发。
  • 纯文本模型会拒绝图片内容;图像支持取决于模型是否报告 vision 能力。
  • 本次整理未实际执行安装或运行。

DSHub 已核对

  • Git 源已固定到提交 9ec65942cac32df25455b7091e4128c7d06a3c0e。
  • 插件包结构和 Cordis 补丁已验证。
  • 清单声明 Node ^22.19.0 或 >=24.0.0,以及 DeepSeek Harness 0.1.2-rc.1 和 0.1.5-rc.1 兼容条目。

DSHub 未核对

  • 未执行实际安装、配置档重启、本地服务连接、路由、回退或模型管理操作。
  • 未审计 npm 包内容。

固定版本安装

安装 dsh-local-ai

这个Plugin Bundle没有 DSH Plugin 安装操作,请根据源码文档使用真实交付方式。

访问源码项目

维护者原文

项目 README

查看 commit 9ec6594 对应的 README
维护者编写的上游内容原文于 2026/9/10README.md 获取,正文和仓库相对媒体固定到 commit 9ec65942cac3,内容哈希为 c4d3e5b66b01。以下是未经 DSHub 翻译的上游原文,语言可能与当前页面不同;第三方托管的 badge 可能独立更新。
<div align="center">

🤖 dsh-local-ai

  • 1024 store channel: npm i -g dsh1024 once, then dsh1024 plugin --profile web add dsh-local-ai (counts toward the deepseek1024.com install ranking). Gitee

Local-model (Ollama) integration for DeepSeek Harness.

Discover, pull, remove, and inspect local models, route requests to them by task type or keyword with automatic fallback to the cloud, and get a one-shot status overview via /ollama.

Official repository. This is the only official repository of dsh-local-ai, maintained by PerryLink. Same-name repositories under other accounts are not affiliated.

License DSH plugin dsh-doctor Node CI Version npm version npm downloads

English · 简体中文 · Español · Português · हिन्दी

</div>

Compatibility

Surface Status
Harness DeepSeek Harness dsh-v0.1.5-rc.1 (adapted 2026-09-09): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-10 against the dsh-v0.1.5-rc.1 master checkout (full gate chain + profile install smoke).
Node ^22.19.0 || >=24.0.0
Backend Ollama (local HTTP API + CLI probe)
Model Text-only route (inputModalities: ['text']); tool calls and tool results are supported

What you get

dsh-local-ai makes Ollama a first-class local provider in DeepSeek Harness:

  • Discovery & managementollama_list (installed models, running models, disk usage), ollama_show (parameter size, quantization, context length), ollama_pull, and ollama_remove.
  • Health check — process liveness (via the ollama CLI) and API responsiveness (via /api/version), reported as two independent signals.
  • Official adapter — the ollama provider route is registered through ctx.llm.registerAdapter (LlmAdapter), with configurable model mapping and temperature / max-tokens / stop translation.
  • OpenAI-compatible backends — LM Studio, vLLM, and llama.cpp --server each register as their own openai:<name> provider through the same LlmAdapter seam, reusing one OpenAI /v1/chat/completions adapter (text-only route).
  • Local routingmodel_route rules route requests to a local model by task type (purpose), case-insensitive keyword, or always, with automatic fallback to the cloud when the local route fails before producing content.
  • /ollama command — a one-shot status overview: models, disk usage, health, and suggestions.
  • Zero dependencies, HTTP first — everything talks to Ollama's HTTP API (the CLI is used only for the process probe); no model files are bundled.
request (loop)
   │ llm/stream waterfall
   ├─ rule matches? ──▶ route to ollama ──▶ Ollama /api/chat (NDJSON stream)
   │              └─▶ route to openai:<name> ─▶ /v1/chat/completions (SSE)
   │                        └─ fails first ─▶ fall back to cloud (next())
   └─ no match ──▶ cloud provider
tools ──▶ /api/tags · /api/ps · /api/show · /api/pull · /api/delete
health ──▶ /api/version (API) + ollama list (process)

Quick start

# 1. install the bundle into your profile
dsh plugin --profile web add "github:PerryLink/dsh-local-ai#main"

# or from npm (published releases)
dsh plugin --profile web add dsh-local-ai

# 2. configure routing in your profile patch (cordis.yml) and restart
dsh --profile web

Minimal routing configuration (the rule ships commented out in cordis.patch.yml):

- insert:
    - id: dsh-local-ai
      name: dsh-local-ai
      config:
        route:
          - model: llama3.2
            keywords: ["confidential", "offline"]

Then verify the row mounts:

dsh --profile web --dump-config | grep -A2 'id: dsh-local-ai'

Install & uninstall

  • git channel (latest main): dsh plugin --profile web add "github:PerryLink/dsh-local-ai#main" — the prepare script builds with production dependencies only.
  • npm channel (published releases): dsh plugin --profile web add dsh-local-ai.
  • tarball channel: pnpm pack in this repo, then dsh plugin --profile web add ./dsh-local-ai-<version>.tgz.
  • uninstall: dsh plugin --profile web remove dsh-local-ai (or remove the row from the profile patch).

If pnpm reports ERR_PNPM_IGNORED_BUILDS for this package, add allowBuilds: { esbuild: true } to your pnpm-workspace.yaml — the dsh CLI prints the exact snippet.

Configuration

All tunables are Schemastery Config fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. cordis.patch.yml documents each key inline.

Key Default Meaning
baseURL http://127.0.0.1:11434 Ollama HTTP API base URL; /api/* paths are appended
requestTimeoutMs 30000 Per-request HTTP timeout (milliseconds)
graceMs 15000 Subprocess terminate grace for the health-check CLI probe
defaultContextWindow 8192 Context capacity used when a model has no exact value
maxTokens 4096 Per-request output cap used when a model has no exact value
temperature (none) Default sampling temperature (0..2); omitted leaves the provider default
vision true Declare and serialize image support when the model reports vision; false keeps the route text-only
models [] Harness-visible → Ollama model mappings
models[].name (required) Harness-visible model name (GenerateOptions.model)
models[].model = name Ollama model id
models[].contextWindow (none) Per-model context capacity
models[].maxTokens (none) Per-model output cap
models[].temperature (none) Per-model sampling temperature
backends [] OpenAI-compatible local backends (LM Studio / vLLM / llama.cpp)
backends[].name (required) Backend name; registers provider id openai:<name>
backends[].baseURL (required) Backend base URL including /v1, e.g. http://127.0.0.1:1234/v1
backends[].apiKey (none) Optional bearer API key (most local servers leave it empty)
backends[].models [] Harness-visible → backend model mappings
backends[].maxTokens 4096 Per-backend output cap used when a model has no exact value
backends[].temperature (none) Per-backend sampling temperature
route [] Local-model routing rules (first match wins)
route[].model (required) Target local model name
route[].provider ollama Target provider id: ollama or openai:<name>
route[].purpose (none) Task type match: compaction / session-title
route[].keywords [] Case-insensitive request keywords
route[].always false Route every eligible request to this model

Tools & surfaces

Surface Kind What it does
ollama_list tool List installed models, running models, and disk usage
ollama_show tool Show parameter size, quantization, context length, family, format
ollama_pull tool Pull (download) a model
ollama_remove tool Remove a model
ollama_health tool Process liveness + API responsiveness
/ollama command One-shot status overview (models + health + suggestions)

Consumes the public host services ctx.llm (registerAdapter), ctx.tools, ctx.subprocess (CLI probe), and ctx.commands. It registers no llm/stream short-circuit by default — the routing listener passes through (next()) unless a rule matches.

Permissions & data

  • Permissions: network:outbound to the Ollama endpoint you configure; no native code, no filesystem access, no storage.
  • Data: every model list/detail, health fact, and error message shown to the model or the user is sanitized (endpoint userinfo and secret query params dropped, control characters stripped, lengths bounded) before display. Tool and command results are logged by the harness's own tool/command seams.
  • Credentials: the plugin stores and reads no credentials. It only issues HTTP requests to the endpoint you configure, plus the local ollama list process probe.

Security boundaries

  • No re-routing by default — the route list is empty unless you opt in; a request reaches a local model only through an explicit rule or an explicit ollama provider selection.
  • Sanitize before display — endpoint addresses and local paths are sanitized before they reach tool output, the /ollama command, or error messages.
  • Zero bundled models — downloads and storage are Ollama's own responsibility; nothing is shipped in the package.
  • Failure loud, failure contained — invalid config fails the mount; a local route that fails before producing content falls back to the cloud (next()), so a down Ollama never bricks a conversation.
  • Model-visible ⟺ logged — routing only changes which provider serves a request (the assistant message is logged with its ollama provenance); no new model-visible input is invented.

Known limitations

  • npm 0.1.5-rc.1 — developed and tested against @deepseek-ai/dsh@0.1.5-rc.1; newer harness baselines are expected to work but are verified by the monthly compat workflow.
  • Vision when the model reports it — models whose /api/show capabilities include vision declare inputModalities: ["text","image"] and carry base64 image payloads on user messages (opt out with vision: false); text-only models still reject image content (UNSUPPORTED_CONTENT).
  • Mid-stream fallback — once a local route has started producing content, a later failure is forwarded (not retracted); only a failure before the first token falls back to the cloud.

Development

pnpm install        # node ^22.19 || >=24
pnpm run typecheck  # tsc: src + tests against the published 0.1.5-rc.1 types
pnpm run typecheck:ci  # strict tsc against published rc.2 types (skipLibCheck off)
pnpm test           # vitest: real Context/LlmRuntime/ToolRuntime/CommandRuntime/subprocess seams
pnpm run test:coverage  # coverage gate (90/80/90/90)
pnpm run build      # tsdown bundle + tsc declarations (lib/)
pnpm run verify:self-contained  # dependency specs resolve from the registry
pnpm run verify:artifacts       # built ESM face + bundle patch present
node scripts/check-readme-sync.mjs  # five-language README sync gate
node scripts/check-endpoints.mjs  # M3 endpoint-liveness probe (Ollama /api/version)
pnpm pack           # the published tarball

Topics

dsh, dsh-plugin, deepseek-harness, deepseek, cordis, ollama, local-llm, local-models, offline, privacy, model-routing

Contributors

  • @PerryLink — creator and maintainer: adapter, routing, tools, health check, sanitization, and the five-language docs.
  • @LABEST-IA — tool-call CallId fix (PR #2), and the tool-call slot and vision-support reports (issues #1, #3, #5).

PerryLink DSH Plugin Family

This project is one of the 37 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:

Plugin One-liner
dsh-auto-review Second-model auto-review on the approval chain, fail-closed by default
dsh-background-agents Durable background child agents with a Web UI sidebar, messaging and interrupt
dsh-budget Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel.
dsh-checkpoint-rewind Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore
dsh-claude-move Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH
dsh-click Cross-platform native desktop control for DeepSeek Harness — Windows first.
dsh-composer-history Terminal-style input history for the web composer: arrows, Ctrl+R search
dsh-data-quality Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here)
dsh-defend Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness.
dsh-doublecheck Engineering-discipline guard: requirements grill, test gates, adversary review
dsh-draw Unified static-image generation routing for DeepSeek Harness.
dsh-fast Read-only performance diagnostics for DeepSeek Harness.
dsh-fund-research Deterministic research reports for Chinese public mutual funds
dsh-github GitHub PR/issues integration for DSH, every write gated by approval
dsh-industry-research Industry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble
dsh-library Local document knowledge base for DeepSeek Harness.
dsh-lsp-actions LSP diagnostics, formatting, completion, code actions and rename over language servers
dsh-mask PII masking middleware: anonymize at the model boundary, restore at the display layer
dsh-mcp-panel Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors
dsh-memento Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool
dsh-observe OpenTelemetry and Langfuse observability exporter for DeepSeek Harness.
dsh-output-styles Claude Code outputStyles-equivalent runtime style switching
dsh-permission-rules Claude Code-style declarative allow/deny/ask permission rules with audit
dsh-personal-directive Personal directive injector with top-bar toggle (framework edition)
dsh-plugin-guide Plugin-development knowledge base as an on-demand agent skill
dsh-reach Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console
dsh-research-report Verifiable research-report engine: content-addressed evidence ledger and sealed versions
dsh-score Multi-dimensional quality scoring for DeepSeek Harness plugins.
dsh-session-pin Pin sessions in the Web sidebar with durable ordering
dsh-session-sync Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store.
dsh-skill-pack-security Security-audit skill pack: secret scan, dependency and supply-chain review
dsh-talk Voice-first session loop for DeepSeek Harness: talk to it, hear it answer.
dsh-test-drive Isolated install-and-smoke test drives for DeepSeek Harness plugins.
dsh-ticktick TickTick/Dida365 task bridge: session-header panel + 11 tools
dsh-translate Vendor parameter translation and deterministic JSON repair for DeepSeek Harness.
dsh-wechat WeChat ↔ DSH bridge (Tencent iLink bot): text/image/file/voice, approvals in chat

Install from the DSH Desktop Market

All PerryLink plugins are browsable in the built-in DSH Desktop Market: Market → Sources → add source → paste https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json → select it. Installation still goes through the Market's npm-identity verification and your confirmation.

License

Apache License 2.0 © 2026 dsh-local-ai contributors

有意识地管理

安装与管理

前置条件与目标 Profile

目标 Web Profile

交付方式 Git Bundle — PerryLink/dsh-local-ai#9ec65942cac32df25455b7091e4128c7d06a3c0e

验证、更新与移除

显示生命周期命令
验证
dsh plugin --profile web list

兼容性与访问范围

DeepSeek Harness plugin; Node 22.19+ or 24+ DeepSeek Harness 0.1.2-rc.1 and 0.1.5-rc.1 declared

检查兼容性证据

风险事实

网络

Connects to the configured local-model endpoint

证据
model-management

Can download and remove Ollama models through its tools

证据
证据与编辑审查Manifest、Bundle patch、分发与新鲜度

不可变证据

审查状态与源码活动

AI 已审查

仓库说明采用事务性配置档插件包安装并在激活时重启,但提供的证据没有实际安装记录。

AI 审查于 2026/9/10 UTC 13:58GitHub 事实核对日期: 2026/9/10 UTC 13:58

自当前证据基线以来,没有记录到重要源码变化。

下一步

按 Plugin 安装流程操作

订阅重要变化: dsh-local-ai