how i can control model language in sts setup
# ask-ai
b
how i can control model language in sts setup
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Do you mean STT (speech-to-text)? If so, here’s how to control the STT model language. • To set language in the model descriptor: specify
provider/model:language
. Example:
stt="deepgram/nova-2:es"
(Spanish). • To set language with the
STT
config object:
Copy code
from livekit.agents import inference

  session = AgentSession(
      stt=inference.STT(
          model="deepgram/nova-2",
          language="fr"
      ),
  )
• For unknown/multi-language audio: ◦ Use
language="multi"
with multilingual models (e.g., Nova-2/Nova-3). ◦ Or use
stt="auto:language-code"
to let LiveKit pick the best model. • To change language at runtime:
Copy code
if self.session.stt is not None:
      self.session.stt.update_options(language="es")
Supported languages depend on the provider/model (e.g., Deepgram Nova-2, ElevenLabs Scribe V2, Cartesia Ink). If you meant something other than STT, tell me which system or give an example of your setup (code snippet or provider/model) and I’ll give exact steps. Sources: Speech-to-text (STT) models | LiveKit Docs | ElevenLabs Change Language | LiveKit docs
b
no, i use gpt-realtime in text modality + tts, no stt
t
Thanks for clarifying — you're using GPT‑realtime in text mode with TTS (no STT). Here’s how you control language and model behavior in that setup. • Control response language via prompts/instructions: ◦ Set persistent system instructions on the Realtime model to force or prefer a language. Example:
instructions="Respond in French."
• Or include explicit per‑request instructions in the conversation messages to switch languages dynamically. • Control model selection: ◦ Use the desired Realtime model when creating the
RealtimeModel
instance (the model choice determines generation behavior). • TTS language/voice: ◦ Choose a TTS provider/model that supports the target language (e.g.,
cartesia/sonic-3
) and set its language/voice options as required. TTS must match the language you instruct the LLM to produce. • Dynamic switching at runtime: ◦ Update model
instructions
or pass language context per request to change language on the fly. ◦ Then call your TTS with the matching language/voice. If you want, tell me: • which Realtime model you’re using, • which TTS provider/model, • and whether you need automatic language detection or explicit control per message — and I’ll give exact code snippets for your setup. Sources: Realtime model plugins | LiveKit Docs | Gemini Live API plugin | LiveKit docs