deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
Xiaomi MiMo v2.5 adapter for DeepSeek Harness LLM seam.
reasoning_content field and translates it into harness ReasoningBlock formatreasoning_content in assistant messages on tool-call turns, as MiMo requiresrole: 'tool' messages; text-less assistant turns send "" (never null)| Model | Description |
|---|---|
mimo-v2.5-pro |
MiMo-V2.5-Pro — flagship model for complex reasoning tasks |
mimo-v2.5 |
MiMo-V2.5 — general-purpose model |
The package follows the harness package layout: pnpm build emits lib/ (JS)
plus lib/types/ (declarations), which main/exports/files reference.
pnpm install
pnpm build
pnpm test # vitest
pnpm typecheck
A running dsh is composed from ordered layers (the profile's
dsh.profile.bundles, then the profile's cordis.patch.yml, then the
home-level patch, then any --patch overlay) — a plugin package's own
cordis.yml is NOT auto-discovered. To use this adapter:
# From the profile directory (e.g. ~/.dsh/profiles/web), install the package:
pnpm add dsh-llm-mimo
Then append this block to the profile's cordis.patch.yml:
- insert:
- id: llm-mimo
name: 'dsh-llm-mimo'
config:
apiKeyEnv: MIMO_API_KEY
baseURL: https://api.xiaomimimo.com/v1
enableThinking: true
In the monorepo workspace, the package sits under packages/llm/llm-mimo and
is referenced by name the same way; the repo's tsconfig base replaces the
standalone tsconfig.json shipped here.
Set your MiMo API key:
export MIMO_API_KEY="your-api-key-here"
Or in .env file:
MIMO_API_KEY=your-api-key-here
Get your API key from MiMo Platform.
# From DeepSeek Harness checkout
pnpm dsh web
Then select mimo-official as the provider and choose a model.
import { Context } from '@deepseek-ai/cordis'
import llmMimo from 'dsh-llm-mimo'
const ctx = new Context()
ctx.plugin(llmMimo, {
apiKeyEnv: 'MIMO_API_KEY',
baseURL: 'https://api.xiaomimimo.com/v1',
enableThinking: true,
})
| Option | Type | Default | Description |
|---|---|---|---|
apiKeyEnv |
string |
MIMO_API_KEY |
Credential reference (environment-variable name) for the API key |
baseURL |
string |
https://api.xiaomimimo.com/v1 |
API endpoint base URL |
enableThinking |
boolean |
true |
Whether thinking mode is enabled by default |
maxTokens |
number |
256000 |
Default per-request output token cap |
defaultContextWindow |
number |
1000000 |
Default context window size |
models |
MiMoCatalogModel[] |
V2.5, V2.5-Pro | Advisory model catalog |
streamIdleTimeoutMs |
number |
300000 |
Stream idle timeout (ms) |
retryPolicy |
RetryPolicyConfig |
— | Custom retry policy |
MiMo v2.5 uses the reasoning_content field in SSE responses to stream thinking chain content. This is the same format used by DeepSeek's thinking mode.
{
"choices": [{
"delta": {
"reasoning_content": "Let me think about this...",
"content": null
}
}]
}
The adapter translates this into harness StreamChunk protocol:
// 1. Block start
{ type: 'block-start', index: 0, blockType: 'reasoning' }
// 2. Reasoning deltas
{ type: 'reasoning-delta', index: 0, text: 'Let me think about this...' }
// 3. Block end
{ type: 'block-end', index: 0, block: { type: 'reasoning', text: '...' } }
// 4. Text content (if any)
{ type: 'block-start', index: 1, blockType: 'text' }
{ type: 'text-delta', index: 1, text: 'The answer is...' }
{ type: 'block-end', index: 1, block: { type: 'text', text: '...' } }
MiMo requires reasoning_content to be preserved in assistant messages when
the assistant turn carried tool calls and thinking mode is enabled. On
tool-call-free turns the field is ignored by the provider, so this adapter
omits it there to save tokens.
enable_thinking (boolean): Controls thinking mode (non-OpenAI standard, passed via extra_body in Python SDK)max_completion_tokens: Used instead of max_tokens for output token limit| Feature | DeepSeek | MiMo |
|---|---|---|
| Thinking toggle | thinking.type: 'enabled' |
enable_thinking: true |
| Reasoning effort | reasoning_effort: 'low' |
Not supported |
| Stop sequences | No limit | Max 4 |
| Temperature range | [0, 2) | [0, 1.5] |
| Top-p range | (0, 1] | [0.01, 1] |
The adapter maps MiMo HTTP error codes to harness error codes:
| HTTP Status | Harness Code | Description |
|---|---|---|
| 401, 403 | AUTH |
Authentication failure |
| 400 | INVALID_REQUEST |
Bad request (including missing reasoning_content) |
| 429 | RATE_LIMIT |
Rate limit exceeded |
| 500+ | SERVER |
Server error |
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。