# Bolna

> Kalpa is a built-in voice provider on Bolna: set an agent’s synthesizer to kalpa.

[Bolna](https://www.bolna.ai) is a voice AI platform for phone and web agents, built on an [open-source framework](https://github.com/bolna-ai/bolna). Kalpa is one of its built-in voice providers: set an agent's synthesizer to `kalpa` and it speaks in Kalpa voices — English, Hindi and code-switched Hinglish from `kalpa-tts-1`, with no language setting.

## Configure the synthesizer

```json
"synthesizer": {
  "provider": "kalpa",
  "provider_config": {
    "voice": "Arjun",
    "model": "kalpa-tts-1"
  },
  "stream": true,
  "buffer_size": 400
}
```

On the Bolna platform this is the agent's `tools_config.synthesizer`; see Bolna's [Kalpa guide](https://www.bolna.ai/docs/kalpa) for setting up agents. `provider_config` takes:

| Setting | Default | Notes |
|---|---|---|
| `voice` | `Arjun` | A voice name from `GET /v1/voices`: the full name (`Wren (human-like)`) or the part before the parenthesis (`Wren`), case-insensitive. Bolna looks up the voice's id on the call's first connection. |
| `voice_id` | none | A voice id, instead of a name — see [Named voices](/text-to-speech#named-voices). |
| `model` | `kalpa-tts-1` | `kalpa-tts-1` for English and Hindi, or `kalpa-tts-beta-v0.1` for English only — see [Models](/models). |
| `chunk_length_schedule` | `[50, 80, 120, 150]` | Buffered-character thresholds at which Kalpa starts rendering each part of a reply while the rest is still arriving. |

`temperature`, `acoustic_temperature` and `audio_quality` are optional; leave them out to use Kalpa's defaults ([Generation parameters](/text-to-speech#generation-parameters)). `stream` and `buffer_size` are Bolna's own synthesizer settings: keep `stream: true` for live calls, so speech streams as described below.

## How it streams

Each call holds one connection to the streaming WebSocket [`WSS /v1/tts/{voice_id}/stream`](/reference#wss-v1-tts-voice-id-stream). Bolna forwards the LLM's reply as it is written and flushes at its end. Once the buffered text crosses the next `chunk_length_schedule` threshold at a sentence boundary, that part starts rendering, so the caller hears the reply before the LLM has finished it. When the caller interrupts, Bolna cancels the response and reuses the connection for the next turn.

Kalpa streams 24 kHz audio. Bolna converts it to 8 kHz mu-law for phone calls and plays it unchanged in web calls.

## Self-hosting

To run the open-source framework yourself, create an API key at [kalpalabs.ai/dashboard/keys](https://kalpalabs.ai/dashboard/keys/) and set it as `KALPA_API_KEY` in the Bolna server's environment.

## Resources

- [Kalpa on Bolna](https://www.bolna.ai/docs/kalpa): Bolna's guide to the Kalpa synthesizer.
- [`kalpa_synthesizer.py`](https://github.com/bolna-ai/bolna/blob/master/bolna/synthesizer/kalpa_synthesizer.py): the integration's source in the Bolna repository.
