Skip to main content

Mistral AI Plugin for LiveKit Agents

Support for Mistral AI STT, TTS, and LLM services.

Installation

pip install livekit-plugins-mistralai

Pre-requisites

You'll need an API key from Mistral AI. It can be set as an environment variable:

export MISTRAL_API_KEY=your_api_key_here

Usage

Speech-to-Text (STT)

Offline transcription

from livekit.plugins import mistralai

# the default model is the realtime voxtral-mini-transcribe-realtime-3, pass a batch model for offline transcription
stt = mistralai.STT(model="voxtral-mini-transcribe-3")

# With context biasing
stt = mistralai.STT(
    model="voxtral-mini-transcribe-3",
    context_bias=["LiveKit", "Voxtral", "Mistral"]
)

# The larger model
stt = mistralai.STT(model="voxtral-small-transcribe-3", language="en")

Realtime streaming transcription

Voxtral Realtime streams interim transcripts over a WebSocket connection.

Voxtral 3 (voxtral-mini-transcribe-realtime-3) has server-side turn detection: the server tells the plugin when the user starts and stops speaking and the plugin finalizes the transcript of each turn. It is enabled by default, and can be tuned with turn_detection.

from livekit.plugins import mistralai

# server-side turn detection with the server defaults (the default model)
stt = mistralai.STT(language="en")

# tuned turn detection
stt = mistralai.STT(
    model="voxtral-mini-transcribe-realtime-3",
    turn_detection={"min_silence_ms": 400, "end_timeout_ms": 1500},
)

To let the voice pipeline decide when a turn ends instead of the server, pass turn_detection=None. To use the end of the turns detected by the server as the end of the user turns of an AgentSession, set turn_detection="stt" on the session or the agent.

Earlier realtime models (e.g. voxtral-mini-transcribe-realtime-2602) have no server-side endpointing, and neither does Voxtral 3 with turn_detection=None or diarize=True. The voice pipeline (AgentSession) tells the plugin when the user stopped speaking, based on its own VAD and turn detection, and the plugin flushes the audio to get the final transcript.

from livekit.agents import AgentSession
from livekit.plugins import mistralai

session = AgentSession(
    stt=mistralai.STT(model="voxtral-mini-transcribe-realtime-2602"),
    ...
)

To use the STT on its own, outside of an AgentSession, flush the stream yourself with stream.flush() when the user stops speaking to get the final transcript.

With a VAD. Pass a vad to have the plugin detect the end of the speech itself: its end of speech flushes the audio, and its start and end of speech are emitted as speech events. That is what turn_detection="stt" of an AgentSession relies on with the models that have no server-side turn detection, and it also makes a stream used on its own flush without stream.flush(). With Voxtral 3, a vad replaces the server-side turn detection, which can't be used together with it.

from livekit.plugins import mistralai, silero

stt = mistralai.STT(
    model="voxtral-mini-transcribe-realtime-2602",
    vad=silero.VAD.load(),
)

Speaker diarization

diarize=True labels each piece of text with its speaker. The speaker is exposed as speaker_id on the transcripts, and on each segment (words).

# batch models (Voxtral 2 and 3)
stt = mistralai.STT(model="voxtral-small-transcribe-3", diarize=True)

# Voxtral 3 realtime
stt = mistralai.STT(model="voxtral-mini-transcribe-realtime-3", diarize=True)

Earlier realtime models don't support it. On the Voxtral 3 realtime model, diarization can't be used together with server-side turn detection, so turn_detection is disabled by default when diarize=True and passing both raises a ValueError. The voice pipeline then decides when a turn ends, like with turn_detection=None.

Without the server-side turn detection, the plugin emits no start and end of speech events, so the AgentSession can't use turn_detection="stt": no user turn would ever end. To use it with diarization, give the STT a vad, which provides the events:

stt = mistralai.STT(
    model="voxtral-mini-transcribe-realtime-3",
    diarize=True,
    vad=silero.VAD.load(),
)
session = AgentSession(stt=stt, turn_detection="stt", ...)

The realtime model numbers the speakers within one transcript only: the numbering restarts after each flush, so the speakers of different transcripts can't be compared. The transcripts carry no timestamps.

Updating the options

