AI

DeepSeek Harness With Ollama: Local Model Setup, vLLM, llama.cpp

This post contains affiliate links. If you buy through them, we may earn a small commission at no extra cost to you. Learn more.

For a working DeepSeek Harness Ollama setup today, do not rely on ollama launch dsh alone. Declare the Ollama route yourself in ~/.dsh/cordis.patch.yml, point its apiKeyEnv at OLLAMA_LAUNCH_DSH_API_KEY, and pin Ollama’s context length to the window you declare. Without that patch the launcher opens a Web UI that asks for a DeepSeek key and lists “No models available”, because Ollama’s overlay points at a settings file dsh no longer reads.

Original content from computingforgeeks.com - post 170966

We cover that fix first, then the exact patch, the credential and model errors, and the context trap that turned a working 1.7B model into one that wrote junk files for ten minutes. vLLM and llama.cpp routes follow. Every Ollama and llama.cpp step below was rerun on Ubuntu 26.04 with DeepSeek Harness 0.2.2-rc.5 and Ollama 0.40.17 in November 2026; the vLLM and GPU sections come from an August run and say so.

Why ollama launch dsh shows no models

ollama launch dsh starts the Web UI with one extra overlay, and that overlay asks the settings plugin to read ~/.ollama/launch/dsh/settings.yaml. dsh dropped the file-backed settings provider that honoured that path back in the 0.1 line, so the overlay is composed but its path setting does nothing. No Ollama route gets loaded, dsh falls back to its bundled DeepSeek route, and on a box without a DeepSeek key the first screen is this dialog:

DeepSeek Harness Web UI after ollama launch dsh showing the Get started dialog asking for an API key or sign in

Close the dialog and the model button tells the same story. The launcher had just written seven models into its own file, yet dsh offers none of them:

DeepSeek Harness model picker reading No models available after ollama launch dsh without a home patch

You can see what the launcher actually started from the process table while the Web UI is up. It boots the web profile with a --patch overlay and exports a placeholder key, and that key is the part worth remembering for the fix:

ps -eo args | grep "[d]sh web"
tr '\0' '\n' < /proc/$(pgrep -f "bin/dsh web" | head -1)/environ | grep OLLAMA_LAUNCH
cat ~/.ollama/launch/dsh/ollama.cordis.yml

Three things come back: the dsh process, the placeholder key in its environment, and an overlay of two lines that only names a path. Our lab user was josphat, so read your own home directory in place of ours:

node /usr/bin/dsh web --patch /home/josphat/.ollama/launch/dsh/ollama.cordis.yml --no-open
OLLAMA_LAUNCH_DSH_API_KEY=ollama
- config:
    path: /home/josphat/.ollama/launch/dsh/settings.yaml
  id: settings

The composed config proves the route never arrives. dsh headless --dump-config with the launcher’s overlay shows the settings entry carrying that path, and an llm-pi-ai entry with a name and nothing under it, which means no providers at all. Run headless with the same overlay and it fails on the bundled route with MISSING_CREDENTIAL for deepseek-official, the error covered further down. The break was reported to Ollama as issue 18699, which was closed as not planned in September, and it still reproduces with the Ollama release current in late November.

Ollama’s own DeepSeek Harness integration page does not mention any of this. It calls dsh a developer preview, says the launcher’s settings.yaml loads last, and notes that the launcher rejects extra --patch arguments, so you cannot hand it your own overlay either. Its example model is qwen3.8, which the Ollama library only carries as a 27B model, far more than a CPU box or a 12 GB card will run at agent speed. The launcher’s file also gained a web-search-deepseek block and three Ollama Cloud models (glm-5.3-flash:cloud, kimi-k3.1-pro:cloud and deepseek-v4.1-flash:cloud) that need ollama signin; none of it reaches dsh while the path is ignored.

We fixed it by declaring the route ourselves in ~/.dsh/cordis.patch.yml, the home-level patch every profile reads. Point the route’s apiKeyEnv at OLLAMA_LAUNCH_DSH_API_KEY and ollama launch dsh starts working too, because the launcher already exports that variable. The diagram shows where each layer sits:

Architecture diagram of where dsh 0.2 reads a local model route: ollama launch dsh overlay path ignored, home cordis.patch.yml carries the Ollama, vLLM and llama-server routes

Profile patches still exist (~/.dsh/profiles/web/cordis.patch.yml belongs to the Web UI), but a route written there only reaches that one profile. The home patch is applied after them, so it’s the one place a local route reaches dsh web, dsh headless and the launcher alike.

Prerequisites

You need a Linux host with a current Node, an inference server the harness can reach over HTTP, and dsh itself. If dsh is new to you, getting started with dsh covers the first run and the Web UI. The lab for this refresh was:

  • Ubuntu 26.04.1 LTS on a CPU-only cloud VM with 22 vCPU and 86 GB of RAM, no GPU
  • Node 24 and npm 11 from NodeSource
  • dsh from npm’s latest tag and Ollama from its install script
  • qwen3:1.7b to prove the route, qwen3:8b for real agent turns

Node is the part that changed this year. dsh declares "node": ">=24.9.0" in its package metadata, and Ubuntu 26.04’s archive still offers Node 22. The archive Node does not stop the install, which is what makes it a trap: npm prints an EBADENGINE warning, exits 0, and dsh --version answers happily. You end up running the harness on a runtime its authors no longer support, and the first odd failure costs you an afternoon. Take Node 24 from NodeSource and the question never comes up.

