Introduction¶
DeepSeek Harness (dsh) uses a plugin architecture. When building an agent, if you need the model to produce structured decision results (such as probability distributions or confidence scores) rather than free-form text, calling a large model directly often makes it hard to obtain precise data. Although the official Jev (TypeSafe) API provides this capability, there are restrictions around API key access and network connectivity. The dsh-jev-adapter plugin solves this problem. It registers the jev_decide tool in DSH, applies the Jev (System One) decision-model paradigm to any OpenAI-compatible LLM, and the default channel does not require a TypeSafe API key.
What Is This?¶
A DSH plugin maintained by BetterZflyee. It is an adapter whose core value is registering the jev_decide tool so that any OpenAI-compatible model can support a typed decision paradigm. You can think of it as a conversion layer: it translates the user’s natural-language instructions into Jev-style typed questions (choice/score/boolean), and parses the model’s response into a structured probability distribution.
Core Features¶
- Tool registration: Registers the
jev_decidetool in DeepSeek Harness for the Agent to invoke. - Question type support: Supports three question types:
choice(choice),score(score), andboolean(boolean). - Model compatibility: Uses the
openaichannel by default and supports any OpenAI-compatible endpoint (DeepSeek API, Ollama, vLLM, etc.). It also supports thetypesafechannel for direct access to the official API. - Special handling: Handles cases where the model returns its answer in
reasoning_contentwhilecontentis empty. - Fault tolerance: Supports exponential backoff retries for 429/5xx errors (3 retries by default); automatically renormalizes probabilities if they do not sum to 1; degrades all-zero answers to a uniform distribution.
Installation and Configuration¶
Add it using DSH’s plugin installation command:
dsh plugin --profile <profile> add github:BetterZflyee/dsh-jev-adapter
After installation, configure environment variables or modify the configuration file. For the default openai channel, no TypeSafe API key is required; only the key for an OpenAI-compatible endpoint is needed:
# 设置 OpenAI 兼容端点的密钥
export JEV_OPENAI_API_KEY="sk-..."
# 可选配置覆盖
# export JEV_BASE_URL="https://api.deepseek.com/v1"
# export JEV_MODEL="deepseek-chat"
You can also configure the plugin in cordis.patch.yml, specifying channel (default is openai) and corresponding parameters such as apiKey and baseURL.
Typical Usage¶
The Agent can trigger the jev_decide tool directly in the conversation. For example, classify 12 tickets:
把这 12 条工单分类:部门 + 紧急度 + 客户情绪
The Agent will package this set of judgments as typed questions into a single jev_decide call and return a probability distribution table. Based on the returned confidence, the Agent can make routing decisions:
confidence ≥ 0.85→ auto-execute0.5 – 0.85→ generate a draft and ask for human confirmation< 0.5→ route to human handling
Use Cases and Notes¶
- Use cases: When you need the model to output structured decision probabilities (such as multi-choice probabilities or scoring probabilities); when you use locally deployed models (Ollama/vLLM) or third-party gateways and cannot obtain or do not want to use the official TypeSafe API.
- Notes:
- Under the
openaichannel, the probabilities output by the model are “self-reported estimates,” not mathematically strictly calibrated probabilities. Each result should be interpreted with this caveat in mind. - The plugin runs with the permissions of the current dsh process. Before installation, it is recommended to review the source code (especially the prompt logic in
lib/adapter.js) and the license (MIT).
- Under the
Short Closing¶
dsh-jev-adapter allows developers to obtain Jev-like structured decision capabilities using existing OpenAI-compatible models, without depending on specific API keys or network environments. It combines the decision paradigm with general-purpose LLMs and is suitable for agent scenarios that require probabilistic routing and structured outputs.