DeepSeek Harness
Configure a custom provider for DeepSeek Harness (dsh).
DeepSeek Harness (command dsh) is DeepSeek's open-source agent runtime. It ships with a web UI where you can add a custom model provider pointing at this site.
- Protocol: OpenAI-compatible or Anthropic
- Base URL:
https://tokenfunc.com/v1for OpenAI-compatible,https://tokenfunc.comfor Anthropic - Models: DeepSeek and others, for example
deepseek-chat
Start the web UI
Install Node.js first, then run:
npx @deepseek-ai/dsh webThe first start downloads dependencies and can take about two minutes with no progress output. Then open
http://127.0.0.1:3080in your browser.Add a model provider
Go to Settings → Models → Add model provider, switch the card to Custom model API and fill in:
Field Value Provider ID tokenfunc(lowercase only; cannot be changed after saving)Display name tokenfuncBase URL https://tokenfunc.com/v1API protocol OpenAI Chat Completions API key sk-xxxxxxxxxxxxxxxxScreenshot pendingThe Add model provider card in DeepSeek Harness switched to Custom model APItools/dsh-provider.png
A provider uses exactly one protocol. To also use Claude models over the Anthropic protocol, add a second provider with another ID (for example
tokenfunc-claude), API protocol Anthropic Messages and base URLhttps://tokenfunc.com.Add models
Under Model catalog click Fetch available models and tick the models you want. If the list cannot be fetched, type the model ID, for example
deepseek-chat.Screenshot pendingThe model checklist shown by Fetch available modelstools/dsh-models.png
Verify
After saving, choose the new model in the chat model picker and send a message. A reply means you are connected.
Configuring with a file
You can also declare the provider in ~/.dsh/profiles/web/cordis.patch.yml (or ~/.dsh/cordis.patch.yml to apply it to every profile):
- id: llm-pi-ai
config:
providers:
tokenfunc:
apiKeyEnv: TOKENFUNC_API_KEY
api: openai-completions
baseURL: https://tokenfunc.com/v1
compat:
supportsDeveloperRole: false
maxTokensField: max_tokens
models:
- id: deepseek-chatThe key is read from the TOKENFUNC_API_KEY environment variable, which must be set before starting dsh:
export TOKENFUNC_API_KEY="sk-xxxxxxxxxxxxxxxx"Troubleshooting
| Symptom | Cause and fix |
|---|---|
MISSING_CREDENTIAL | No key saved, or the variable was set after dsh started |
UNKNOWN_MODEL | The model is not added under this provider |
| 401 when fetching models | Wrong key. Check it on API Keys |
| Address and key are right but every request is rejected | Add supportsDeveloperRole: false and maxTokensField: max_tokens under the provider's compat (see the config above) |
| Mistyped Provider ID | It cannot be edited. Delete the provider and create it again |