Skip to content

feat(llm): support Kimi Code models (kimi-for-coding, k3)#117

Merged
jkyberneees merged 1 commit into
mainfrom
feat/kimi-code-support
Jul 26, 2026
Merged

feat(llm): support Kimi Code models (kimi-for-coding, k3)#117
jkyberneees merged 1 commit into
mainfrom
feat/kimi-code-support

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

What

Makes odek work against Kimi Code's OpenAI-compatible endpoint (https://api.kimi.com/coding/v1), model IDs kimi-for-coding, kimi-for-coding-highspeed, k3, k3-256k.

Changes

  • internal/llm/client.go — Kimi Code rejects any explicit temperature other than the default (1) with 400 invalid temperature: only 1 is allowed for this model. Added the kimi-for-coding and k3 prefixes to modelForbidsTemperature so the client omits the field, matching the existing handling for OpenAI reasoning models (o1/o3/o4, gpt-5).
  • cmd/odek/main.go — the documented --temperature flag was parsed into flags.Temp but never consumed; every run kept the hardcoded deterministic default (0). Wired it into the agent config (odek run). odek continue takes no CLI flags and keeps the fixed default.
  • internal/llm/client_test.go — extended TestCall_OmitsTemperatureForReasoningModels with Kimi cases (incl. case-insensitivity and a negative kimi-latest control for Moonshot-platform models).

Verification

  • Live-tested against the real Kimi Code endpoint with kimi-for-coding: plain runs and tool-calling loops (math_eval) succeed; context window (262144) is auto-discovered from /models.
  • go test ./internal/llm/ ./cmd/odek/ -count=1 — both packages pass.

Kimi Code's OpenAI-compatible endpoint (https://api.kimi.com/coding/v1)
rejects any explicit temperature other than the default (1) with a 400
"invalid temperature: only 1 is allowed for this model". Add the
kimi-for-coding* and k3* model ID prefixes to modelForbidsTemperature so
the client omits the field, matching the existing handling for OpenAI
reasoning models.

Also wire the documented --temperature CLI flag into the agent config:
it was parsed into flags.Temp but never consumed, so every run kept the
hardcoded deterministic default (0). The continue command takes no CLI
flags and keeps the fixed default.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 065dc81 Commit Preview URL

Branch Preview URL
Jul 26 2026, 07:01 PM

@jkyberneees
jkyberneees merged commit c7699de into main Jul 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant