Skip to main content

LiveKit Agents Plugin for services from Mistral AI

Project description

Mistral AI Plugin for LiveKit Agents

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

Installation

pip install livekit-plugins-mistralai

For streaming STT (Voxtral Realtime), also install silero plugin.

pip install livekit-plugins-silero

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

stt = mistralai.STT()

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

Realtime streaming transcription

Voxtral Realtime streams interim transcripts over a WebSocket connection. Since this model has no server-side endpointing, the plugin runs an internal Silero VAD to detect when the user stops speaking and flush the audio — producing final transcripts and driving the end-of-turn pipeline.

from livekit.plugins import mistralai
from livekit.plugins.silero import VAD

# Using Silero VAD with default settings (550ms silence threshold)
stt = mistralai.STT(model="voxtral-mini-transcribe-realtime-2602")

# Using custom VAD settings (e.g. shorter silence threshold for faster responses)
stt = mistralai.STT(
    model="voxtral-mini-transcribe-realtime-2602",
    vad=VAD.load(min_silence_duration=0.3),
)

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)

LLM

from livekit.plugins import mistralai

llm = mistralai.LLM()

# With custom temperature/max. tokens
llm = mistralai.LLM(
    model="mistral-large-latest",
    temperature=0.7,
    max_completion_tokens=150
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_mistralai-1.5.4.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_mistralai-1.5.4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_mistralai-1.5.4.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_mistralai-1.5.4.tar.gz
Algorithm Hash digest
SHA256 3801e861142d16a748cd3dec535830741f6b657937e6193cc15d7fe20ed68e81
MD5 d7c0e3b4d7ff6389c6bfde2c4073d4c1
BLAKE2b-256 14c0c7e748735583a14cbece58838bf648c00577eb356a9cf4c827fe21d14ebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_mistralai-1.5.4.tar.gz:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file livekit_plugins_mistralai-1.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_mistralai-1.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2148e18cb418b7f07fe8bf975b2c7fbb6e9437e501646f8fbd4c077e59c5d135
MD5 137f98428c5d25d03b273d6ffad351e2
BLAKE2b-256 2005e55ef9c3049609425f96e5e450a77f30358a172c0c5480b2cc6eb89ec18c

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_mistralai-1.5.4-py3-none-any.whl:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page