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
kimiprovider to coverhttps://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), andk3-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_TOKENcredential reference. - Agent Tools: Provides three command-line tools for the Agent to call:
kimi_login_begin,kimi_login_status, andkimi_login_refresh. - Compatibility Design: If the DSH Host provides an
authorizationservice, the plugin registers the device-code flow as the authorization flow forllm-pi-ai/kimi.
Installation and Enablement¶
- Download the corresponding tarball package from GitHub Releases.
- Install it using the
dsh plugincommand, 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:
- Start Authorization: Have the Agent run the
kimi_login_begincommand. This returns a Kimi authorization URL and a device code. - Confirm Authorization: Open the returned URL in a browser and complete confirmation.
- 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 pluginbundles, and thecredentialsservice). - Node.js: Version >= 22.19 is required.
- Dependencies: The system must have
curlinstalled 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_REFRESHcredential 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]