Skip to main content

Kalpa for Pipecat

Kalpa text-to-speech services for Pipecat, maintained by Kalpa Labs, the company providing the Kalpa API.

This community integration provides KalpaTTSService for WebSocket streaming and KalpaHttpTTSService for HTTP streaming. See the Kalpa speech documentation for available voices, models, and languages.

Demo

Watch the Pipecat + Kalpa TTS 1 demo. The browser conversation includes English and Hindi speech, a spoken interruption, and timestamped Pipecat events.

Installation

Requires Python 3.11 or later and Pipecat 1.13.x. Automated compatibility tests pass with Pipecat 1.13.0 on Python 3.12.

uv add pipecat-kalpa

Usage

Get an API key from the Kalpa dashboard and set KALPA_API_KEY in your environment. See authentication for details.

import os

from pipecat.pipeline.pipeline import Pipeline
from pipecat_kalpa import KalpaTTSService

tts = KalpaTTSService(api_key=os.environ["KALPA_API_KEY"])

# Add Kalpa to an existing voice pipeline.
pipeline = Pipeline(
    [
        transport.input(),
        stt,
        user_aggregator,
        llm,
        tts,
        transport.output(),
        assistant_aggregator,
    ]
)

transport, stt, llm, and the context aggregators are the other components of your application. A complete runnable example is provided below.

Use KalpaTTSService to send a reply's text as it arrives over one WebSocket connection. For HTTP streaming, replace it with KalpaHttpTTSService(api_key=os.environ["KALPA_API_KEY"]).

Configuration

Both services require api_key. Pass voice and model overrides with settings=KalpaTTSService.Settings(...) or settings=KalpaHttpTTSService.Settings(...):

tts = KalpaTTSService(
    api_key=os.environ["KALPA_API_KEY"],
    settings=KalpaTTSService.Settings(
        voice="18c26f49-9f9c-400c-bec9-7467f28e1db5",
        model="kalpa-tts-1",
    ),
)
Setting Default Description
voice 18c26f49-9f9c-400c-bec9-7467f28e1db5 Arjun. Use a voice ID from GET /v1/voices.
model kalpa-tts-1 A model ID from GET /v1/models.
language None Guides Pipecat sentence splitting; it is not sent to Kalpa.

Voice and model changes can be sent during a session with TTSUpdateSettingsFrame. The WebSocket service reconnects to apply them.

Constructor argument Service Default
base_url WebSocket wss://api.kalpalabs.ai
base_url HTTP https://api.kalpalabs.ai
text_aggregation_mode WebSocket TextAggregationMode.TOKEN
aiohttp_session HTTP None; the service creates and closes its own session

The services produce 24 kHz mono, 16-bit PCM audio. Pipecat's output transport resamples it when your pipeline uses a different output rate. Do not pass sample_rate to these services.

Run the voice example

The example uses Deepgram for speech recognition, OpenAI for generating replies, and Kalpa for speech output. It connects to your browser over WebRTC.

git clone https://github.com/kalpalabs/pipecat-kalpa.git
cd pipecat-kalpa
uv sync --extra examples
cp .env.example .env

Set KALPA_API_KEY, DEEPGRAM_API_KEY, and OPENAI_API_KEY in .env, then run:

uv run --extra examples python examples/voice.py --transport webrtc

Open the address printed by the runner, enable microphone access, and connect. Speak while the assistant is talking to interrupt its reply.

Set KALPA_TTS_TRANSPORT=http to run the same example with HTTP streaming:

KALPA_TTS_TRANSPORT=http uv run --extra examples python examples/voice.py --transport webrtc

KALPA_VOICE_ID optionally overrides the example's voice.

Development

uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv build

Tests use local fake API servers and do not need API keys. Report issues on the integration repository.

License

BSD-2-Clause. See LICENSE.

Metadata

Release files for pipecat-kalpa 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipecat-kalpa 0.1.1
File Size Uploaded Provenance Actions
pipecat_kalpa-0.1.1.tar.gz 21.0 kB With provenance Details for pipecat_kalpa-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipecat-kalpa 0.1.1
File Interpreter ABI Platform Actions
pipecat_kalpa-0.1.1-py3-none-any.whl Python 3 none any Details for pipecat_kalpa-0.1.1-py3-none-any.whl

Total release size: 34.5 kB

Release files / pipecat_kalpa-0.1.1.tar.gz

Download URL pipecat_kalpa-0.1.1.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
40df5ca31b27dc6934f1d7b7213a584fbdd468e1b67a86350ffde5438c1b11e2
BLAKE2b-256 checksum
How to use checksums
b77e6e34d52c7211d46f31be10576eca600e5a94fcd15d654e7466396ec71fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / pipecat_kalpa-0.1.1-py3-none-any.whl

Download URL pipecat_kalpa-0.1.1-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
322c28ef44808c4a800fe0422bd617931a90b166d93cf07cca7b754ae2ae38c4
BLAKE2b-256 checksum
How to use checksums
0507b0fa425d46a2134996189b0984b835399698ac252103ed7cb60e88c2b68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for pipecat-kalpa 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pipecat_kalpa-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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