deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:MicroHEROX/dsh-koboldcpp-hands
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
dsh-koboldcpp-hands — give your DeepSeek Harness agent a pair of local hands.
A third-party tool plugin for DeepSeek Harness that lets the online model (your main conversation model) hand repetitive, token-cheap labor to a local KoboldCpp (llama.cpp) server — plain text work and vision work (image analysis / OCR / comparison).
The main model stays where your deployment puts it. When it decides a job is better done locally, it calls:
koboldcpp_run — run one prompt on the local text model (batch rewrites, name translations, string munging, short summarization, extraction).koboldcpp_vision — send images to a local multimodal model (OCR, image analysis, multi-image comparison) with structured report templates.The plugin manages the local server lifecycle: it launches your KoboldCpp binary with your .kcpps launch config (which owns the GPU backend, model, mmproj, port), waits for the model to load, and stops the server on an idle timeout and/or harness exit. An externally started KoboldCpp is reused and never killed.
ctx.tools), following the official dsh-tools contract (defineTool, canonical JSON values, pure render/presenters, exec.signal forwarding).exePath with your kcppsPath + --port, polls /v1/models until healthy, self-heals if the server dies, and stops per stopBehavior (exit / idle / never). Windows process-tree termination (taskkill /T) because KoboldCpp relaunches itself as a child process.content array.data:/http(s): URLs, or the images attached to the current conversation (read through the harness attachment service). Note: the conversation-attachment source requires a main model that declares image input — with a text-only main model only image_paths / image_urls work (see current limitation).analyze (8-section report), ocr (character-exact), compare (multi-image, 5-section) — plus a fidelity rule for the online model (relay verbatim, never invent, preserve uncertainty).llm-koboldcpp: section in the harness user-settings document overrides the plugin config without a restart; KOBOOLDCPP_EXE / KOBOOLDCPP_KCPPS env fallbacks..kcpps file (backend usecuda/usevulkan/usecpu, model_param, mmproj, port). No probing, no auto-flags.mmproj model files — bring your own.| Item | Requirement |
|---|---|
| Node.js | ≥ 20 |
| DeepSeek Harness | installed (npx @deepseek-ai/dsh web or a source checkout) |
| KoboldCpp binary | koboldcpp.exe (NVIDIA/CUDA) or koboldcpp-nocuda.exe (AMD/Vulkan), any release with /v1/chat/completions |
| GGUF model | your own; vision additionally needs a multimodal GGUF and its mmproj (set "mmproj" in the kcpps) |
Inside your harness project (the directory whose cordis.yml / cordis.patch.yml composes your deployment):
npm install dsh-koboldcpp-hands
The package ships a dsh.bundle manifest, so the plugin row is inserted automatically by the harness loader — you only need the config overrides below. From a source checkout of the harness you can instead point the plugin row directly at a clone of this repo (plain-dependency install, row not auto-inserted):
- insert:
- id: koboldcpp-tool
name: '../dsh-koboldcpp-hands'
You own the launch settings. After an npm install the row already exists with defaults; override it by id from your profile cordis.patch.yml without insert (an insert with the same id crashes the loader with duplicate loader entry id):
- id: koboldcpp-tool
name: 'dsh-koboldcpp-hands'
config:
baseURL: 'http://127.0.0.1:5001' # must match the port in your kcpps
exePath: 'C:\path\to\koboldcpp-nocuda.exe' # your binary (CUDA or Vulkan build)
kcppsPath: 'C:\path\to\your-model.kcpps' # your launch config: backend + model + mmproj + port
autoStart: true
stopBehavior: idle
idleStopMinutes: 30
(For a plain-dependency install — git/local row, no bundle — use - insert: with the same row instead.)
The launched command is exactly:
koboldcpp-nocuda.exe "C:\path\to\your-model.kcpps" --port 5001
Full config reference (all 17 fields with defaults): docs/api.md §1.2.
koboldcpp_run — text| param | type | required | meaning |
|---|---|---|---|
prompt |
string | yes | instruction/text sent as a user message |
system |
string | no | optional system instructions |
temperature |
number | no | sampling temperature (0–2) |
max_tokens |
integer | no | output cap (default maxTokens) |
stop |
string[] | no | stop sequences |
Returns { text, reasoning?, model, usage, elapsedMs }.
koboldcpp_vision — images / OCR| param | type | required | meaning |
|---|---|---|---|
mode |
analyze/ocr/compare |
no | built-in prompt template (default analyze) |
prompt |
string | no | custom instruction (overrides the template) |
image_paths |
string[] | no | local images (png/jpg/jpeg/webp/gif/bmp, ≤20 MB each) |
image_urls |
string[] | no | data:image/... or http(s):// URLs |
temperature |
number | no | sampling temperature (lower for OCR, ~0.2) |
max_tokens |
integer | no | output cap |
stop |
string[] | no | stop sequences |
Image sources resolve in order: explicit image_paths + image_urls → the most recent image(s) attached to the conversation → clear error. compare sends 2–4 images in ONE request for joint reasoning.
Returns { text, reasoning?, model, images, usage, elapsedMs }.
Vision requires a multimodal GGUF and its
mmprojprojector in the kcpps. Withoutmmprojthe request completes but the model cannot see the image.
In the current release (plugin 0.1.0, harness 0.1.0-rc.6), when your main model is text-only, koboldcpp_vision can only receive images through the two explicit channels: image_paths (local file paths) and image_urls (online / data: links). The conversation-attachment source is unavailable in that setup — and this is a hard limit of the harness, not of this plugin:
attachment-error / MODEL_DOES_NOT_SUPPORT_IMAGES (the UI shows "当前模型不支持图片,请切换支持图片的模型"). The check lives in dsh-host-apiproxy: the selected model's declared input modalities (from the pi-ai model catalog) must include image; a model catalogued as input: ["text"] (e.g. deepseek-v4-flash / deepseek-v4-pro on the opencode-go route) is refused.dsh-llm-pi-ai's streaming adapter rejects image content for the same text-only models (UNSUPPORTED_CONTENT), and subagent continuation sessions block images in the browser client entirely.Workarounds that work today:
koboldcpp_vision with image_paths: ["C:\\...\\photo.png"] — any path readable by the harness process.image_urls: ["https://example.com/photo.png"] (also data: URLs).minimax-m3, qwen3.7-plus, kimi-k2.6, kimi-k3, grok-4.5 on the opencode-go route) — the conversation-attachment source then works automatically.Tracked upstream in deepseek-harness discussion #1378 (request: allow image attachments for text-only models and deliver them to tools as links/paths). This section will be updated when the harness relaxes the restriction.
Possible / planned directions:
autoswapmode support (kcpps-level; the wire model field is already configurable).dsh-plugin topic.Deliberately NOT planned:
gguf/mmproj) or modifying DeepSeek Harness itself.Removing the plugin is as clean as installing it:
cordis.patch.yml (or cordis.yml):# delete this block
- insert:
- id: koboldcpp-tool
name: 'dsh-koboldcpp-hands'
koboldcpp_run, koboldcpp_vision) are unregistered automatically — the online model no longer sees them.stopBehavior: exit — the plugin stops its spawned KoboldCpp when the harness shuts down gracefully.stopBehavior: idle — the server stops after the idle window.stopBehavior: never — the server keeps running; stop it yourself (e.g. taskkill /PID <pid> /T /F on Windows).npm uninstall dsh-koboldcpp-hands.npm uninstall dsh-koboldcpp-hands
Remove-Item -Recurse -Force C:\path\to\dsh-koboldcpp-hands
rm -rf /path/to/dsh-koboldcpp-hands
| Component | Version |
|---|---|
| This plugin | 0.1.0 |
| DeepSeek Harness | 0.1.0-rc series (tested against npm @deepseek-ai/* 0.1.0-rc.6) |
| Node.js | ≥ 20 |
| KoboldCpp | any release exposing /v1/chat/completions |
Peer dependencies (runtime): @deepseek-ai/cordis ^4.0.1, @deepseek-ai/dsh-tools/dsh-llm/dsh-session/dsh-attachment/dsh-settings/dsh-launch-environment >=0.1.0-rc.2, @deepseek-ai/schemastery ^3.18.1.
npm install
npm run typecheck # tsc --noEmit
npm test # vitest run (45 tests: unit, tool, integration, Loader composition)
npm run build # tsc -> lib/
Tests include a REAL-composition tier (app boot → Cordis Loader → cordis.yml) per the harness testing policy, and a real-machine scenario driver (tests/real-driver.mjs) for autostart / reuse / not-running behaviors.
| doc | content |
|---|---|
| docs/engineering.md | structure, plugin contract, commands, test tiers |
| docs/api.md | authoritative API reference (Config, tools, classes, error codes) |
| docs/glossary.md | standard terminology |
| docs/solutions.md | pitfalls, troubleshooting, methodology |
dsh-llm-deepseek, dsh-tool-todo) that define the patterns we follow.MIT. Not affiliated with DeepSeek AI or LostRuins; dsh and koboldcpp are trademarks of their respective owners.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。