Sizing is driven by the model rather than the harness. Weights plus KV cache have to fit in memory, and an agent pushes about 5,000 tokens of system prompt and tool schemas through the model on its first step. An 8B model at Q4 needs about 5 GB of VRAM for weights; on CPU it held 10 GB of RAM at a 32K context in this lab, and the timing section shows what a CPU turn costs.

Install dsh itself with sudo (shown in the patch section) before you ever run ollama launch dsh, because the launcher’s own install runs without sudo and fails on the system npm prefix. If the archive nodejs and npm packages are already installed, remove them first (sudo apt remove -y nodejs npm) so the two do not fight over /usr/bin/node. Then install the small tools used below to read JSON and the compressed session logs, and add the NodeSource 24.x repository with its setup script:

sudo apt update
sudo apt install -y curl jq zstd
curl -fsSL https://deb.nodesource.com/setup_24.x -o nodesource_setup.sh
sudo -E bash nodesource_setup.sh

The script only configures the repository and ends by telling you to run the install. The NodeSource nodejs package bundles npm, so there is no separate npm package to add:

sudo apt install -y nodejs
node -v
npm -v
apt-cache policy nodejs | head -3

Anything from v24.9.0 up satisfies dsh, and the installed package should end in nodesource1. Our VM got this:

v24.22.3
11.19.1
nodejs:
  Installed: 24.22.3-1nodesource1
  Candidate: 24.22.3-1nodesource1

If node -v still prints a 22.x release, the archive package won; remove it and install again.

Install Ollama and pull a model for DeepSeek Harness

dsh only talks to Ollama’s OpenAI-compatible endpoint at /v1, so a stock Ollama install is all it needs. The Ollama install steps for Ubuntu cover the service in detail; the short version is the official script:

curl -fsSL https://ollama.com/install.sh | sh
ollama -v

On a box without a GPU the script says so at the end, and the service comes up on loopback port 11434:

>>> The Ollama API is now available at 127.0.0.1:11434.
>>> Install complete. Run "ollama" from the command line.
WARNING: No NVIDIA/AMD GPU detected. Ollama will run in CPU-only mode.

Current releases of the script need zstd because the Linux bundle ships as .tar.zst, which is why it went in with jq above. Start with a small model, which proves the route and the errors quickly; the first-task section adds the 8B one we’d actually run tasks on:

ollama pull qwen3:1.7b
curl -s http://127.0.0.1:11434/v1/models | jq -r '.data[].id'

Whatever that last command prints is the model id dsh needs, character for character. Ollama tags carry a colon, so the id is qwen3:1.7b, not qwen3:

qwen3:1.7b

For model management beyond a single pull, the Ollama commands cheat sheet lists the pull, list, stop and copy commands this guide leans on.

Match the context window to what Ollama serves

Do this before the first agent run, because it is the trap that costs the most and shows the least. The contextWindow you declare in the patch tells dsh how much room it has, and nothing asks the server, so the number is taken as fact. Ollama picks its own default from available VRAM, and the documented tiers are coarse: 4k below 24 GiB, 32k from 24 to 48 GiB and 256k above that. A 12 GB or 16 GB card, or no card at all, therefore serves 4,096 tokens while the harness builds prompts above 5,000.

Our VM had 86 GB of RAM and Ollama still chose the floor, because the tier is decided by VRAM. Check what your server picked:

sudo journalctl -u ollama | grep "vram-based default context"

A GPU-less box reports zero VRAM and the 4K default:

msg="vram-based default context" total_vram="0 B" default_num_ctx=4096

Set the length explicitly. Ollama’s docs suggest at least 64,000 tokens for agents and coding tools; we ran 32,768 because it fits an 8B model in RAM and every task below completed at that size. For the packaged service, put the value in a drop-in so it survives restarts:

sudo systemctl edit ollama.service

Add the environment line under a service section, using the same number you’ll declare as contextWindow in the next section:

[Service]
Environment="OLLAMA_CONTEXT_LENGTH=32768"

Restart, then read the server’s own answer rather than trusting the config. ollama ps lists a model only while it is loaded, so run it within a few minutes of a request (the first dsh run below counts):

sudo systemctl daemon-reload
sudo systemctl restart ollama
ollama ps

The CONTEXT column is the server’s real limit, and the patch has to match it. After the drop-in, both models reported exactly the number we asked for:

NAME          ID              SIZE      PROCESSOR          CONTEXT    RUNNER      UNTIL
qwen3:1.7b    8f68893c685c    5.3 GB    77%/23% CPU/GPU    32768      llamacpp    4 minutes from now
qwen3:8b      500a1f067a9f    10 GB     53%/47% CPU/GPU    32768      llamacpp    3 minutes from now

Ignore the PROCESSOR split on a CPU box. This VM has no GPU, the startup journal logs inference compute id=cpu library=cpu, and the timings below are CPU timings; the column appears to count a share of the model as offloaded anyway. Trust the journal over that column.

What a 4K context does to an agent

