> Documentation index for agents: https://docs.rocketride.ai/llms.txt

# llm_kimi

A RocketRide LLM node that connects Moonshot AI's Kimi models to a pipeline through the OpenAI-compatible Moonshot API.

## What it does

Provides chat completion using Kimi and Moonshot models as an `llm`-class invoke filter. It can be wired directly via lanes or consumed by any agent or node that needs an LLM backend.

Built on **langchain-openai** (`ChatOpenAI`) pointed at the Moonshot endpoint; the **openai** SDK is used only for the save-time configuration probe. The request's `max_tokens` is set from the active profile's output token limit.

Temperature is set automatically per model family: Kimi K2 models run at temperature `1` (the API rejects any other value with "invalid temperature: only 1 is allowed for this model"), while the classic Moonshot v1 models run at temperature `0` for deterministic pipeline output.

When the node configuration is saved, cloud Moonshot endpoints (where `serverbase` contains `api.moonshot`) are validated with a minimal 1-token probe request. Failures are surfaced as warnings with the provider's HTTP status, error type, and message. Self-hosted or local OpenAI-compatible endpoints are not validated at save time.

## Lanes

| Lane in     | Lane out  | Description                                          |
| ----------- | --------- | ---------------------------------------------------- |
| `questions` | `answers` | Send a question directly, receive a generated answer |

## Profiles

Default: **Kimi K2.6** (`kimi-k2-6`).

| Profile | Model | Context tokens | Output tokens |
| ------- | ----- | -------------- | ------------- |
| Kimi K2.6 **(default)** | `kimi-k2.6` | 262,144 | 16,384 |
| MoonshotAI: Kimi K3 | `kimi-k3` | 1,048,576 | 943,718 |
| MoonshotAI: Kimi K2.7 Code | `kimi-k2.7-code` | 262,144 | 235,929 |

<details>
<summary><strong>View 9 more models</strong></summary>

| Profile | Model | Context tokens | Output tokens |
| ------- | ----- | -------------- | ------------- |
| Kimi K2.5 | `kimi-k2.5` | 262,144 | 16,384 |
| Moonshot v1 8K | `moonshot-v1-8k` | 8,192 | 4,096 |
| Moonshot v1 32K | `moonshot-v1-32k` | 32,768 | 4,096 |
| Moonshot v1 128K | `moonshot-v1-128k` | 131,072 | 4,096 |
| MoonshotAI: Kimi K2 0711 | `kimi-k2` | 131,072 | 100,352 |
| MoonshotAI: Kimi K2 0905 | `kimi-k2-0905` | 262,144 | 100,352 |
| MoonshotAI: Kimi K2 Thinking | `kimi-k2-thinking` | 262,144 | 100,352 |
| MoonshotAI Kimi Latest | `kimi-latest` | 1,048,576 | 943,718 |
| `kimi-k3-batch` | `kimi-k3:batch` | 1,048,576 | 943,718 |

</details>

The last collapsed profile is **deprecated**: `kimi-k3:batch` is an OpenRouter routing
alias, not a Moonshot model ID, so the Moonshot API has nothing to answer with. It stays
selectable so saved pipelines keep loading; use `kimi-k3` instead. It arrived through
OpenRouter fallback discovery in the model sync, the same way the deprecated profiles in
`llm_qwen` did.

## Configuration

Choose a model profile. The profile supplies the model identifier, context window,
and output limit, so the UI requires no additional model settings.

## Authentication

Cloud Moonshot endpoints require an API key starting with `sk-`. Any other format is rejected at startup with a key-format error. Keys are issued at the [Moonshot AI platform](https://platform.moonshot.ai/docs).

If no API key is configured (typical for self-hosted OpenAI-compatible endpoints), a placeholder key (`sk-local-dummy-key`) is sent instead because the OpenAI client requires a non-empty value.

## Notes

### Model sync

Profiles are maintained by the `sync_models` tooling (`llm_kimi` provider,
`ROCKETRIDE_KIMI_KEY`). Every profile must carry `serverbase`: `kimi.py` refuses to
start without it, and this node defines no field for it, so there is no default to fall
back on. The provider's `extra_profile_fields` writes the Moonshot endpoint into each
new profile for that reason.

### Text-only models

Moonshot also publishes `moonshot-v1-{8k,32k,128k}-vision-preview` image-input
models. Those belong in a dedicated vision node in the `llm_vision_*` family and
are not available in this text-only node.

<!-- ROCKETRIDE:GENERATED:PARAMS START -->
<!-- Generated by nodes:docs-generate. Do not edit by hand. -->

## Schema

| Field | Type | Description | Default |
|---|---|---|---|
| `kimi.profile` | `string` | **Model**<br/>Kimi (Moonshot) LLM model | `"kimi-k2-6"` |
| `model` | `string` | **Model**<br/>Kimi (Moonshot) model |  |

## Dependencies

- `openai`
- `langchain-openai`
- `langchain-core`
- `langchain`

## Source

[<svg viewBox="0 0 16 16" width="15" height="15" fill="currentColor" aria-hidden="true" style="vertical-align:-0.15em;margin-right:0.35em"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg> View source](https://github.com/rocketride-org/rocketride-server/tree/develop/nodes/src/nodes/llm_kimi)
<!-- ROCKETRIDE:GENERATED:PARAMS END -->
