Skip to main content

SonexLabs plugin for LiveKit Agents

PyPI Python License: Apache-2.0

Support for real-time voice synthesis with SonexLabs' Panini TTS engine in LiveKit Agents.

See docs.sonexlabs.com for full API reference.

Installation

pip install livekit-plugins-sonex

Pre-requisites

You'll need an API key from SonexLabs. It can be set as an environment variable:

export SONEX_API_KEY=vsk_xxxxxxxxx

Usage

from livekit.agents import AgentSession
from livekit.plugins import sonex

session = AgentSession(
    tts=sonex.TTS(
        voice_id="YOUR_VOICE_ID",
    ),
    # ... llm, stt, vad, turn_handling, etc.
)

Or pass the API key directly instead of using the environment variable:

tts = sonex.TTS(
    api_key="vsk_xxxxxxxxx",
    voice_id="YOUR_VOICE_ID",
)

Streaming and connection reuse

Synthesis requests are sent to SonexLabs' /v1/speech/stream endpoint, so audio is delivered as chunked HTTP as soon as it's generated rather than after the full utterance completes, reducing time-to-first-audio. When no explicit http_session is supplied, the plugin uses LiveKit Agents' shared, process-wide aiohttp.ClientSession, so connections are pooled and reused across requests instead of being re-established on every call.

Parameters

Parameter Type Default Description
api_key str — SonexLabs API key. Falls back to SONEX_API_KEY if not set.
voice_id str — Required. Voice ID from GET /v1/voices.
language str auto-detect Optional. Leave unset to auto-detect.
speed float 1.0 Speech rate multiplier.
sample_rate int 24000 Output sample rate in Hz. Not sent to the API — Panini always returns audio at its native rate; this value is used for LiveKit-side reporting only.
base_url str https://api.sonexlabs.com SonexLabs API base URL.
http_session aiohttp.ClientSession shared session Optional existing session to reuse.

Requirements

  • Python >= 3.10
  • livekit-agents >= 1.6.7

Local development

git clone https://github.com/sonexlabs/livekit-plugins-sonex.git
cd livekit-plugins-sonex
pip install -e .

License

Apache-2.0 — see LICENSE.

Metadata

Release files for livekit-plugins-sonex 0.2.2

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

Source distribution (sdist)

Source distribution for livekit-plugins-sonex 0.2.2
File Size Uploaded Provenance
livekit_plugins_sonex-0.2.2.tar.gz 10.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-sonex 0.2.2
File Interpreter ABI Platform
livekit_plugins_sonex-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.6 kB

Release files / livekit_plugins_sonex-0.2.2.tar.gz

Download URL livekit_plugins_sonex-0.2.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6661eb9573ffd932626d86f6da0c1031ffe30ced1a4cb33f728ca65db4040400
BLAKE2b-256 checksum
How to use checksums
1f404f3fecccfc89fd69cda178dd59e01395b552672a0d44cb3bf8005fa48599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Release files / livekit_plugins_sonex-0.2.2-py3-none-any.whl

Download URL livekit_plugins_sonex-0.2.2-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94ac611d5832bfdf0ad8cd05d609684e56802dca505f4b282da766de5b460ded
BLAKE2b-256 checksum
How to use checksums
7d9c58d5877eb76181a9066566c0146e393de598b64dc0fc64d5092483d6af4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.18

Security for livekit-plugins-sonex 0.2.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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