We left the default in place on purpose for one run, with qwen3:1.7b and the same one-line task used later in this guide. The turn ran 9 minutes 44 seconds and closed as “completed” with exit code 0, which is the worst part: nothing tells you it failed. The model never read parts.csv. It made 39 tool calls, two to working_directory and 37 to write, created two junk files called dsh-work.txt and example.txt in the workspace, and finished with advice about sandbox_permissions nobody asked for. The Ollama journal explains why:

sudo journalctl -u ollama | grep -E "exceed context length|truncating input prompt"

Every agent request was cut from about 5,000 tokens down to 2,050, keeping the first four tokens and the tail:

llama_server.go:350 msg="truncating input prompt" limit=2050 prompt=5001 keep=4 new=2050
llama_server.go:350 msg="truncating input prompt" limit=2050 prompt=4879 keep=4 new=2050

With most of the system prompt and tool definitions gone, the model was guessing at tools from fragments. The same model at 32K answered the same task correctly in 57 seconds with a single read call. Earlier in November we blamed the 1.7B model for an empty turn on a 4K server; this run shows the context did it, not the model size. Any hit on that grep means the agent has been working from a clipped prompt. A DeepSeek-architecture model, which can’t shift context, rejects the request instead of truncating it. Later in a long session Ollama also drops whole old turns, and that step is only logged at debug level, so add Environment="OLLAMA_DEBUG=1" to the drop-in when you suspect it.

Add the Ollama route to cordis.patch.yml

Install dsh globally with sudo before you ever run ollama launch dsh as a normal user, because the launcher’s own npm install -g runs without sudo and cannot write to the system npm prefix under /usr. Then create the home patch. It’s a YAML list of entries, each targeting a plugin by its id, which is a different shape from the flat settings.yaml older guides show:

sudo npm install -g @deepseek-ai/dsh@latest
dsh --version
mkdir -p ~/.dsh
vim ~/.dsh/cordis.patch.yml

dsh --version printed 0.2.2-rc.5, which npm serves as both latest and next. The npm 11 that NodeSource bundles also lists the packages whose install scripts it skipped:

npm warn install-scripts Run `npm install -g --allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty,@google/genai,protobufjs` to allow these scripts once, or `npm config set allow-scripts=@deepseek-ai/dsh-subprocess-local,koffi,node-pty,@google/genai,protobufjs --location=user` to allow them for all global installs.

We left them blocked. The harness launched, ran its read and shell tools and finished every task below, so there is nothing to allow by hand at this release. Now add the provider route and make it the default model for new sessions. This is the exact file the lab ran:

- id: llm-pi-ai
  config:
    providers:
      ollama:
        displayName: Ollama
        apiKeyEnv: OLLAMA_API_KEY
        api: openai-completions
        baseURL: http://127.0.0.1:11434/v1
        models:
          - id: qwen3:1.7b
            name: Qwen3 1.7B
            contextWindow: 32768
            maxTokens: 8192
- id: agent-default-model
  config:
    provider: ollama
    model: qwen3:1.7b

dsh refuses a hand-declared route unless it has the first three of these, and the fourth is what keeps it from failing at request time:

  • api, the wire protocol (openai-completions for Ollama, vLLM and llama-server)
  • baseURL, which for these servers ends in /v1
  • a non-empty models list
  • an apiKeyEnv reference (or an Authorization header), even for a server that checks no key

A route without the last item loads fine and then fails on its first request, as the next section shows. The provider key (ollama) is the id requests select, and it is permanent once sessions reference it, so pick it with that in mind. If Ollama runs on another machine, the only change is the baseURL host, and that server’s OLLAMA_HOST has to listen on an address you can reach. If you launch through Ollama rather than calling dsh yourself, change apiKeyEnv to OLLAMA_LAUNCH_DSH_API_KEY; the next section explains why the key line is not optional.

Check that the patch composed before you run anything, because the dump is the only view of what dsh will really load:

dsh headless --dump-config | grep -A12 "id: llm-pi-ai"

A route that made it in shows its provider block under the entry:

- id: llm-pi-ai
  name: '@deepseek-ai/dsh-llm-pi-ai'
  config:
    providers:
      ollama:
        displayName: Ollama
        apiKeyEnv: OLLAMA_API_KEY
        api: openai-completions
        baseURL: http://127.0.0.1:11434/v1
        models:
          - id: qwen3:1.7b
            name: Qwen3 1.7B
            contextWindow: 32768

A bare name: line with nothing under it means dsh never saw your file, usually because it sits under a profile directory instead of directly in ~/.dsh. That’s exactly what the launcher’s broken overlay looks like in the same dump.

Fix “No API key for provider: ollama”

A local Ollama server needs no API key, which makes apiKeyEnv look like a field you can leave out. Leave it out and the first run dies before a request leaves the box.

Error: “PI_AI_ERROR: No API key for provider: ollama”

A route that names no credential is treated as configured but keyless, and the OpenAI-compatible client underneath still insists on a bearer token, so dsh exits 1 in headless mode. This screenshot is from the October run:

Terminal showing dsh headless failing with PI_AI_ERROR No API key for provider ollama on a keyless Ollama route

Nothing has changed since. With the patch above minus its apiKeyEnv line, the current release fails with the same text and exit code:

dsh: PI_AI_ERROR: No API key for provider: ollama
exit=1

The tempting shortcut doesn’t work either. Exporting OLLAMA_API_KEY=ollama against that same keyless route gave the identical error, because dsh only reads a variable a route names; exporting one the route does not reference does nothing. Keep apiKeyEnv: OLLAMA_API_KEY in the route and give the variable any non-empty value, since nothing on the Ollama side checks it:

