Introduction

The model adaptation layer of DeepSeek Harness (DSH) has two main blocking issues when integrating with Alibaba Cloud Bailian: the built-in dsh-llm-deepseek adapter directly throws UNSUPPORTED_CONTENT and refuses to process images; the dsh-llm-pi-ai adapter sends system prompts as role: 'developer', causing Bailian to return 400 role 'developer' is not allowed. The sologuy/dsh-llm-bailian-kimi plugin resolves these issues by adapting to Bailian’s OpenAI-compatible interface and natively supports image input, thinking chains, and tool calling for the kimi/kimi-k3 model in DSH.

Plugin Introduction

dsh-llm-bailian-kimi is an LLM adapter plugin for DeepSeek Harness, developed by maintainer sologuy. It focuses on resolving compatibility issues when calling Kimi models on Alibaba Cloud Bailian (DashScope) within DSH, especially support for image input and multimodal capabilities.

Core Features

The plugin provides the following capabilities:
* Image input (multimodal): Supports declaring and transmitting images via input: [text, image].
* Streaming output + thinking chain: Supports streaming responses and parses the reasoning_content field to display the thinking process.
* Function Calling: Supports the tool calling interface.
* Statistics: Provides token usage and cache hit statistics.
* Zero build: Implemented in pure ESM JavaScript, requiring no build steps; install directly via dsh plugin add.

Installation and Activation

The plugin installation process relies on DSH’s profile mechanism.

1. Install the plugin
Run the following command in the terminal:

dsh plugin --profile web add github:sologuy/dsh-llm-bailian-kimi

Because the plugin is pure ESM, it does not trigger pnpm’s allowBuilds interception.

2. Configure credentials
Add the Alibaba Cloud Bailian API Key to DSH’s credentials file $DSH_HOME/.credentials.yaml:

DASHSCOPE_API_KEY: sk-xxxxxxxx

3. Configure the model
Add a plugin configuration block to $DSH_HOME/settings.yaml. This block supports hot loading, so changes take effect without restarting (provided the plugin has been correctly resolved).

llm-bailian-kimi:
  apiKeyEnv: DASHSCOPE_API_KEY
  baseURL: https://dashscope.aliyuncs.com/compatible-mode/v1
  reasoningEffort: max          # high | max
  models:
    - id: kimi/kimi-k3
      name: Kimi K3 · 百炼
      description: 1M 上下文 · 支持图片
      contextWindow: 1000000
      input: [text, image]      # 声明 image 才能发图

Notes

When using this plugin, be aware of the following Bailian-specific limitations:

  • System prompt role: System prompts must use role: 'system'; using developer will cause a 400 error.
  • Tool call follow-up chunks: The id and name fields in tool call follow-up chunks are JSON null. The check logic should be written as typeof x === 'string' && x.length > 0; using !== undefined can be broken by null values.
  • Thinking chain disabling: Do not send thinking: {type: 'disabled'}. kimi-k3 does not allow disabling thinking; forcing it will return a misleading temperature error.
  • Input declaration: The model must declare input: [text, image] in its configuration before images can be sent; otherwise the endpoint will reject the request.
  • Streaming timeout: The idle timeout for streaming output is set to 300000ms.

Conclusion

This plugin, in the form of an adapter, fills the gap in DSH’s ecosystem for connecting to Bailian Kimi models, especially resolving the lack of image and system prompt support in native adapters. For detailed documentation or source code, visit the GitHub repository.