Overview
This plugin allows you to use Sarvam as an LLM provider for your voice agents. Sarvam offers OpenAI-compatible chat completions tuned for Indian languages, with support for tool calling.
The plugin selects the right Sarvam API version for the model you choose, so you don't need to set base_url. An explicit base_url always overrides that selection.
Installation
Install the plugin:
uv add "livekit-agents[sarvam]~=1.7"
Authentication
The Sarvam plugin requires a Sarvam API key .
Set SARVAM_API_KEY in your .env file.
Usage
Use Sarvam within an AgentSession or as a standalone LLM service. For example, you can use this LLM in the Voice AI quickstart.
from livekit.agents import AgentSessionfrom livekit.plugins import sarvamsession = AgentSession(llm=sarvam.LLM(model="sarvam-105b",),# ... tts, stt, vad, turn_handling, etc.)
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
modelstr | SarvamLLMModelsDefault: sarvam-105bModel to use. One of sarvam-105b, glm5.2, gemma4, or sarvam-105b-conversations.
gemma4 is the only model that accepts image input; sending an image to any other Sarvam model raises a ValueError. sarvam-105b-conversations is tuned for multi-turn conversation and ignores wiki_grounding and reasoning_effort.
To learn more, see the Sarvam documentation .
temperaturefloatSampling temperature that controls the randomness of the model's output. Higher values make the output more random, while lower values make it more focused and deterministic. Range of valid values can vary by model.
tool_choiceToolChoice | Literal['auto', 'required', 'none']Default: autoControls how the model uses tools. String options are as follows:
'auto': Let the model decide.'required': Force tool usage.'none': Disable tool usage.
Setting this to 'required' or a specific function requires a non-empty list of tools. Otherwise the plugin raises ValueError.
wiki_groundingboolEnables Retrieval-Augmented Generation (RAG) for sarvam-105b, gemma4, and glm5.2. When set to true, the model retrieves relevant chunks from Wikipedia based on the user's question and uses them to ground its answer, improving factual accuracy for queries like educational, definitional, historical, and scientific questions. To learn more, see the Sarvam documentation .
reasoning_effortstrReasoning effort for sarvam-105b, gemma4, and glm5.2. The plugin passes the value through to Sarvam, so consult the Sarvam documentation for the levels each model accepts.
Additional resources
The following resources provide more information about using Sarvam with LiveKit Agents.