turn_detection=MultilingualModel(), what other mu...
# ask-ai
p
turn_detection=MultilingualModel(), what other multilingual languages it can detect and support
t
Thanks for reaching out, Mamlesh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just wanted to share that the
MultilingualModel()
in LiveKit supports 13 different languages: • Chinese • Dutch • English • French • German • Indonesian • Italian • Japanese • Korean • Portuguese • Russian • Spanish • Turkish What’s even cooler is that it can handle conversations where people switch between these languages in the same session. Pretty handy, right? Sources: LiveKit turn detector plugin | LiveKit Docs | Building the all-in-one platform for voice AI agents
p
so lets I want to shift between english and arabic, how can i do multilingual?
t
Just a heads-up: the
MultilingualModel()
doesn’t support Arabic for semantic turn detection yet. But no worries—you can still switch between English and Arabic in your app by updating the language settings of your STT and TTS plugins on the fly. Here’s a quick example:
Copy code
# Example of switching STT and TTS languages at runtime
self.stt.update_options(language="ar")  # Switch STT to Arabic
self.tts.update_options(language="ar")  # Switch TTS to Arabic
When Arabic is active, turn detection will use VAD (Voice Activity Detection) instead of semantic cues. You can also tweak endpointing delays or add your own custom logic to make turn-taking smoother in Arabic. Sources: LiveKit turn detector plugin | LiveKit Docs | livekit-plugins/livekit-plugins-turn-detector/README.md | Groq TTS integration guide | LiveKit Docs | Groq and LiveKit | LiveKit Docs | plugins/livekit/src/turn_detector/multilingual.ts
p
In gemini live api, I want to add my own custom STT and TTS and have gemini live as LLM, where the image input will be feedin will this work?
t
Hey there! You can totally integrate your own custom STT and TTS with the Gemini Live API while still using Gemini Live as the LLM and feeding image input. Here’s a friendly guide on how to set it up: • Custom STT: Just disable the built-in transcription by setting
input_audio_transcription=None
in the
RealtimeModel
, then plug in your custom STT instance. • Custom TTS: Turn off the built-in TTS by setting
modalities=[Modality.TEXT]
, and add your custom TTS plugin to the
AgentSession
. • Image Input: Use
ImageContent
to add images into the chat context or
push_video()
if you want to send live video frames. Here’s a quick example to get you started:
Copy code
from livekit.agents import AgentSession, ChatContext, ImageContent
from livekit.plugins.deepgram import STT
from livekit.plugins.cartesia import TTS

# Initialize your custom STT and TTS
custom_stt = STT(api_key="your-deepgram-api-key")
custom_tts = TTS(api_key="your-cartesia-api-key")

# Set up Gemini Live API
session = AgentSession(
    llm=google.beta.realtime.RealtimeModel(
        modalities=[Modality.TEXT],
        input_audio_transcription=None,
        model="gemini-2.0-flash-exp",
        instructions="You are a helpful assistant with vision capabilities."
    ),
    stt=custom_stt,
    tts=custom_tts,
)

# Add an image to the chat context
chat_ctx = ChatContext()
chat_ctx.add_message(
    role="user",
    content=[ImageContent(image="data:image/jpeg;base64,encoded_image")]
)
await session.update_chat_ctx(chat_ctx)
This setup lets you enjoy the best of both worlds—using Gemini Live for text and image processing, while your custom STT and TTS handle audio input and output smoothly. If you have any questions or want to chat more about it, just let me know! Sources: Vision | LiveKit Docs | Gemini Live API integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | plugins/google/src/beta/gemini_tts.ts | Gemini TTS integration guide | LiveKit Docs
p
In livekit docs, does livekit itself handles concurrecny? or do we need to handle it separately
t
LiveKit makes managing concurrency easy with built-in features like rate limiting, distributed clustering, and high-performance dispatching. Here’s a quick rundown: • LiveKit Cloud: Your concurrency limits depend on your plan (think active sessions, participants, ingress/egress requests). You can check these limits anytime in the LiveKit Cloud dashboard, and if you need more, just ask—we’re happy to help with upgrades on paid plans. • Self-Hosted Deployments: For multi-node setups, concurrency is managed through Redis, letting you support lots of concurrent rooms. Just keep in mind, each room runs on a single node. • Data Streams: LiveKit lets you run multiple byte and text streams at the same time, keeping everything in order. • Agent Dispatch: Built to handle high concurrency, it can manage hundreds of thousands of connections per second with low latency. While LiveKit takes care of most concurrency details for you, it’s good to be aware of the predefined quotas and how to set up Redis if you’re running a distributed deployment. If you have any questions or need a hand, we’re here for you! Sources: Quotas and limits | LiveKit Docs | Distributed Setup | LiveKit Docs | Sending files & bytes | LiveKit Docs | Sending text | LiveKit Docs | Dispatching agents | LiveKit Docs