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-local-ai

v0.2.19

Published

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.

Readme

🤖 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 dshfind

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 Market dsh-doctor Node CI Version npm version npm downloads

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


📖 Ecosystem knowledge base — measured data, not marketing: plugin development guide · plugin-selection data · maintenance criteria.

⭐ 如果它帮到了你

这个插件是 DSH 插件家族的一员(40+ 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。

English: part of a 40+ plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.

What is dsh-local-ai?

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.

Terminal demo of dsh-local-ai: dsh-local-ai — install, then route by keyword to Ollama

Animated terminal demo of dsh-local-ai

The same run, animated.

Compatibility

| Surface | Status | |---|---| | Harness | DeepSeek Harness dsh-v0.2.1-alpha.1 (verified 2026-10-04: three typecheck rulers (installed, CI, checkout) + 142 tests + self-contained/artifacts gates; the 0.1.7 content-block union is adapted — a tool result is a first-class tool-role message, and a pre-0.1.7 tool-result wrapper is still read for old logs). The peer range admits every supported line: >=0.1.2-rc.1 <0.2.0 \|\| >=0.1.5-alpha.1 <0.2.0 \|\| >=0.1.6-0 <0.2.0 \|\| >=0.1.7-0 <0.2.0 \|\| >=0.2.0-rc.1 <0.3.0-0; dev/test pins are 0.2.0-rc.2. | | 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 & management — ollama_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 routing — model_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

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

# 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 — 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 | | visionCacheTtlMs | 30000 | Milliseconds a /api/show capability probe stays cached (0 disables caching; a pull or remove invalidates that model) | | 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. One carve-out: a failure carrying IMAGE_OFFLOAD_REQUIRED is rethrown instead of retried on the cloud — that code is the official offload circuit asking this same local route to drop retained images, and falling back would skip the circuit while silently sending a local-only request to a remote provider.
  • 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.2.0-rc.2 — developed and tested against @deepseek-ai/[email protected]; 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.2.0-rc.2 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

Interoperability with other DSH plugins

Verified against DSH 0.2.0-rc.2 (the runtime this README ships for) and the high-star plugin set surveyed on 2026-10-05.

This plugin does not interfere with other plugins, including the widely installed high-star ones:

  • No tool-name collision. Every tool is namespaced; no bare name owned by a shipped tool or another plugin is registered.
  • No service-key collision. It provides no service key at all, so it cannot collide on one.
  • No slot collision. It registers no client slot key, so it cannot contend for a shadows-shipped-ui seat.
  • No HTTP route collision. It registers no webServer prefix.
  • No patch-layer collision. The bundle patch only inserts its own row; it never overrides a built-in row's config.
  • No global mutation. It does not patch prototypes, rewrite process.env, or replace the global fetch dispatcher.

Shared event listeners are non-interfering by construction. It observes the ordering-sensitive event llm/stream with ctx.on() — Cordis's broadcast registration, where every listener runs and none can starve another. Every listener here delegates through next(), so the chain is never short-circuited, and a mutation is applied to the value next() produced rather than returned in its place:

  • llm/stream — also used by dsh-routing-suite (7000★).

Static evidence: dsh-plugin-doctor K10–K13 report pass for every check on this repository.

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 33 actively maintained DeepSeek Harness plugins from PerryLink — the roster is 42, of which 6 are frozen and 3 retired; every one keeps its row below, with the reason in the Status column. If this one helps you, the others likely will too:

| Plugin | One-liner | Status | |---|---|---| | dsh-auto-review | Second-model auto-review on the approval chain, fail-closed by default | | | dsh-autotier | Automatic strong/cheap model-tier routing with deterministic risk guards and a /tier command | | | dsh-background-agents | Durable background child agents with a Web UI sidebar, messaging and interrupt | 🚫 RETIRED — see the note above | | dsh-budget | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | 🧊 FROZEN — see the repo README | | dsh-catalog | DSH Desktop Market standard catalog source for the PerryLink family | | | dsh-cert-mcp | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | | | 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 | 🧊 FROZEN — see the repo README | | 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. | 🧊 FROZEN — see the repo README | | dsh-doublecheck | Engineering-discipline guard: requirements grill, test gates, adversary review | | | dsh-draw | Unified static-image generation routing for DeepSeek Harness. | 🧊 FROZEN — see the repo README | | 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-laya | Laya typed decisions (noul/choice/score) as a first-class Cordis service and model-visible tools | | | dsh-library | Local document knowledge base for DeepSeek Harness. | | | dsh-local-ai | Local-model (Ollama) integration 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 | 🧊 FROZEN — see the repo README | | 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-plugin-certification | Community certification registry with repro-checkable grades and badges | | | dsh-plugin-doctor | Zero-dependency static + sandbox smoke detector for DSH plugins | | | dsh-plugin-guide | Plugin-development knowledge base as an on-demand agent skill | | | dsh-plugin-kit | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | | | dsh-plugin-upgrade | One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card | | | dsh-plugin-upgrade-015 | Merged 0.1.3-alpha.1 → 0.1.5-rc.1 upgrade corridor card plus a zero-dependency seam scanner | 🚫 RETIRED — corridors carried by dsh-plugin-upgrade | | dsh-reach | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | 🧊 FROZEN — see the repo README | | 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 | 🚫 RETIRED — see the note above | | 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-team-rooms | Cross-session team rooms: shared message bus, task board and timeline | 🚫 RETIRED — see the note above | | 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. | |

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