TL;DR: DeepSeek Harness can use LinkModel as a custom OpenAI-compatible provider. Set the base URL to https://api.linkmodel.ai/v1, select the openai-completions protocol, reference LINKMODEL_API_KEY, and add the chat model IDs manually. We verified this configuration on August 17, 2026 with both DeepSeek V4 Flash and DeepSeek V4 Pro in DSH headless mode.
DeepSeek Harness—whose CLI is dsh—provides the tools, session state, permissions, sandbox, and agent loop around a model. LinkModel provides the model endpoint. Connecting them lets you run a coding agent through one LinkModel API key without changing DSH source code.
DeepSeek Harness is currently a Developer Preview. Its official README warns that compatibility-breaking changes will occur. The steps below match DSH 0.1.0-rc.5 and the LinkModel API behavior we tested on August 17, 2026.
What is DeepSeek Harness (DSH)?
DeepSeek Harness (dsh) is an open-source, MIT-licensed, local-first coding-agent runtime and development environment from DeepSeek. Built on Cordis, it composes models, tools, skills, sessions, sandboxes, storage, agent loops, scheduling, and interfaces as replaceable plugins. You can run it through the Web UI, headless workflows, or custom agent profiles.
| Core capability | What it means in practice |
|---|---|
| Plugin composition | Documented model, tool, storage, sandbox, session, loop, and UI capabilities can be selected, extended, or replaced through compatible Cordis plugins and configuration. |
| Traceable sessions | An append-only event log records the runtime context, model output, tool activity, and other session events that DSH receives, supporting inspection, resume, fork, search, and replay. |
| Runtime modes | Standard provides the full coding-agent toolset; Code orchestrates multi-step tool calls; Minimal keeps a shell and file editor; Creator supports plugin experiments and custom preset authoring. |
“Local-first” describes where the Harness runtime operates, not a promise that every request stays offline. Model providers such as LinkModel, web search, MCP servers, and other plugins may still connect to external services.
A useful mental model is:
Agent = model + harness
The model reasons and generates text. The harness decides what the model can see and do: read files, run Shell commands, call tools, maintain a plan, ask for approval, delegate work, and resume a session.
DeepSeek's architecture documentation describes DSH as an “everything is a plugin” system built on Cordis. Even the model adapter, tool registry, append-only session log, and agent loop are plugins. That is why LinkModel can be added as configuration rather than as a fork of the Harness.
LinkModel sits at a different layer. Its OpenAI-compatible chat endpoint gives DSH access to hosted text models through one base URL and API key. This guide uses DeepSeek V4 Flash as the default and keeps DeepSeek V4 Pro available for harder coding tasks. See DeepSeek Pro vs Flash for the model-level trade-off.
What do you need before connecting DSH?
You need:
- Node.js
^22.19.0or>=24.0.0, matching the current DSH package requirement. - A LinkModel account and API key.
- A local project directory that DSH may inspect.
Use the DSH credential store when configuring the Web UI, or an environment variable with settings.yaml. Do not paste the key into YAML, source control, screenshots, or prompts.
export LINKMODEL_API_KEY="sk-..."Confirm that DSH can launch:
npx -y @deepseek-ai/dsh --versionThe first run downloads the official @deepseek-ai/dsh npm package. DSH stores its user-level configuration under $DSH_HOME, or ~/.dsh when that variable is unset.
How do you configure LinkModel in DSH Web?
The official LinkModel DeepSeek Harness integration guide is the maintained reference for this provider setup. The steps below add practical context and the exact model configuration used in our verification.
Start DSH from the project you want it to use as its workspace:
cd /path/to/your/project
npx -y @deepseek-ai/dsh webThe Web UI listens on http://127.0.0.1:3080 by default. Then open Settings → Models → Add a custom provider and enter:
| Field | Value |
|---|---|
| Provider ID | linkmodel |
| Display name | LinkModel |
| Base URL | https://api.linkmodel.ai/v1 |
| API protocol | openai-completions |
| Credential | Your LinkModel API key, saved in the DSH credential store |
| Model ID | deepseek-v4-flash |
The Provider ID becomes part of saved model selections and sessions, so choose it once and keep it stable. The official provider guide recommends creating a new provider rather than renaming this ID later.
Add deepseek-v4-pro as a second model if you want a higher-capability route. DSH applies model changes on the next request without restarting the server.
Why should you add the models manually?
An explicit model list makes the setup reproducible. Each entry pins the exact LinkModel model ID, display name, and request limit that DSH should use, so you can validate one route at a time and keep the provider configuration reviewable. For this guide, add the two chat models we tested: deepseek-v4-flash and deepseek-v4-pro.
After saving the provider:
- Choose a workspace.
- Select LinkModel → DeepSeek V4 Flash in the model picker.
- Start a new session.
- Ask DSH to summarize the repository before granting write access.
How do you configure LinkModel with settings.yaml?
Configuration-as-code is easier to reproduce and keeps the API key out of the file. Create ~/.dsh/settings.yaml:
agent-default-model:
provider: linkmodel
model: deepseek-v4-flash
llm-pi-ai:
providers:
linkmodel:
displayName: LinkModel
apiKeyEnv: LINKMODEL_API_KEY
api: openai-completions
baseURL: https://api.linkmodel.ai/v1
models:
- id: deepseek-v4-flash
name: DeepSeek V4 Flash
maxTokens: 8192
- id: deepseek-v4-pro
name: DeepSeek V4 Pro
maxTokens: 8192This uses DSH's generic llm-pi-ai adapter. Its official configuration reference requires a hand-declared provider to specify a protocol, base URL, and non-empty model list. apiKeyEnv tells DSH which environment variable to resolve for each request; the secret itself never enters the YAML.
maxTokens: 8192 is a conservative request default for this guide, not a claim about either model's maximum capability. Increase it only after checking the selected model and workload. A very large configured default can make an upstream endpoint reject even a short task before generation begins.
If you want to isolate this experiment from your regular DSH setup, point DSH_HOME at a separate directory:
export DSH_HOME="$PWD/.dsh-linkmodel-test"
mkdir -p "$DSH_HOME"
# Save the same settings.yaml under $DSH_HOMEHow do you run LinkModel in DSH headless mode?
Headless mode is the simplest deterministic test because it creates one persisted session, prints the final answer, and exits without opening a port.
cd /path/to/your/project
npx -y @deepseek-ai/dsh --profile headless \
"Reply with exactly LINKMODEL_DSH_READY and nothing else."The expected output is:
LINKMODEL_DSH_READYAfter the route passes, try a real repository task:
npx -y @deepseek-ai/dsh --profile headless \
"Summarize this repository and name its three most important packages."With the configuration above, the new session uses linkmodel/deepseek-v4-flash. To switch future sessions to Pro, change only the default model:
agent-default-model:
provider: linkmodel
model: deepseek-v4-proExisting sessions retain the model recorded in their event log. Start a fresh session when you want a clean model comparison.
Our smoke test used an exact-response prompt. Both configured models completed through LinkModel:
| DSH route | Result |
|---|---|
linkmodel/deepseek-v4-flash | Returned LINKMODEL_DSH_READY and exited successfully |
linkmodel/deepseek-v4-pro | Returned LINKMODEL_PRO_READY and exited successfully |
This validates the provider path, authentication, model selection, request streaming, and final response. It is not a coding-quality benchmark. For model comparisons, use a fixed repository snapshot and task suite; the best coding LLM API guide explains why agent results depend on more than a single completion.
Can DSH use other LinkModel chat models?
The generic adapter can represent other OpenAI-compatible text models by adding their IDs under models. However, “listed in YAML” and “fully compatible as a coding agent” are different claims.
The official LinkModel example also lists Claude Opus 4.8, GPT-5.6 Sol, Gemini 3.5 Flash, GLM 5.1, Kimi K3, and MiniMax M2.7. Those examples show the range of chat-provider families available through one LinkModel provider; this article's dated DSH smoke test covers DeepSeek V4 Flash and Pro only.
Before adding another model, verify:
- It accepts the OpenAI Chat Completions request shape.
- It supports the tool-calling behavior your DSH preset uses.
- Its configured
maxTokensdoes not exceed the endpoint's accepted output limit. - Its context window can hold the DSH system prompt, tool schemas, and growing session history.
- Any reasoning controls use the dialect expected by that endpoint.
This matters because DSH sends substantially more structure than a one-line chat test. The function schemas behind tool use, runtime context, session history, and agent instructions all consume context. Add and test models one at a time rather than copying an entire catalog into the file.
How does DeepSeek Harness compare with Claude Code and Codex?
DeepSeek Harness, Claude Code, and Codex all run coding-agent loops, but DSH is distinguished by its open, plugin-based runtime and configurable model adapters. It can act as the primary harness for LinkModel or delegate a bounded task to Claude Code or Codex as a separate product-native worker.
| Product | Primary role | Model path | Relationship to DSH |
|---|---|---|---|
| DeepSeek Harness | Open-source, plugin-based agent runtime | Configurable adapters, including LinkModel | Runs the main loop and can orchestrate external workers |
| Claude Code | Anthropic's agentic harness around Claude | Native Claude Code authentication, model, tools, and settings | External subagent through the official Claude Agent SDK |
| OpenAI Codex | OpenAI's coding-agent product | Native Codex authentication, model, tools, sandbox, and settings | External subagent through codex app-server |
DSH's Claude Code adapter and Codex adapter are explicit integration boundaries, not model substitutions. Their tool rows are disabled in the shipped full presets until you enable them, and each call starts a fresh child execution with the current workspace and a standalone task. DSH receives the final text answer or error—not the child's reasoning, tool trace, usage record, or native session—and the child product keeps control of its own model and permissions.
How do you fix common DSH LinkModel errors?
MISSING_CREDENTIAL
DSH found apiKeyEnv: LINKMODEL_API_KEY, but the process could not resolve a non-empty value.
test -n "$LINKMODEL_API_KEY" && echo "key is set"Export the key in the same terminal that launches DSH. Avoid putting it in shell history or printing the full value.
UNKNOWN_MODEL
The requested model is not present in the linkmodel.models list. Add its exact LinkModel model ID, then start a new session or select the model again.
CONTEXT_WINDOW_EXCEEDED
First lower the model's maxTokens. Then test a new, empty session. If the error remains, confirm that the model supports the Chat Completions payload and the amount of system/tool context generated by the selected DSH preset.
Port 3080 is already in use
Choose another loopback port:
npx -y @deepseek-ai/dsh web --port 3088In our test, the UI returned HTTP 200 at http://127.0.0.1:3088.
What security boundaries should you understand?
DSH is a local coding agent, so a successful model connection grants more potential impact than an ordinary chatbot. DeepSeek's official safe-use policy warns that the Harness can run code and access local systems on the user's behalf, and that untrusted content can introduce prompt-injection risk.
Use these defaults when evaluating it:
- Begin with a disposable repository or low-privilege VM.
- Keep approval prompts enabled for consequential operations.
- Review commands and generated changes before accepting them.
- Install only plugins, MCP servers, Skills, and Hooks whose source you trust.
- Keep API keys in environment variables or the credential store, never in the workspace.
- Do not treat the filesystem sandbox as complete host isolation.
The last point is explicit in the DSH sandbox documentation: its modes govern filesystem effects, while network access and process visibility sit outside that vocabulary. A cheaper model can reduce the cost of a looping AI agent, but cost control does not replace permission control.
Frequently asked questions
What base URL should DeepSeek Harness use for LinkModel?
Use https://api.linkmodel.ai/v1 with the openai-completions protocol.
Can I use one LinkModel API key for DeepSeek V4 Flash and Pro?
Yes. Put both DeepSeek V4 Flash and DeepSeek V4 Pro IDs under the same linkmodel provider and reference one LINKMODEL_API_KEY environment variable.
Is DeepSeek Harness an alternative to Claude Code or Codex?
Yes, DSH can serve as the primary coding-agent runtime. It can also invoke Claude Code or Codex as bounded external subagents, while each child keeps its native model, authentication, tools, permissions, and settings.
Does DeepSeek Harness only support DeepSeek models?
No. DSH includes a generic multi-provider adapter for custom gateways and OpenAI-compatible endpoints. Each model still needs protocol, context, output-limit, and tool-use validation.
Is DeepSeek Harness ready for production?
Treat it as an evaluation-stage dependency. DeepSeek labels the current release a Developer Preview and explicitly warns about compatibility-breaking changes.
The bottom line
The clean integration is small: one provider ID, one OpenAI-compatible base URL, one environment-variable credential, and a manual list of LinkModel chat models. DSH supplies the agent runtime; LinkModel supplies the model route. Our dated test confirms that the combination works for both DeepSeek V4 Flash and Pro, while the Developer Preview label and per-model compatibility checks define the current boundary.
Methodology: DSH 0.1.0-rc.5 on Node.js 24.12.0, with isolated Harness state and live LinkModel requests on August 17, 2026. See the DeepSeek Harness product page, LinkModel integration documentation, official DSH README, and provider guide for current behavior.
Connect DeepSeek Harness to LinkModel
Create a LinkModel API key, add DeepSeek V4 Flash and Pro as DSH models, and test the same agent workflow across both routes.