export OLLAMA_API_KEY=ollama

Both halves are needed: the name in apiKeyEnv and the exported name must match character for character.

Error: “MISSING_CREDENTIAL: llm-pi-ai: no credential for provider route ollama”

This is the other half of the same mistake. The route names OLLAMA_API_KEY but the shell that started dsh never exported it, so headless stops before any request:

dsh: MISSING_CREDENTIAL: llm-pi-ai: no credential for provider route "ollama"; its profile resolves OLLAMA_API_KEY, which is not set; store OLLAMA_API_KEY through the credentials service (the web Models page writes it) or export it, and remove apiKeyEnv only if this provider should authenticate from pi-ai's own environment discovery

dsh prints a long dash before “store”, shown here as a semicolon so the line pastes cleanly into a search. Read the last clause carefully, because it points the wrong way for Ollama: removing apiKeyEnv lands you back on PI_AI_ERROR. Export the variable instead. The Web UI is less helpful, since a credential it can’t resolve gives the route an empty model catalog, and you get the “Get started” dialog and “No models available”, the same picture as the broken launcher. For a box you keep, put the export in the shell profile or unit file that starts dsh. The DeepSeek Harness cheat sheet puts both MISSING_CREDENTIAL variants and the PI_AI_ERROR case on one page, with the fix for each.

Error: “MISSING_CREDENTIAL: llm-deepseek: no API key for provider route deepseek-official”

You get this one when your local route never loaded and dsh fell back to its bundled DeepSeek default. Two things cause it. The first is ollama launch dsh without a home patch; running headless with the launcher’s overlay produced it word for word:

dsh: MISSING_CREDENTIAL: llm-deepseek: no API key for provider route "deepseek-official"; store DEEPSEEK_API_KEY through the credentials service (the web Models page writes it), or export DEEPSEEK_API_KEY in the launching environment
exit=1

The second catches anyone upgrading from an early release with a ~/.dsh/settings.yaml. The first profile you boot imports that file into its own profile patch and renames it to settings.yaml.imported, and every other profile is left with nothing; we found the route sitting in ~/.dsh/profiles/web/cordis.patch.yml, invisible to headless, when we tried it in October. Move the llm-pi-ai and agent-default-model entries from that file into ~/.dsh/cordis.patch.yml and both profiles see them.

Error: “UNKNOWN_MODEL: pi-ai provider ollama has no configured model”

dsh checks the default model against the route’s models list before it sends anything, and the comparison is exact. We changed the default to qwen3:8B with a capital B while the route listed qwen3:8b:

dsh: UNKNOWN_MODEL: pi-ai provider "ollama" has no configured model "qwen3:8B"

Ollama itself did not mind: a direct curl to /v1/chat/completions with "model":"qwen3:8B" got a normal answer. The strictness is all on the dsh side, so copy the id into both entries from the /v1/models output rather than typing it.

Error: “PI_AI_ERROR: 404 model not found”

The reverse case is a model that’s declared in the patch but was never pulled. dsh accepts the route, sends the request, and passes Ollama’s 404 straight through:

dsh: PI_AI_ERROR: 404: {"message":"model 'qwen3:14b' not found","type":"not_found_error","param":null,"code":null}
exit=1

ollama pull the tag, or fix the id to one ollama list shows. Both model errors print a clear message, but only the 404 sets a failing exit code; the UNKNOWN_MODEL run exited 0 in our lab, so a script that checks only $? will miss it.

Run the first task on the local model

With the context pinned, both models finished the test task, but the 8B one is what we’d keep for real work. Pull it and point both model entries in the home patch at it. The sed line rewrites the id and the display name:

ollama pull qwen3:8b
sed -i 's/qwen3:1.7b/qwen3:8b/g; s/Qwen3 1.7B/Qwen3 8B/' ~/.dsh/cordis.patch.yml
grep -in "qwen3" ~/.dsh/cordis.patch.yml

The grep should show qwen3:8b on the model id and agent-default-model lines and Qwen3 8B on the name line, with no 1.7B left. With OLLAMA_API_KEY exported, give headless a file worth reading. It answers one task and exits, which makes it the fastest proof that the route works end to end:

mkdir -p ~/dsh-work
cd ~/dsh-work
printf 'name,qty\nwidget,3\nbolt,12\n' > parts.csv
time dsh headless "Read parts.csv and tell me the total quantity."

Headless streams the model’s reasoning to the terminal before the answer. The 8B model read the file with one read call, added the two rows and exited 0:

The total quantity from the `parts.csv` file is **15** (3 + 12).

real	2m34.419s
user	0m3.598s
sys	0m0.466s
exit=0

Two and a half minutes for a three-line CSV is the CPU tax, and the Ollama journal shows where it went. dsh sent three requests. The session-title request took 43 seconds. The first agent step took 1 minute 50 seconds, and about 49 of those were spent just reading the 5,006-token prompt at 101 tokens per second before the model generated its 239-token tool call at under 9 tokens per second. The second step took 33 seconds, because Ollama reused the cached prefix and only had 303 new prompt tokens to process. The tool itself was instant. A GPU removes most of the wait, which is what the timing table further down shows.

