Skip to content

kimi (K3/K3-256K) delegation fails: wrong endpoint path + temperature must be 1 #18

Description

@Demon673

Environment

  • pi coding agent, @getpipher/vision 0.5.2
  • Primary model: deepseek-v4-flash (text-only) → DELEGATE mode
  • Vision model: kimi k3-256k (via the built-in kimi-coding provider, OAuth subscription)

Problem 1: wrong endpoint path (404)

callVisionModel requests ${visionModel.baseUrl}/chat/completions.

The built-in kimi-coding provider has baseUrl: https://api.kimi.com/coding (it uses the Anthropic Messages API, /v1/messages). Concatenating gives https://api.kimi.com/coding/chat/completions404.

Kimi's OpenAI-compatible endpoint is https://api.kimi.com/coding/v1/chat/completions (with the OAuth access token as Bearer).

Workaround: users must register a separate provider in models.json with baseUrl: https://api.kimi.com/coding/v1 + api: openai-completions, which is non-obvious and breaks the "just point at kimi-coding/k3" expectation.

Problem 2: hardcoded temperature: 0 is rejected by kimi (400)

lib/delegate.ts hardcodes temperature: 0. Kimi's OpenAI-compatible endpoint rejects it for k3/k3-256k:

400 invalid temperature: only 1 is allowed for this model

This makes kimi vision models completely unusable through the extension. Local fix: drop the temperature field (kimi defaults to 1).

Suggested fixes

  1. Omit temperature (or make it configurable) in callVisionModel — kimi requires 1, and temperature is irrelevant for image description anyway.
  2. For the endpoint: either document the baseUrl-with-/v1 workaround for kimi, or make the path join smarter (e.g. respect a baseUrl that already contains the API prefix).

Happy to submit a PR if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions