Skip to content

Kimi is only reachable as an ACP harness, not as an LLM provider for buzz-agent #3853

Description

@Wecko-ai

Summary

Kimi is reachable in Buzz today only as an ACP harness (kimi acp, PresetHarness { id: "kimi", label: "Kimi Code" } in desktop/src-tauri/src/managed_agents/discovery/presets.rs). There is no way to run the native Buzz Agent harness on Kimi models (K3 and friends) without hand-editing config files, even though Kimi ships an OpenAI-compatible endpoint that already satisfies Buzz's discovery contract.

I would like to add kimi as a first-class LLM provider for buzz-agent, mirroring the merged OpenRouter work in #1975.

Current behaviour

Settings → Default harness Buzz → Provider OpenAI-compatible → paste a Kimi API key → Model dropdown shows No models found.

Cause: discovery calls {OPENAI_COMPAT_BASE_URL}/models and the var defaults to https://api.openai.com/v1:

// desktop/src-tauri/src/commands/agent_models.rs
fn openai_compatible_models_url_for_discovery(env: &BTreeMap<String, String>) -> String {
    let base_url = env_or_process_value(env, "OPENAI_COMPAT_BASE_URL")
        .unwrap_or_else(|| "https://api.openai.com/v1".to_string());
    format!("{}/models", base_url.trim_end_matches('/'))
}

The Kimi key against api.openai.com returns 401, so the list comes back empty. Injecting OPENAI_COMPAT_BASE_URL=https://api.kimi.com/coding/v1 into global-agent-config.json by hand makes discovery and chat work, which confirms the wire format is compatible — it is purely a discoverability/configuration gap.

(#3798 adds a Base URL field for the generic openai-compat provider. That is complementary: this issue is about a named provider with a baked endpoint, model catalog and effort mapping, the same treatment OpenRouter got.)

Endpoint facts (verified against the live API)

  • GET https://api.kimi.com/coding/v1/models200, returns k3 (1M context, think_efforts: ["low","high","max"], default high), k3-256k, kimi-for-coding, kimi-for-coding-highspeed.
  • POST /chat/completions → standard OpenAI chat shape; reasoning_effort accepted; replies carry reasoning_content plus usage.completion_tokens_details.reasoning_tokens.
  • Bearer auth, so provider.required_env / bearer_auth paths need no special-casing.

Proposal

Follow the shape of #1975 (feat: add first-class OpenRouter provider support):

  • crates/buzz-agent/src/config.rsProvider::Kimi, resolve "kimi", credential KIMI_API_KEY.
  • crates/buzz-agent/src/llm.rs — default base URL https://api.kimi.com/coding/v1 (overridable via KIMI_BASE_URL, so platform users can point at their own endpoint), OpenAI chat-completions wire format, reasoning_content handling.
  • desktop/src-tauri/src/commands/agent_models*.rs + managed_agents/readiness.rs — live model discovery against /models, required-env wiring.
  • desktop/src/features/agents/ui/agentConfigOptions.tsx{ id: "kimi", label: "Kimi" } in PERSONA_LLM_PROVIDER_OPTIONS + PROVIDER_CREDENTIAL_CONFIG entry; effort table entry for the low | high | max triple.
  • crates/buzz-agent/README.md + unit tests alongside the existing provider tests.

Related

Offer

Happy to implement and open the PR (DCO signed off, Conventional Commit title, just ci green) if a maintainer confirms the approach — in particular whether the default endpoint should be the Kimi For Coding base (https://api.kimi.com/coding/v1) or the pay-per-token platform base, with the other reachable via KIMI_BASE_URL.

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