Every run leaves a compressed append-only log under ~/.dsh/sessions/ named session.v4.jsonl.zstd. The request/context event records which route the session really used:

LATEST=$(ls -t ~/.dsh/sessions/*/session-*/session*.jsonl.zstd | head -1)
zstd -dc "$LATEST" | jq -c 'select(.type=="request/context").data'

It prints the provider, the model and the context window the harness believed it had, which settles any doubt about whether a session ran locally:

{"provider":"ollama","model":"qwen3:8b","contextWindow":32768}

Treat an empty or nonsensical “completed” turn as a model or context problem, not a route problem. If this line shows "provider":"ollama", the route is fine and the journal grep from the context section is the next place to look.

Make ollama launch dsh work

With the home patch in place, the launcher works as a convenience again. Change one line in ~/.dsh/cordis.patch.yml so the route reads the key the launcher exports:

        apiKeyEnv: OLLAMA_LAUNCH_DSH_API_KEY

Then launch as Ollama’s documentation shows. Anything after -- goes to dsh itself, so --no-open keeps it from trying to start a browser on a headless server. The --model value only lands in the launcher’s own file, which dsh ignores, so the session runs whichever model your home patch names; keep the two the same to avoid confusing yourself.

ollama launch dsh --model qwen3:8b -y -- --no-open

The launcher used the dsh we had installed with sudo and printed the tokenised Web UI address. Treat that token like a password, because it’s the only thing guarding the UI:

dsh web: http://127.0.0.1:3080/?token=REDACTED-SESSION-TOKEN

This time the UI opened straight onto the composer with no “Get started” dialog, and the picker lists the route the home patch declared:

DeepSeek Harness model picker listing the local Ollama Qwen3 8B model after the home patch fix

New installs ask you to choose a workspace folder before the composer accepts a message. With this key name, plain dsh headless runs also need export OLLAMA_LAUNCH_DSH_API_KEY=ollama in your shell profile, or they fail with MISSING_CREDENTIAL. If you never use the launcher, keep OLLAMA_API_KEY and skip this section. The launcher still writes contextWindow: 40960 for qwen3:1.7b into its own ignored file while the server here served 32,768, so the numbers in your home patch are the ones that count.

Error: “listen EADDRINUSE: address already in use 127.0.0.1:3080”

Relaunching after a failed first attempt hit this. The first launcher’s dsh web process outlived the launcher, still held port 3080, and the new one refused to start:

dsh: startup failed: 2 required plugins did not activate

Failed plugins (1):
  webserver (required)
    Package: @deepseek-ai/dsh-host-webserver
    Error: listen EADDRINUSE: address already in use 127.0.0.1:3080

Find the old process and stop it by PID, then launch again:

pgrep -af "bin/dsh web"
kill 3316

Use the PID your pgrep prints, not ours. If you’d rather keep the old instance, Ollama’s docs pass a different port after the separator, as in -- --port 3081.

Compat switches for stricter gateways

dsh shapes each request from the provider id and base URL, and an address it doesn’t recognise is addressed as though it were OpenAI itself. Most local servers accept that, but stricter gateways refuse the developer role or the max_completion_tokens field. We captured the wire with a logging proxy in August, same task and same box, three configurations:

Request fieldPlain routereasoningEfforts plus reasoning: highBoth, with compat set
System prompt rolesystemdevelopersystem
Output cap fieldmax_completion_tokensmax_completion_tokensmax_tokens
Thinking controlabsentreasoning_effort: highreasoning_effort: high plus thinking: {type: "enabled"}
OpenAI-only extrasstore: falsestore: falsestore: false
Tool schemas sent252525

The developer role appears the moment a model declares selectable thinking levels, whether or not an effort is being sent, and store goes out on every request. The switches live under compat, per route or per model. In patch form, the Ollama route with all of them set looks like this. We dropped this exact file into ~/.dsh/cordis.patch.yml on rc.5 in November, and dsh headless --dump-config exited 0 and showed both routes and agent-default-model pointing at vLLM:

- id: llm-pi-ai
  config:
    providers:
      ollama:
        displayName: Ollama
        apiKeyEnv: OLLAMA_API_KEY
        api: openai-completions
        baseURL: http://127.0.0.1:11434/v1
        reasoning: high
        compat:
          supportsDeveloperRole: false
          maxTokensField: max_tokens
          thinkingFormat: deepseek
        models:
          - id: qwen3:1.7b
            name: Qwen3 1.7B
            contextWindow: 32768
            maxTokens: 8192
            reasoningEfforts:
              off:
              high: high
      vllm:
        displayName: vLLM
        apiKeyEnv: VLLM_API_KEY
        api: openai-completions
        baseURL: http://127.0.0.1:8000/v1
        compat:
          supportsDeveloperRole: false
          maxTokensField: max_tokens
        models:
          - id: Qwen/Qwen3-4B-Instruct-2507
            name: Qwen3 4B Instruct
            contextWindow: 32768
            maxTokens: 8192
- id: agent-default-model
  config:
    provider: vllm
    model: Qwen/Qwen3-4B-Instruct-2507

