Skip to main content

Mistral AI LLM plugin guide

How to integrate Mistral AI's La Plateforme inference service with LiveKit Agents.

Overview

This plugin allows you to use Mistral AI as an LLM provider for your voice agents.

Installation

Install the LiveKit Mistral AI plugin from PyPI:

uv add "livekit-agents[mistralai]~=1.4"

Authentication

The Mistral AI integration requires a Mistral AI API key.

Set the MISTRAL_API_KEY in your .env file.

Usage

Use Mistral AI within an AgentSession or as a standalone LLM service. For example, you can use this LLM in the Voice AI quickstart.

from livekit.plugins import mistralai
session = AgentSession(
llm=mistralai.LLM(
model="mistral-medium-latest"
),
# ... tts, stt, vad, turn_handling, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

modelstring | ChatModelsDefault: ministral-8b-latest

Which Mistral AI model to use. You can pass a string or a typed enum from ChatModels.

temperaturefloat

Sampling temperature that controls the randomness of the model's output. Higher values make the output more random, while lower values make it more focused and deterministic. Range of valid values can vary by model.

Additional resources

The following resources provide more information about using Mistral AI with LiveKit Agents.