Back to home@phillarmonic

dsh-llm-kimi

A Kimi K3 connector plugin for the DeepSeek Harness LLM capability

Stars
0
Language
TypeScript
Created
Aug 25, 2026
Updated
Aug 25, 2026

Introduction

@phillarmonic/dsh-llm-kimi

A Kimi K3 connector plugin for the DeepSeek Harness llm capability seam.

It registers a direct-fetch LlmAdapter for the kimi-code provider route, streaming Kimi Code chat completions (an OpenAI-compatible dialect) as harness StreamChunks. Connection facts resolve per request, so a changed base URL, catalog, or key reaches the next request without a restart.

Install

Install as a DeepSeek Harness bundle so dsh plugin registers it automatically:

dsh plugin --profile <name> add @phillarmonic/dsh-llm-kimi
dsh --profile <name>

Or add it manually when you compose cordis.yml directly:

pnpm add @phillarmonic/dsh-llm-kimi

The harness packages are peer dependencies; install them alongside the plugin if they are not already present:

pnpm add @deepseek-ai/cordis @deepseek-ai/dsh-llm @deepseek-ai/dsh-credentials \
  @deepseek-ai/dsh-settings @deepseek-ai/dsh-launch-environment @deepseek-ai/dsh-timeout \
  @deepseek-ai/dsh-attachment @deepseek-ai/schemastery

Configure

Add the plugin to your cordis.yml. Every field is optional; the defaults target the public Kimi Code endpoint.

plugins:
  llm: {}
  '@phillarmonic/dsh-llm-kimi':
    apiKeyEnv: KIMI_CODE_API_KEY
    reasoningEffort: low

Then export your key (from the Kimi Code console at api.kimi.com) or store it through the harness credentials service:

export KIMI_CODE_API_KEY=sk-...

Select the provider and a model when you run a task, for example provider kimi-code with model k3.

Configuration

FieldDefaultDescription
apiKeyEnvKIMI_CODE_API_KEYCredential reference (environment-variable name) resolved per request.
baseURLhttps://api.kimi.com/coding/v1Endpoint base; /chat/completions is appended. Falls back to $KIMI_BASE_URL from a trusted environment layer.
reasoningEffortlowDefault thinking effort for the K3 family (low, high, max).
sendTemperaturefalseWhether to forward an explicit sampling temperature. Kimi enforces fixed sampling, so this stays off by default.
maxTokens131072Default per-request output cap; a model's own cap and explicit request values win.
defaultContextWindow1048576Context capacity used when the selected model has no exact value.
imagePixelBudget8294400Reject a request image whose intrinsic pixel count exceeds this budget. Default is Kimi's 4K ceiling (3840x2160).
imageMaxBytes1048576Reject a request image whose encoded byte length exceeds this budget. Keeps inline base64 within Kimi's per-message size limit.
modelsfour Kimi Code modelsAdvisory catalog shown by discovery consumers.
streamIdleTimeoutMs300000Maximum provider idle time while one stream read is outstanding.
retryPolicynormal, five retriesProvider-owned model-request retry policy.

Models

Model idContextReasoning effortImage input
k31,048,576low / high / maxyes
k3-256k262,144low / high / maxyes
kimi-for-coding262,144always on (no effort levels)yes
kimi-for-coding-highspeed262,144always on (no effort levels)yes

Image input

All four Kimi Code models accept images. When a request carries image content, the adapter reads each image through the harness attachment service (ctx.attachments) and inlines it as a base64 image_url data URL. The attachment service is optional: a request with images fails loudly when it is not mounted, and text-only requests never touch it.

Budgeting is enforced inside this plugin from the durable attachment metadata, before any bytes are read. An image whose pixel count exceeds imagePixelBudget, or whose encoded byte length exceeds imageMaxBytes, is rejected rather than pushing the request past Kimi's per-message size limit. A request that sends image content to a model configured without image support is rejected too.

Behavior notes

  • All four Kimi Code models accept image input; see Image input for how images are resolved and budgeted.
  • Kimi enforces fixed sampling. The adapter does not send temperature, top_p, or n unless sendTemperature is enabled.
  • While thinking is enabled, an assistant message with tool calls must carry its reasoning_content. The adapter replays the harness reasoning block onto that field so multi-turn tool sessions stay valid.
  • Kimi cannot disable thinking without routing to a weaker model, so the adapter never sends an off or none effort. The K3 family exposes low, high, and max; the coding models keep thinking on with no effort selector.

Development

pnpm install
pnpm run typecheck
pnpm run test
pnpm run build

License

MIT. See LICENSE.