Skip to main content

End-to-end open-source voice agents platform: Quickly build voice firsts conversational assistants through a json.

Discord | Hosted Docs | Website

Discord Bolna is released under the MIT license. PRs welcome!

[!NOTE] We are actively looking for maintainers.

Introduction

Bolna is the end-to-end open source production ready framework for quickly building LLM based voice driven conversational applications.

Demo

https://github.com/bolna-ai/bolna/assets/1313096/2237f64f-1c5b-4723-b7e7-d11466e9b226

What is this repository?

This repository contains the entire orchestration platform to build voice AI applications. It technically orchestrates voice conversations using combination of different ASR+LLM+TTS providers and models over websockets.

Components

Bolna helps you create AI Voice Agents which can be instructed to do tasks beginning with:

  1. Orchestration platform (this open source repository)
  2. Hosted APIs (https://docs.bolna.ai/api-reference/introduction) built on top of this orchestration platform [currently closed source]
  3. No-code UI playground at https://platform.bolna.ai/ using the hosted APIs + tailwind CSS [currently closed source]

Development philosophy

  1. Any integration, enhancement or feature initially lands on this open source package since it forms the backbone of our Hosted APIs and dashboard
  2. Post that we expose APIs or make changes to existing APIs as required for the same
  3. Thirdly, we push it to the UI dashboard
graph LR;
    A[Bolna open source] -->B[Hosted APIs];
    B[Hosted APIs] --> C[Hosted Playground]

Supported providers and models

  1. Initiating a phone call using telephony providers like Twilio, Plivo, Exotel (coming soon), Vonage (coming soon) etc.
  2. Transcribing the conversations using Deepgram, Azure etc.
  3. Using LLMs like OpenAI, DeepSeek, Llama, Cohere, Mistral, etc to handle conversations
  4. Synthesizing LLM responses back to telephony using AWS Polly, ElevenLabs, Deepgram, OpenAI, Azure, Cartesia, Smallest, Maya etc.

Refer to the docs for a deepdive into all supported providers.

Local example setup [will be moved to a different repository]

A basic local setup includes usage of Twilio or Plivo for telephony. We have dockerized the setup in local_setup/. One will need to populate an environment .env file from .env.sample.

The setup consists of four containers:

  1. Telephony web server:
    • Choosing Twilio: for initiating the calls one will need to set up a Twilio account
    • Choosing Plivo: for initiating the calls one will need to set up a Plivo account
  2. Bolna server: for creating and handling agents
  3. ngrok: for tunneling. One will need to add the authtoken to ngrok-config.yml
  4. redis: for persisting agents & prompt data

Quick Start

The easiest way to get started is to use the provided script:

cd local_setup
chmod +x start.sh
./start.sh

This script will check for Docker dependencies, build all services with BuildKit enabled, and start them in detached mode.

Manual Setup

Alternatively, you can manually build and run the services:

  1. Make sure you have Docker with Docker Compose V2 installed
  2. Enable BuildKit for faster builds:
    export DOCKER_BUILDKIT=1
    export COMPOSE_DOCKER_CLI_BUILD=1
    
  3. Build the images:
    docker compose build
    
  4. Run the services:
    docker compose up -d
    

To run specific services only:

docker compose up -d bolna-app twilio-app
# or
docker compose up -d bolna-app plivo-app

Once the docker containers are up, you can now start to create your agents and instruct them to initiate calls.

Example agents to create, use and start making calls

You may try out different agents from example.bolna.dev.

Programmatic usage (minimal example)

You can also build and run an agent directly in Python without the local telephony setup.

Example script: examples/simple_assistant.py

import asyncio
from bolna.assistant import Assistant
from bolna.models import (
    Transcriber,
    Synthesizer,
    ElevenLabsConfig,
    LlmAgent,
    SimpleLlmAgent,
)


async def main():
    assistant = Assistant(name="demo_agent")

    # Configure audio input (ASR)
    transcriber = Transcriber(provider="deepgram", model="nova-2", stream=True, language="en")

    # Configure LLM
    llm_agent = LlmAgent(
        agent_type="simple_llm_agent",
        agent_flow_type="streaming",
        llm_config=SimpleLlmAgent(
            provider="openai",
            model="gpt-4o-mini",
            temperature=0.3,
        ),
    )

    # Configure audio output (TTS)
    synthesizer = Synthesizer(
        provider="elevenlabs",
        provider_config=ElevenLabsConfig(voice="George", voice_id="JBFqnCBsd6RMkjVDRZzb", model="eleven_turbo_v2_5"),
        stream=True,
        audio_format="wav",
    )

    # Build a single coherent pipeline: transcriber -> llm -> synthesizer
    assistant.add_task(
        task_type="conversation",
        llm_agent=llm_agent,
        transcriber=transcriber,
        synthesizer=synthesizer,
        enable_textual_input=False,
    )

    # Stream results
    async for chunk in assistant.execute():
        print(chunk)


if __name__ == "__main__":
    asyncio.run(main())

How to run:

export OPENAI_API_KEY=...
export DEEPGRAM_AUTH_TOKEN=...
export ELEVENLABS_API_KEY=...
python examples/simple_assistant.py

This demonstrates orchestration and streaming output. For telephony, use the services in local_setup/.

Note: For REST-based usage (Agent CRUD over HTTP), see API.md in the repo root.

Expected output shape: assistant.execute() is an async generator yielding per-task result dicts (event-like chunks). The exact keys depend on configured tools/providers; treat it as a stream and process incrementally.

Text-only pipeline example

If you want a text-only flow (no transcriber/synthesizer), you can enable a text-only pipeline:

Example script: examples/text_only_assistant.py

import asyncio
from bolna.assistant import Assistant
from bolna.models import LlmAgent, SimpleLlmAgent


async def main():
    assistant = Assistant(name="text_only_agent")

    llm_agent = LlmAgent(
        agent_type="simple_llm_agent",
        agent_flow_type="streaming",
        llm_config=SimpleLlmAgent(
            provider="openai",
            model="gpt-4o-mini",
            temperature=0.2,
        ),
    )

    # No transcriber/synthesizer; enable a text-only pipeline
    assistant.add_task(
        task_type="conversation",
        llm_agent=llm_agent,
        enable_textual_input=True,
    )

    async for chunk in assistant.execute():
        print(chunk)


if __name__ == "__main__":
    asyncio.run(main())

How to run (text-only):

export OPENAI_API_KEY=...
python examples/text_only_assistant.py

Expected output shape: assistant.execute() yields streaming dicts per task step; fields vary by configuration. Handle chunk-by-chunk.

Using your own providers

You can populate the .env file to use your own keys for providers.

ASR Providers
These are the current supported ASRs Providers:
Provider Environment variable to be added in .env file
Deepgram DEEPGRAM_AUTH_TOKEN
 
LLM Providers
Bolna uses LiteLLM package to support multiple LLM integrations.

These are the current supported LLM Provider Family: https://github.com/bolna-ai/bolna/blob/10fa26e5985d342eedb5a8985642f12f1cf92a4b/bolna/providers.py#L30-L47

For LiteLLM based LLMs, add either of the following to the .env file depending on your use-case:

LITELLM_MODEL_API_KEY: API Key of the LLM
LITELLM_MODEL_API_BASE: URL of the hosted LLM
LITELLM_MODEL_API_VERSION: API VERSION for LLMs like Azure

For LLMs hosted via VLLM, add the following to the .env file:
VLLM_SERVER_BASE_URL: URL of the hosted LLM using VLLM

 
TTS Providers
These are the current supported TTS Providers: https://github.com/bolna-ai/bolna/blob/c8a0d1428793d4df29133119e354bc2f85a7ca76/bolna/providers.py#L7-L14
Provider Environment variable to be added in .env file
AWS Polly Accessed from system wide credentials via ~/.aws
Elevenlabs ELEVENLABS_API_KEY
OpenAI OPENAI_API_KEY
Deepgram DEEPGRAM_AUTH_TOKEN
Cartesia CARTESIA_API_KEY
Smallest SMALLEST_API_KEY
Maya MAYA_API_KEY
 
Telephony Providers
These are the current supported Telephony Providers:
Provider Environment variable to be added in .env file
Twilio TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_PHONE_NUMBER
Plivo PLIVO_AUTH_ID, PLIVO_AUTH_TOKEN, PLIVO_PHONE_NUMBER

Open-source v/s Hosted APIs

We have in the past tried to maintain both the open source and the hosted solution (via APIs and a UI dashboard).

We have fluctuated b/w maintaining this repository purely from a point of time crunch and not interest.

Currently, we are continuing to maintain it for the community and improving the adoption of Voice AI.

Though the repository is completely open source, you can connect with us if interested in managed hosted offerings or more customized solutions. Schedule a meeting

Extending with other Telephony Providers

In case you wish to extend and add some other Telephony like Vonage, Telnyx, etc. following the guidelines below:

  1. Make sure bi-directional streaming is supported by the Telephony provider
  2. Add the telephony-specific input handler file in input_handlers/telephony_providers writing custom functions extending from the telephony.py class
    1. This file will mainly contain how different types of event packets are being ingested from the telephony provider
  3. Add telephony-specific output handler file in output_handlers/telephony_providers writing custom functions extending from the telephony.py class
    1. This mainly concerns converting audio from the synthesizer class to a supported audio format and streaming it over the websocket provided by the telephony provider
  4. Lastly, you'll have to write a dedicated server like the example twilio_api_server.py provided in local_setup to initiate calls over websockets.

Security Acknowledgments

We would like to thank the following individuals for responsibly disclosing security vulnerabilities and helping us keep this project safe:

Contributing

We love all types of contributions: whether big or small helping in improving this community resource.

  1. There are a number of open issues present which can be good ones to start with
  2. If you have suggestions for enhancements, wish to contribute a simple fix such as correcting a typo, or want to address an apparent bug, please feel free to initiate a new issue or submit a pull request
  3. If you're contemplating a larger change or addition to this repository, be it in terms of its structure or the features, kindly begin by creating a new issue open a new issue :octocat: and outline your proposed changes. This will allow us to engage in a discussion before you dedicate a significant amount of time or effort. Your cooperation and understanding are appreciated

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bolna-0.10.184.tar.gz (356.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bolna-0.10.184-py3-none-any.whl (407.2 kB view details)

Uploaded Python 3

File details

Details for the file bolna-0.10.184.tar.gz.

File metadata

  • Download URL: bolna-0.10.184.tar.gz
  • Upload date:
  • Size: 356.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bolna-0.10.184.tar.gz
Algorithm Hash digest
SHA256 c5691d9def15558c62a1642401196ecd534f5384a652bf91794fe6c80fd4a2de
MD5 48c718c83c80aaf6509de72b80d55e2c
BLAKE2b-256 3c05285e01d8e417a54f44bb5eec8c531416360540949e0a5a86a6d4a7fe8234

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolna-0.10.184.tar.gz:

Publisher: publish.yml on bolna-ai/bolna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bolna-0.10.184-py3-none-any.whl.

File metadata

  • Download URL: bolna-0.10.184-py3-none-any.whl
  • Upload date:
  • Size: 407.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bolna-0.10.184-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f8f365385500e18d9b4b54366b536e64817e87c5d05db3307b8050d647e041
MD5 6e2f673e3738b4ffa1a2f13e3261eef1
BLAKE2b-256 bc7dcd21040c0e7ee8c33edae790ffffa303cea5f6a7bcae201d76c38f9bf2fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolna-0.10.184-py3-none-any.whl:

Publisher: publish.yml on bolna-ai/bolna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.233

2 files

0.10.232

2 files

0.10.231

2 files

0.10.230

2 files

0.10.229

2 files

0.10.228

2 files

0.10.227

2 files

0.10.226

2 files

0.10.225

2 files

0.10.224

2 files

0.10.223

2 files

0.10.222

2 files

0.10.221

2 files

0.10.220

2 files

0.10.219

2 files

0.10.218

2 files

0.10.217

2 files

0.10.216

2 files

0.10.215

2 files

0.10.214

2 files

0.10.213

2 files

0.10.212

2 files

0.10.211

2 files

0.10.210

2 files

0.10.209

2 files

0.10.208

2 files

0.10.207

2 files

0.10.206

2 files

0.10.205

2 files

0.10.204

2 files

0.10.203

2 files

0.10.202

2 files

0.10.201

2 files

0.10.200

2 files

0.10.199

2 files

0.10.198

2 files

0.10.197

2 files

0.10.196

2 files

0.10.195

2 files

0.10.194

2 files

0.10.193

2 files

0.10.192

2 files

0.10.191

2 files

0.10.190

2 files

0.10.189

2 files

0.10.188

2 files

0.10.187

2 files

0.10.186

2 files

0.10.185

2 files

This release

0.10.184 This release

2 files

0.10.183

2 files

0.10.182

2 files

0.10.181

2 files

0.10.180

2 files

0.10.179

2 files

0.10.178

2 files

0.10.177

2 files

0.10.176

2 files

0.10.175

2 files

0.10.174

2 files

0.10.173

2 files

0.10.172

2 files

0.10.171

2 files

0.10.170

2 files

0.10.168

2 files

0.10.167

2 files

0.10.166

2 files

0.10.165

2 files

0.10.164

2 files

0.10.163

2 files

0.10.162

2 files

0.10.161

2 files

0.10.160

2 files

0.10.159

2 files

0.10.157

2 files

0.10.156

2 files

0.10.155

2 files

0.10.154

2 files

0.10.153

2 files

0.10.152

2 files

0.10.151

2 files

0.10.150

2 files

0.10.149

2 files

0.10.148

2 files

0.10.147

2 files

0.10.146

2 files

0.10.145

2 files

0.10.144

2 files

0.10.143

2 files

0.10.142

2 files

0.10.141

2 files

0.10.140

2 files

0.10.139

2 files

0.10.138

2 files

0.10.137

2 files

0.10.136

2 files

0.10.135

2 files

0.10.134

2 files

0.10.133

2 files

0.10.132

2 files

0.10.131

2 files

0.10.130

2 files

0.10.129

2 files

0.10.128

2 files

0.10.127

2 files

0.10.126

2 files

0.10.125

2 files

0.10.124

2 files

0.10.123

2 files

0.10.122

2 files

0.10.121

2 files

0.10.120

2 files

0.10.119

2 files

0.10.118

2 files

0.10.117

2 files

0.10.116

2 files

0.10.115

2 files

0.10.114

2 files

0.10.113

2 files

0.10.112

2 files

0.10.111

2 files

0.10.110

2 files

0.10.109

2 files

0.10.108

2 files

0.10.107

2 files

0.10.106

2 files

0.10.105

2 files

0.10.104

2 files

0.10.103

2 files

0.10.102

2 files

0.10.101

2 files

0.10.100

2 files

0.10.99

2 files

0.10.98

2 files

0.10.97

2 files

0.10.96

2 files

0.10.95

2 files

0.10.94

2 files

0.10.93

2 files

0.10.92

2 files

0.10.91

2 files

0.10.90

2 files

0.10.89

2 files

0.10.88

2 files

0.10.87

2 files

0.10.86

2 files

0.10.85

2 files

0.10.84

2 files

0.10.83

2 files

0.10.82

2 files

0.10.81

2 files

0.10.80

2 files

0.10.79

2 files

0.10.78

2 files

0.10.77

2 files

0.10.76

2 files

0.10.75

2 files

0.10.74

2 files

0.10.73

2 files

0.10.72

2 files

0.10.71

2 files

0.10.70

2 files

0.10.69

2 files

0.10.68

2 files

0.10.67

2 files

0.10.66

2 files

0.10.65

2 files

0.10.64

2 files

0.10.63

2 files

0.10.62

2 files

0.10.61

2 files

0.10.60

2 files

0.10.59

2 files

0.10.58

2 files

0.10.57

2 files

0.10.56

2 files

0.10.55

2 files

0.10.54

2 files

0.10.53

2 files

0.10.52

2 files

0.10.51

2 files

0.10.50

2 files

0.10.49

2 files

0.10.48

2 files

0.10.47

2 files

0.10.46

2 files

0.10.45

2 files

0.10.44

2 files

0.10.43

2 files

0.10.42

2 files

0.10.41

2 files

0.10.40

2 files

0.10.39

2 files

0.10.38

2 files

0.10.37

2 files

0.10.36

2 files

0.10.35

2 files

0.10.34

2 files

0.10.33

2 files

0.10.32

2 files

0.10.31

2 files

0.10.30

2 files

0.10.29

2 files

0.10.28

2 files

0.10.27

2 files

0.10.26

2 files

0.10.25

2 files

0.10.24

2 files

0.10.23

2 files

0.10.22

2 files

0.10.21

2 files

0.10.20

2 files

0.10.19

2 files

0.10.18

2 files

0.10.17

2 files

0.10.16

2 files

0.10.15

2 files

0.10.14

2 files

0.10.13

2 files

0.10.12

2 files

0.10.11

2 files

0.10.10

2 files

0.10.9

2 files

0.10.8

2 files

0.10.7

2 files

0.10.6

2 files

0.10.5

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.0

2 files

0.8.0

2 files

0.7.14

2 files

0.7.13

2 files

0.7.12

2 files

0.7.11

2 files

0.7.10

2 files

0.7.9

2 files

0.7.8

2 files

0.7.7

2 files

0.7.5

2 files

0.7.3

2 files

0.7.1

2 files

0.7.0

2 files

0.6.4

2 files

0.6.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page