Preface

DeepSeek Harness (DSH) adopts a plugin-based architecture, aiming to allow model inference capabilities to be integrated flexibly through plugins. Integrating third-party models typically requires manually configuring Provider routes. myk5010/dsh-kimi is a plugin package that integrates Kimi (Kimi Code account) into DSH as a first-class model provider, providing routing, models, device-code login, and automatic Token refresh.

Core Features

This plugin includes the following core capabilities:

  • Provider Route: Configure the kimi provider to cover https://api.kimi.com/coding/v1, using the OpenAI Responses protocol (pi-ai adapter).
  • Model List: Provides four model options: kimi-for-coding (K2.7 Coding), kimi-for-coding-highspeed, k3 (1M context), and k3-256k.
  • Login Method: Uses the device-code OAuth flow from Kimi Code. DSH maintains an independent OAuth session, and its refresh-token family is isolated from Kimi Code CLI Tokens, so refreshing does not cause the CLI to log out.
  • Automatic Refresh: Tokens are checked every 5 minutes and refreshed automatically before expiration. The Access Token is stored in the KIMI_CODE_ACCESS_TOKEN credential reference.
  • Agent Tools: Provides three command-line tools for the Agent to call: kimi_login_begin, kimi_login_status, and kimi_login_refresh.
  • Compatibility Design: If the DSH Host provides an authorization service, the plugin registers the device-code flow as the authorization flow for llm-pi-ai/kimi.

Installation and Enablement

  1. Download the corresponding tarball package from GitHub Releases.
  2. Install it using the dsh plugin command, specifying a profile (for example, web).
dsh plugin --profile web add ./dsh-kimi-provider-<version>.tgz

After installation, restart the DSH Web process.

Typical Usage

On first use, you need to complete Kimi account authorization in DSH:

  1. Start Authorization: Have the Agent run the kimi_login_begin command. This returns a Kimi authorization URL and a device code.
  2. Confirm Authorization: Open the returned URL in a browser and complete confirmation.
  3. Complete: After restarting the DSH Web process, the four Kimi models become visible in the model selector. Tokens are maintained automatically in the background.

For Headless environments or other profiles, the installation command is as follows:

dsh plugin --profile headless add ./dsh-kimi-provider-<version>.tgz

Use Cases and Notes

This plugin is suitable for users who need to use Kimi Code models in a DSH environment. It reduces the overhead of manually configuring Providers and managing Tokens.

Runtime Environment Requirements:

  • DSH Host: Version 0.1.2-alpha.4 is required (or any version that includes the pi-ai LLM adapter, dsh plugin bundles, and the credentials service).
  • Node.js: Version >= 22.19 is required.
  • Dependencies: The system must have curl installed for OAuth HTTP calls.

Security and Storage:

  • Tokens are stored in DSH’s credential store at the path ~/.dsh/.credentials.yaml, with file permissions set to 0600.
  • The Refresh Token is stored only in the KIMI_CODE_REFRESH credential reference (a JSON string) and does not appear in source code or logs.
  • DSH’s OAuth session is independent from the Kimi Code CLI, and they do not interfere with each other.

Summary

myk5010/dsh-kimi seamlessly integrates Kimi Code capabilities into the DSH ecosystem through a plugin, providing automated Token management and model routing, and lowering the barrier to third-party model integration.

  • Catalog Page: [catalog_url]
  • Source Code: [github_url]