supportsDeveloperRole: false sends the system prompt as a system message, maxTokensField: max_tokens restores the output-cap field every OpenAI-compatible server understands, and thinkingFormat: deepseek switches the thinking control to the DeepSeek dialect. Under reasoningEfforts, each key is the level the picker offers and the value is the spelling sent on the wire; the dump shows the bare off: stored as 'off': null, which sends nothing except under the DeepSeek dialect. You can skip this whole block for local Ollama and llama.cpp: every November run in this guide used the plain route and finished. The dsh cheat sheet keeps the supportsDeveloperRole and maxTokensField keys next to the Ollama, llama.cpp and vLLM base URLs on one page.

Serve the same agent from vLLM

vLLM enforces things Ollama waves through, so it needs flags for agent work and not just a model. The serve command and the errors below come from the August GPU run on an RTX 4090; the vLLM route in the patch above composed on rc.5 in November, and in October the same route reached the transport stage against an absent server (dsh: TRANSPORT: Connection error.), proving dsh accepted it:

vllm serve Qwen/Qwen3-4B-Instruct-2507 \
  --host 127.0.0.1 --port 8000 \
  --max-model-len 32768 \
  --gpu-memory-utilization 0.85 \
  --enable-auto-tool-choice --tool-call-parser hermes

Export a placeholder key for the route (export VLLM_API_KEY=vllm) for the same reason as with Ollama. Both routes can live in the same patch and the picker lists both. Two failures are worth knowing before you hit them.

Error: ‘”auto” tool choice requires –enable-auto-tool-choice and –tool-call-parser to be set’

Leave those two flags off the server and every agent turn fails. The harness never names a tool choice; vLLM defaults tool_choice to auto whenever a request carries tools, then rejects its own default with a 400 that dsh passes through verbatim:

dsh: INVALID_REQUEST: 400: {"message":"\"auto\" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set","type":"BadRequestError","param":null,"code":400}

The parser is model-specific, and the wrong one gives you an agent that talks about calling tools without calling any. hermes worked for Qwen3 instruct in our run, although the vLLM tool calling reference lists it against the Qwen2.5 family and sends the Qwen3-Coder models to qwen3_xml, so check that table for your own model. Restarting vLLM with both flags is the whole fix; nothing changes on the dsh side. The server side is covered in the vLLM production install guide.

Error: “4.5 GiB KV cache is needed, which is larger than the available KV cache memory”

Running Ollama and vLLM on one GPU causes this. Ollama keeps its model resident after a request, vLLM pre-allocates against what’s left, and the engine refuses to start rather than serve a context it can’t honour:

ValueError: To serve at least one request with the model's max seq len (32768), (4.5 GiB KV cache is needed, which is larger than the available KV cache memory (3.57 GiB).

Unload the other model first. Ollama frees the card immediately and reloads on the next request, which took VRAM in use from 9,986 MiB to 1 MiB on the August box:

ollama stop qwen3:8b
nvidia-smi --query-gpu=memory.used --format=csv,noheader

With the card to itself, vLLM loaded 7.64 GiB of weights in 5.06 seconds and reported a KV cache of 86,752 tokens. The API took 70 to 100 seconds from launch to answering on /v1/models, so scripts that start the server and fire a task straight away need to poll rather than sleep. If the driver stack isn’t in place yet, start with the NVIDIA driver and CUDA setup.

Run DeepSeek Harness on llama.cpp

llama-server speaks the same protocol, so its route is a plain openai-completions route with port 8080 and the model name the server reports. Getting the binary is where a packaging detail costs people time: llama.cpp tags a build per release, and the GitHub releases/latest endpoint returns a v tag (v1.0.0 in late November) rather than the newest b build. Ask for the first entry in the list instead. We ran this on the same kind of 22 vCPU Ubuntu 26.04 VM as the Ollama steps, with no GPU:

LC_TAG=$(curl -sL "https://api.github.com/repos/ggml-org/llama.cpp/releases?per_page=1" \
  | grep -m1 '"tag_name"' | grep -o 'b[0-9]\+')
echo "${LC_TAG:?no b build tag found}"
curl -fsSLO "https://github.com/ggml-org/llama.cpp/releases/download/${LC_TAG}/llama-${LC_TAG}-bin-ubuntu-x64.tar.gz"

The tag came back as b12633. Each build also ships CUDA, Vulkan and ROCm tarballs for Ubuntu, swapped into the file name above when you have a GPU; the CUDA builds come with a separate cudart-llama tarball you need when the CUDA runtime isn’t installed. The CPU tarball is the one to test with, and on a minimal Ubuntu 26.04 cloud image it refused to start:

./llama-server: error while loading shared libraries: libgomp.so.1: cannot open shared object file: No such file or directory

The prebuilt CPU backends link against the GNU OpenMP runtime, which the cloud image does not install. One package fixes it. Install it, extract the build and start the server:

sudo apt install -y libgomp1
tar -xzf "llama-${LC_TAG}-bin-ubuntu-x64.tar.gz"
cd "llama-${LC_TAG}"
./llama-server -hf ggml-org/Qwen3-1.7B-GGUF --host 127.0.0.1 --port 8080 -c 16384 --jinja

--version then reported 1.0.0-dev (build 12633, commit 9c10c94e1), and the server downloaded the GGUF, opened four slots sharing one 16,384-token KV cache and listened on port 8080. Tool calling depends on the Jinja chat template. Current builds enable it by default, and we pass --jinja anyway so the same command works on older builds; --no-jinja is the switch to avoid, because tool calls then come back as plain text and the agent becomes a chatbot. A raw request with one tool attached came back as a proper call:

