Skip to main content

Kimi LLM

How to use Kimi models with LiveKit Agents.

Use in Agent Builder

Create a new agent in your browser using this model

Overview

Kimi models are available in LiveKit Agents through LiveKit Inference. Pricing is available on the pricing page.

Model nameModel IDProviders
Kimi K2 Instructmoonshotai/kimi-k2-instruct
baseten

Usage

To use Kimi, use the LLM class from the inference module:

from livekit.agents import AgentSession, inference
session = AgentSession(
llm=inference.LLM(
model="moonshotai/kimi-k2-instruct",
provider="baseten",
extra_kwargs={
"max_completion_tokens": 1000
}
),
# ... tts, stt, vad, turn_detection, etc.
)
import { AgentSession, inference } from '@livekit/agents';
session = new AgentSession({
llm: new inference.LLM({
model: "moonshotai/kimi-k2-instruct",
provider: "baseten",
modelOptions: {
max_completion_tokens: 1000
}
}),
// ... tts, stt, vad, turn_detection, etc.
});

Parameters

modelstringRequired

The model ID from the models list.

providerstringOptional

Set a specific provider to use for the LLM. Refer to the models list for available providers. If not set, LiveKit Inference uses the best available provider, and bills accordingly.

extra_kwargsdictOptional

Additional parameters to pass to the provider's Chat Completions API, such as max_completion_tokens. See the provider's documentation for more information.

In Node.js this parameter is called modelOptions.

String descriptors

As a shortcut, you can also pass a model descriptor string directly to the llm argument in your AgentSession:

from livekit.agents import AgentSession
session = AgentSession(
llm="moonshotai/kimi-k2-instruct",
# ... tts, stt, vad, turn_detection, etc.
)
import { AgentSession } from '@livekit/agents';
session = new AgentSession({
llm: "moonshotai/kimi-k2-instruct",
// ... tts, stt, vad, turn_detection, etc.
});

Additional resources

The following links provide more information about Kimi in LiveKit Inference.