stt.update_options(...) accepts model, language, context_bias, target_streaming_delay_ms, diarize and turn_detection. Batch models apply them to the next transcription. The settings of a realtime session can't change once audio has started, so changing one reconnects the active streams, and a transcript that was not finalized yet is lost. The model can only be changed to one of the same kind (batch or realtime).

Text-to-Speech (TTS)

from livekit.plugins import mistralai

# Using a built-in voice
tts = mistralai.TTS(voice="en_paul_neutral")

# Using zero-shot voice cloning
import base64
ref_audio_b64 = base64.b64encode(open("sample.mp3", "rb").read()).decode()
tts = mistralai.TTS(ref_audio=ref_audio_b64)

Voxtral 3

The Voxtral 3 model (voxtral-mini-tts-3) is the default. By default the text is synthesized over http, sentence by sentence. The speech starts as soon as the first sentence of the LLM reply is complete.

from livekit.plugins import mistralai

tts = mistralai.TTS(model="voxtral-mini-tts-3", voice="en_paul_neutral")

# Voxtral 3 adds multilingual voices (`voice_<n>`, see `TTSVoxtral3Voices`) and still accepts the older ones.
# The older models only accept the older voices, anything else raises a ValueError.
tts = mistralai.TTS(model="voxtral-mini-tts-3", voice="voice_447")  # Margaret, en-US

# How expressive the speech is, between 1 and 5 (Voxtral 3 only)
tts = mistralai.TTS(model="voxtral-mini-tts-3", expressiveness=3)

# Pronunciation hints, as IPA phones per word (Voxtral 3 only, http only)
tts = mistralai.TTS(phoneme_hints={"tomato": ["t", "ə", "m", "ɑ", "t", "oʊ"]})
Realtime websocket

With use_realtime=True the speech is streamed over the realtime websocket api while the LLM generates the text, using a pool of connections reused between the requests. phoneme_hints isn't supported in this mode.

tts = mistralai.TTS(use_realtime=True)

The streamed speech is always PCM, response_format only applies to the http mode. The realtime engine can't handle a single request of more than about 3,500 characters, so a longer reply is automatically split in several requests.

LLM

from livekit.plugins import mistralai

llm = mistralai.LLM()

# With all available options
llm = mistralai.LLM(
    model="mistral-large-latest",
    temperature=0.7,
    top_p=0.9,
    max_completion_tokens=150,
    presence_penalty=0.1,
    frequency_penalty=0.1,
    random_seed=42,
    tool_choice="auto",
    store=False,
    reasoning_effort="none",
)

# With provider tools
agent = Agent(
    llm=llm,
    tools=[
        mistralai.tools.WebSearch(),
        mistralai.tools.CodeInterpreter(),
        mistralai.tools.DocumentLibrary(library_ids=["<your-library-id>"]),
        mistralai.tools.Connector(connector_id="<your_connector_id>")
    ]
)

Metadata

Release files for livekit-plugins-mistralai 1.8.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-mistralai 1.8.13
File Size Uploaded Provenance Actions
livekit_plugins_mistralai-1.8.13.tar.gz 23.4 kB With provenance Details for livekit_plugins_mistralai-1.8.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-mistralai 1.8.13
File Interpreter ABI Platform Actions
livekit_plugins_mistralai-1.8.13-py3-none-any.whl Python 3 none any Details for livekit_plugins_mistralai-1.8.13-py3-none-any.whl

Total release size: 49.1 kB

Release files / livekit_plugins_mistralai-1.8.13.tar.gz

Download URL livekit_plugins_mistralai-1.8.13.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aa113583c8799abb0ecbf83bb0925dc87c247a86a38fd9c4681f471d206ac89e
BLAKE2b-256 checksum
How to use checksums
eebd15655c90e9f400e250b829be7c075b6136b80d83e61153d3afb23ea6d7f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / livekit_plugins_mistralai-1.8.13-py3-none-any.whl

Download URL livekit_plugins_mistralai-1.8.13-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
874a7d542e227f7701c444ee23879ffec582dd5b2124eddc1913dcba2c1545dc
BLAKE2b-256 checksum
How to use checksums
fce237a0c4b9d439c2c27d153e1e611a935bf7f99ad0fc29b54de433b322b9f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for livekit-plugins-mistralai 1.8.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for livekit_plugins_mistralai-1.8.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.8.13 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page