{"finish_reason":"tool_calls","tool_calls":[{"type":"function","function":{"name":"read_file","arguments":"{\"path\": \"parts.csv\"}"},"id":"eDFioBg4OaLnGkUPwMVSuSOIFZst1Z2Y"}]}

The route is the Ollama block with a different key, port and model id. Use the id /v1/models reports, which for -hf is the repository name, and keep contextWindow equal to the -c value so dsh never plans for more context than the server holds. This is the whole file that ran, replacing the Ollama patch; to keep both, put the llamacpp: provider under the existing providers: key instead and point agent-default-model at it:

- id: llm-pi-ai
  config:
    providers:
      llamacpp:
        displayName: llama.cpp
        apiKeyEnv: LLAMACPP_API_KEY
        api: openai-completions
        baseURL: http://127.0.0.1:8080/v1
        models:
          - id: ggml-org/Qwen3-1.7B-GGUF
            name: Qwen3 1.7B GGUF
            contextWindow: 16384
            maxTokens: 8192
- id: agent-default-model
  config:
    provider: llamacpp
    model: ggml-org/Qwen3-1.7B-GGUF

Export any value as LLAMACPP_API_KEY (we used local) and rerun the same parts.csv task from the first-task section. The first run printed the right answer and exited 0 in 1 minute 15 seconds:

The total quantity from parts.csv is 15.

real	1m15.132s
user	0m3.475s
sys	0m0.390s
exit=0

Then we looked at the workspace. The model had read the file, called job_kill on a job that never existed, closed a goal, and finally used write to replace parts.csv with its own numbered summary:

1: name,3
2: widget,12
3: bolt,15

That is the 1.7B model, not llama.cpp: the server returned well-formed calls every time and the session log recorded "provider":"llamacpp" with a 16,384-token window. A second run on a fresh file took 44 seconds, read it, made one stray job_kill and left the data alone. So a model this small can answer, but point it at a scratch directory, never a workspace you care about. Speed was not the problem. llama-server read the 5,732-token first prompt in 18 seconds at 318 tokens per second and generated at 16 to 17 tokens per second. That is about twice the 8B model’s rate under Ollama on the same class of VM, mostly because the model is a fifth the size, and the whole turn landed close to the 57 seconds Ollama needed for the same 1.7B model. The llama.cpp guide covers GPU builds.

Pick the model before you pick the server

Our table mixes two labs, so read the rows by date. The GPU rows ran twice each on an RTX 4090 in August. The November rows ran on the 22 vCPU VM against the current release, once each except llama.cpp, all with the same parts.csv task except the Web UI row, which asked the model to list the workspace and describe the file.

Server and modelHardwareRun 1Run 2Notes
Ollama, qwen3:8b (Q4, thinking on)RTX 4090, Aug 202652.4 s65.9 sCorrect both runs
vLLM, Qwen3-4B-Instruct-2507 (bf16, no thinking)RTX 4090, Aug 20264.38 s4.38 sCorrect both runs
llama.cpp b12633 CPU build, Qwen3-1.7B GGUF, 16K context22 vCPU, Nov 20261 min 15 s44 sCorrect both runs; run 1 overwrote parts.csv
Ollama, qwen3:1.7b, 4K served context22 vCPU, Nov 20269 min 44 snot runNo answer, 37 write calls, file never read
Ollama, qwen3:1.7b, 32K context22 vCPU, Nov 202657 snot runCorrect, one read call
Ollama, qwen3:8b, 32K context22 vCPU, Nov 20262 min 34 snot runCorrect, one read call
Ollama, qwen3:8b, Web UI turn22 vCPU, Nov 20266 min 44 snot runCorrect, 3 steps, 65% cache hit

The two Ollama 1.7B rows are the lesson of this refresh. Same model, same task, same VM: the only change was OLLAMA_CONTEXT_LENGTH, and it moved the result from ten minutes of damage to a correct answer in under a minute. Context matters more than parameter count at this size. Beyond that, models differ in size, quantisation and whether they think, so the gaps aren’t the serving stack alone. A thinking model spends most of a turn on reasoning tokens the agent loop throws away, and for tool-driven work an instruct model of half the size finished an order of magnitude faster on the GPU with the same answer.

You can repeat the comparison on your own hardware, because the Web UI puts per-turn numbers under each answer. This is the November turn through ollama launch dsh with the home patch in place:

DeepSeek Harness Web UI turn on local Ollama qwen3 8b completed in 6m 44s with 28.6K tokens and 65 percent cache hit

Listing one file and describing it took 6 minutes 44 seconds over three steps at 5.8 tokens per second, with 28.6K tokens of usage, a 65% cache hit and 30% of the context used. In August the same 8B model on the RTX 4090 ran a similar two-step task at 61 tokens per second with a 7.1-second time to first token. That’s a tenfold gap in generation speed, and on CPU the prompt reading adds more on top.

A GPU for the local route

The tenfold gap above is the case for a GPU. An 8B model at Q4 needs about 5 GB for weights, so a 16 GB card holds it with room for the 32K context the agent needs. These prices were checked on Amazon in December 2026.

ASUS Dual RTX 5060 Ti 16GB

The RTX 5060 Ti 16GB holds qwen3:8b at the 32K context this guide sets for the agent, with the whole model on the GPU instead of the CPU. Check the ASUS Dual RTX 5060 Ti 16GB White OC on Amazon.

