> ## Documentation Index
> Fetch the complete documentation index at: https://visionagents.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sarvam LLM

[Sarvam AI](https://www.sarvam.ai/) provides language models built for Indian languages. The plugin uses Sarvam's OpenAI-compatible Chat Completions endpoint and automatically strips `<think>` reasoning blocks from streamed output.

<Info>
  Vision Agents requires a [Stream](https://getstream.io/try-for-free/) account
  for real-time transport. Get your Sarvam API key from the [Sarvam
  dashboard](https://dashboard.sarvam.ai/).
</Info>

<Tip>
  Sarvam also provides [speech-to-text](/integrations/stt/sarvam) and [text-to-speech](/integrations/tts/sarvam). You can use all three in the same agent.
</Tip>

## Installation

```sh theme={null}
uv add "vision-agents[sarvam]"
```

## Quick start

```python theme={null}
from vision_agents.core import Agent, User
from vision_agents.plugins import sarvam, getstream, smart_turn

agent = Agent(
    edge=getstream.Edge(),
    agent_user=User(name="Sarvam Agent", id="agent"),
    instructions="Reply in Hindi or English, whichever the user speaks.",
    llm=sarvam.LLM(model="sarvam-30b"),
    stt=sarvam.STT(language="hi-IN"),
    tts=sarvam.TTS(speaker="shubh"),
    turn_detection=smart_turn.TurnDetection(),
)
```

<Warning>
  Set `SARVAM_API_KEY` in your environment or pass `api_key` directly.
</Warning>

## Parameters

| Name       | Type  | Default                      | Description                                           |
| ---------- | ----- | ---------------------------- | ----------------------------------------------------- |
| `model`    | `str` | `"sarvam-m"`                 | Model id (`sarvam-m`, `sarvam-30b`, or `sarvam-105b`) |
| `api_key`  | `str` | `None`                       | API key (defaults to `SARVAM_API_KEY` env var)        |
| `base_url` | `str` | `"https://api.sarvam.ai/v1"` | Sarvam API endpoint                                   |

## Available models

| Model         | Description                                  |
| ------------- | -------------------------------------------- |
| `sarvam-m`    | Default model with hybrid thinking support   |
| `sarvam-30b`  | 30B parameter model for balanced performance |
| `sarvam-105b` | 105B parameter model for maximum capability  |

<Tip>
  Sarvam-m supports "hybrid thinking" — it emits `<think>` reasoning blocks before the answer. The plugin automatically strips these so they don't reach TTS.
</Tip>

## Function calling

```python theme={null}
@agent.llm.register_function(description="Get weather for a location")
async def get_weather(location: str) -> str:
    return f"The weather in {location} is sunny and 30°C"
```

See the [Function Calling guide](/guides/mcp-tool-calling) for details.

## Next steps

<CardGroup cols={2}>
  <Card title="Sarvam STT" icon="microphone" href="/integrations/stt/sarvam">
    Streaming speech-to-text for Indian languages
  </Card>

  <Card title="Sarvam TTS" icon="volume-high" href="/integrations/tts/sarvam">
    Streaming text-to-speech for Indian languages
  </Card>
</CardGroup>
