> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: LiveKit Agents
description: Use Vakyam TTS as the voice in a LiveKit Agents pipeline.
---

# LiveKit Agents

Vakyam is an official
[LiveKit Agents](https://docs.livekit.io/agents/)
TTS plugin (`livekit-plugins-vakyam`). Install it next to `livekit-agents`; it is
versioned with the LiveKit Agents monorepo, independently of the core
[`vakyamai`](/sdks/python) SDK.

`stream()` uses the realtime [WebSocket API](/guides/realtime-websocket) and
sentence-tokenizes LLM text so each utterance is one complete sentence.
`synthesize()` uses HTTP streaming (`POST /v1/tts/stream`) and returns PCM
audio.

> **Warning:**
> The `vakyamai[livekit]` extra and `from vakyamai.livekit import VakyamTTS` remain
> available for now, but they will be deprecated. Switch to the official LiveKit
> plugin — the constructor arguments are the same; only the package and import
> path change. See [Migrate from the SDK extra](#migrate-from-the-sdk-extra).

## Install

```bash
pip install livekit-plugins-vakyam
```

Or with the LiveKit Agents extra:

```bash
uv add "livekit-agents[vakyam]"
```

Source and tests live in the
[livekit-plugins-vakyam](https://github.com/livekit/agents/tree/main/livekit-plugins/livekit-plugins-vakyam)
package in the LiveKit Agents repository.

Set your API key:

```bash
export VAKYAM_API_KEY="vak_live_..."
```

## Create the TTS plugin

```python
from livekit.plugins import vakyam

tts = vakyam.TTS(
    model="raaga-v1",
    voice="Archana",
    language="ta-IN",
    sample_rate=24000,
    speed=1.0,
)
```

The plugin reads `VAKYAM_API_KEY` from the environment by default; pass
`api_key="vak_live_..."` to set it explicitly.

### Parameters

- `api_key` (string) — Vakyam API key. Defaults to the `VAKYAM_API_KEY` environment variable.

- `model` (string, default raaga-v1) — TTS model identifier.

- `voice` (string, default Archana) — Voice selector — a preset name (discover valid values with `GET /v1/voices`) or a custom voice ID beginning with `vc_`. See [Voices & languages](/concepts/voices-and-languages).

- `language` (string, default ta-IN) — BCP 47 language code, such as `ta-IN`, `hi-IN`, or `en-IN`.

- `sample_rate` (integer, default 24000) — Output PCM sample rate in Hz: `8000`, `16000`, `24000`, or `48000`.

- `speed` (number, default 1.0) — Speech rate multiplier, `0.5`–`2.0`.

- `base_url` (string, default https://api.vakyam.ai) — API base URL. Defaults to production (`https://api.vakyam.ai`).

- `allow_insecure_base_url` (boolean, default false) — Allow non-localhost `http://` base URLs. Defaults to `false`.

- `tokenizer` (SentenceTokenizer) — Optional custom sentence tokenizer. Defaults to LiveKit's built-in sentence tokenizer.

Call `update_options(...)` to change `model`, `voice`, `language`,
`sample_rate`, or `speed` for streams created after the call. Call `prewarm()`
to open a pooled WebSocket before the first turn.

## Use it in an AgentSession

Combine `vakyam.TTS` with your chosen STT, LLM, and VAD, the same way you would
wire any other LiveKit TTS plugin:

```python
from livekit.agents import AgentSession
from livekit.plugins import vakyam

session = AgentSession(
    stt=your_stt,
    llm=your_llm,
    tts=vakyam.TTS(
        model="raaga-v1",
        voice="Archana",
        language="ta-IN",
        sample_rate=24000,
    ),
    vad=your_vad,
)
```

> **Note:**
> `vakyam.TTS` supports streaming synthesis and interruption. WebSocket
> connections are pooled and reused between sequential agent turns. Each active
> synthesis stream has exclusive ownership of its connection, so an overlapping
> stream uses a separate connection. On barge-in, the plugin sends a `cancel`,
> drains through Vakyam's cancellation acknowledgement, and returns the healthy
> connection to the pool. See
> [Interrupting playback](/guides/realtime-websocket#interrupting-playback-barge-in).

## Migrate from the SDK extra

If you still install `vakyamai[livekit]`, switch the package and import. The
constructor arguments are unchanged. Keep `vakyamai` installed if you use the
core SDK elsewhere.

```bash
pip install livekit-plugins-vakyam
```

```python
# Before (will be deprecated)
from vakyamai.livekit import VakyamTTS

tts = VakyamTTS(
    model="raaga-v1",
    voice="Archana",
    language="ta-IN",
    sample_rate=24000,
)

# After
from livekit.plugins import vakyam

tts = vakyam.TTS(
    model="raaga-v1",
    voice="Archana",
    language="ta-IN",
    sample_rate=24000,
)
```

---

*Powered by [holocron.so](https://holocron.so)*