ASUS Dual GeForce RTX 5060 Ti 16GB graphics card for running DeepSeek Harness on a local model
ASUS Dual RTX 5060 Ti 16GB White OC: 16 GB GDDR7, about $800 to $900 on Amazon in December 2026. Image: ASUS.

EVGA RTX 3090 FTW3 Ultra 24GB

A 24 GB card is the class we ran the GPU rows on, an RTX 4090, and the RTX 3090 reaches the same memory for less money. The extra 8 GB over the 16 GB pick goes to a bigger model or a longer context. Our 4.38-second vLLM run was on the 4090, so expect a 3090 to take longer. See the EVGA RTX 3090 FTW3 Ultra listing on Amazon.

EVGA GeForce RTX 3090 FTW3 Ultra 24GB graphics card for local coding agents with Ollama and vLLM
EVGA RTX 3090 FTW3 Ultra: 24 GB GDDR6X, about $2,200 on Amazon in December 2026. Image: EVGA.

Add a local provider from the Web UI

Settings live behind the More button at the bottom of the sidebar, not the More entry near the top, which opens plugins. Open it and pick Settings:

DeepSeek Harness sidebar More menu open with Settings marked
  1. 1More
  2. 2Settings

The Models tab is where routes report their state. A hand-declared route carries a Custom badge, and the dot is the quickest health check you have: green means dsh resolved a credential for that route, red means it didn’t, which is what the stock DeepSeek row looks like on a box without a DeepSeek key:

DeepSeek Harness Settings Models page with the Ollama route marked Custom and a green credential dot

You can also start a route here instead of typing YAML. “Add model provider” opens on a Third-party model provider tab for catalog providers. Switch to Custom model API and it asks for a lowercase Provider ID, a display name, the Base URL, the API protocol (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and now Gemini API) and a key. Fetch available models queries the endpoint, which is the safest way to avoid the UNKNOWN_MODEL error above:

DeepSeek Harness Custom model API form with the Ollama base URL and Fetch available models marked
  1. 1Custom model API
  2. 2Base URL
  3. 3Fetch available models

Against Ollama, the fetch came back with every pulled tag and both checked by default:

DeepSeek Harness Choose models dialog listing qwen3 8b and qwen3 1.7b fetched from Ollama

Here’s the catch the current release added. With our home patch in place, Create provider refused to save anything and printed a red line under the model list:

DeepSeek Harness refusing Create provider because llm-pi-ai is overridden by a home patch or command-line overlay

“Configuration for “llm-pi-ai” is overridden by a home patch or command-line overlay” means exactly that: once ~/.dsh/cordis.patch.yml declares llm-pi-ai, the form can’t add a provider alongside it, and the web profile’s own patch file stayed untouched. So pick one route source:

  • Home patch: reaches web, headless and the launcher, holds compat switches and headers, and keeps the key in an environment variable
  • Web form: works only while no home patch declares llm-pi-ai; in October it wrote to ~/.dsh/profiles/web/cordis.patch.yml, so headless never saw the route

We keep routes in the home patch and use the form only to discover model ids, then cancel. The “Open configuration file” button in the Settings header is the quickest way back to the YAML when you’re on a loopback connection.

Where the local route still bites

Tool schemas are the hidden cost. Standard mode sent 25 tool schemas on every request in the August and October labs, with no MCP servers attached, and the first agent request in November came to 5,006 prompt tokens. On a local model you pay that in prompt-processing time rather than dollars, and on CPU it was the biggest single slice of the wait. Trimming the preset is the lever that matters; comparing dsh with Claude Code covers what each preset contains.

Prompt caching works on Ollama now, and it’s what keeps later steps cheap. The second step of the headless run had only 303 new prompt tokens to process, and the Web UI turn closed on a 65% cache hit. In August the Ollama session showed 0% because Ollama did not report cached tokens; current releases do and dsh counts them. vLLM still reports them only when the server runs with --enable-prompt-tokens-details, which the serve command above doesn’t set.

One more default needs pinning down. A model with no declared capacity falls back to the route default of 262,144 tokens, which is a guess, so declare contextWindow on every model. Hand-declared models are also text-only until you add input: [text, image]. If you run DeepSeek Harness on Ollama day to day, the setup we’d keep is the home patch with the launcher-compatible key name exported in your shell profile, a context length pinned on both sides and checked in the journal, Node 24 from NodeSource, and an 8B or larger model, ideally on a GPU. A route that loads is only half the job; a route served at 4K will run for ten minutes, report success and leave junk in your workspace.

Keep reading

Run Amazon Ergo Locally: Hardware Requirements and vLLM Setup AI Run Amazon Ergo Locally: Hardware Requirements and vLLM Setup Open Source LLM Comparison Table (2026) AI Open Source LLM Comparison Table (2026) Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI NAS Explained: Is Local AI on a NAS Worth It? AI AI NAS Explained: Is Local AI on a NAS Worth It? MedGemma 2 vs Gemma 4 vs MedGemma 1.5: Local Benchmark AI MedGemma 2 vs Gemma 4 vs MedGemma 1.5: Local Benchmark Best Claude Code Books and AI Coding Agent Books (2026) AI Best Claude Code Books and AI Coding Agent Books (2026)

Leave a Comment

Press ESC to close