Is there support for Punjabi Language in LiveKit, ...
# ask-ai
e
Is there support for Punjabi Language in LiveKit, if any language is not supported, what's the process for adding that?
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to share that Punjabi language is supported in LiveKit through some specific plugins and models. Here are a few options you can use for Punjabi language support: • Google Cloud Speech-to-Text: Just use the language code
pa-Guru-IN
. • Cartesia STT: Use the language code
pa
. • *Sarvam.ai:* This supports Indian languages, including Punjabi, through its "Saarika" STT models. If you find that a particular language isn’t supported yet, don’t worry! You can add it by creating a custom STT node. Here’s how you can approach it: 1. Create a custom STT implementation by extending the STT node interface provided by LiveKit Agents. 2. Integrate it with an external speech-to-text engine that supports the language you need. 3. Configure the plugin so it processes audio streams properly. Also, you might want to explore third-party STT plugins like Spitch, Speechmatics, or Deepgram, as they often support a variety of languages that could be helpful for your needs. Sources: Spitch STT plugin guide | LiveKit Docs | livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/stt.py | Speech-to-text (STT) models | LiveKit Docs
e
is there any different LLM or TTS required for Punjabi or just the STT model will work?
t
To fully enjoy Punjabi language support in LiveKit, you'll want to have both STT and TTS models in place. The Sarvam.ai plugin is a great choice here, as it offers native support for Punjabi in both its STT and TTS features: • STT: You can use the Sarvam.ai plugin with the language code
pa-IN
and models like
saarika:v2.5
. • TTS: Similarly, for TTS, use the Sarvam.ai plugin with the target language code
pa-IN
and models like
bulbul:v2
. It's worth mentioning that while Sarvam.ai covers both STT and TTS for Punjabi, you'll also need a language model (LLM) that can handle Punjabi text for tasks such as text generation or understanding. This model would need to come from elsewhere, as it’s not included in the Sarvam plugin. If you'd like, I’m more than happy to share some configuration examples to help you set up STT and TTS with Punjabi support. Just let me know! Sources: livekit-plugins/livekit-plugins-sarvam/livekit/plugins/sarvam/stt.py | Speech-to-text (STT) models | LiveKit Docs | Voice AI quickstart | LiveKit docs
e
can you share an example code with Sarvam.ai plugin
t
I'm glad to share an example of how you can use the Sarvam.ai plugin in LiveKit to support the Punjabi language:
Copy code
from livekit.plugins import sarvam

# Speech-to-Text for Punjabi
stt = sarvam.STT(
    language="pa-IN",  # Punjabi language code
    model="saarika:v2.5",  # Supported STT model
)

# Text-to-Speech for Punjabi
tts = sarvam.TTS(
    target_language_code="pa-IN",  # Punjabi language code
    speaker="anushka",  # Voice speaker (compatible with bulbul:v2 model)
    model="bulbul:v2",  # Current TTS model
)

# Example AgentSession usage (from livekit-examples)
from livekit.agents import AgentSession

session = AgentSession(
    stt=stt,
    tts=tts,
    # Add LLM and other components as needed
)
Requirements: • First, please install the plugin using
pip install livekit-plugins-sarvam
or
uv add "livekit-agents[sarvam]~=1.2"
. • Don’t forget to set your Sarvam API key through the
SARVAM_API_KEY
environment variable. This setup will allow you to fully process speech in Punjabi within your LiveKit agent application, leveraging Sarvam.ai’s Indian language AI models. If you have any questions or need a hand with anything else, feel free to reach out—I’m here to help! Sources: livekit-plugins/livekit-plugins-sarvam/pyproject.toml | Sarvam STT plugin guide | LiveKit Docs | Sarvam TTS plugin guide | LiveKit Docs