Introduction¶
When building agents with DeepSeek Harness (DSH), the Provider Route layer is typically responsible for routing configuration and credential management. However, relay services such as MotoMoto may have specific protocol requirements (such as specific request headers, parameter filtering, or streaming response handling), and these details go beyond the expressive power of standard routing configuration. The dsh-llm-motomoto plugin fills this gap, handling relay “line-level” details (such as header rewriting, parameter cleanup, and connection closing), and providing real-time routing status monitoring in the settings page.
Core Features¶
- Protocol Adaptation: Sets the API to
openai-completionsto conform to MotoMoto’s endpoint specification. - Request Transformation: Automatically rewrites
User-Agent, sets theoriginatorheader, and automatically removes request body parameters rejected by upstream services (such asmax_output_tokens). - Streaming Response Handling: Closes the connection after detecting the SSE terminal event or Chat Completions’
data: [DONE], preventing connection leaks. - Scope Isolation: Only applies to the
motomoto.lolhost; requests to other hosts are unaffected. - Configuration Loading: Loads runtime configuration from the
llm-motomotokey in~/.dsh/settings.yaml. - Status Monitoring: Provides a real-time status card on the settings page (requires dsh >= 0.1.7).
- Architecture Design: Does not include a Provider Route, fully relying on users to configure routing at the settings layer.
Installation¶
Install the plugin using a local file path:
git clone https://github.com/HandsYe/dsh-llm-motomoto
dsh plugin --profile desktop add "file:<克隆下来的仓库路径>"
Configuration and Usage¶
The plugin itself does not include a Provider Route. You need to configure the route at the user settings layer and define the relay behavior at the plugin configuration layer.
1. Configure Relay Plugin Parameters¶
Add the llm-motomoto field to ~/.dsh/settings.yaml:
llm-motomoto:
host: motomoto.lol # 请求目标主机
userAgent: codex_cli_rs/0.46.0 (Windows 10.0.26200; x86_64) WindowsTerminal
originator: codex_cli_rs # 空字符串可省略该头部
headers: {} # 额外头部,空值表示移除
stripBodyParams: # 后端拒绝的请求体字段
- max_output_tokens
2. Configure Provider Route¶
Add a motomoto route to the llm-pi-ai provider, specifying the API type and endpoint:
llm-pi-ai:
providers:
motomoto:
displayName: MotoMoto
apiKeyEnv: MOTOMOTO_API_KEY
api: openai-completions # 使用 openai-completions 端点
baseURL: https://motomoto.lol/v1
models:
- id: gpt-5.5
3. Verify Status¶
After installation, go to Settings -> MotoMoto relay to view the real-time routing status card and confirm that the configuration is effective.
Notes¶
- Credential Security: The plugin does not store the API key. Credentials must be provided through the environment variable
MOTOMOTO_API_KEY. - Upstream Stability: The MotoMoto API is described as “best effort” and may return 502 errors. The plugin cannot fix faults in the relay provider’s backend.
- Version Requirement: The settings status card feature requires dsh >= 0.1.7. Older versions use the
llm-motomoto:key name. - Scope Limitation: Only applies to the
motomoto.lolhost; requests to other hosts are unaffected by the plugin.