livekit-plugins-pyai
PyAI Hear (speech-to-text) and Speak (text-to-speech) components for LiveKit Agents, maintained by PyAI.
Use this package when you want to own the LiveKit room, worker, LLM, tools, and turn policy. Use PyAI Omni when you want one managed speech-to-speech agent instead.
pip install livekit-plugins-pyai==0.1.2
Requires Python 3.10 or newer.
Replace the speech components
from livekit.agents import AgentSession
from livekit.plugins import pyai
session = AgentSession(
stt=pyai.STT(), # PyAI Hear (streaming STT)
llm=llm, # keep your existing LLM
tts=pyai.TTS(voice="stock_emma_en_gb"), # PyAI Speak (TTS)
vad=vad, # keep your existing VAD
)
Set your key once: export PYAI_API_KEY=pyai_live_... (or pass api_key=). The
key needs the hear:stream, hear:transcribe, and speak:synthesize scopes.
List voices at GET https://api.pyai.com/v1/voices.
See the integration status and comparison
for the current public guide link, production notes, and release status. The source
distribution includes examples/agent.py; install
livekit-plugins-pyai[examples] to run its optional LLM and VAD dependencies.
STT, pyai.STT(...)
| arg | default | notes |
|---|---|---|
api_key |
$PYAI_API_KEY |
opaque PyAI key |
base_url |
https://api.pyai.com |
API base |
model |
pyai-hear |
STT model |
language |
omitted (automatic) | Optional explicit ISO-639-1 hint |
sample_rate |
16000 |
inbound frames are resampled to this |
Streams audio to the PyAI Hear socket and emits LiveKit INTERIM_TRANSCRIPT
(PyAI partial/speech_final) and FINAL_TRANSCRIPT (PyAI corrected final).
A batch recognize() path uses the sync transcription endpoint.
TTS, pyai.TTS(voice=..., ...)
| arg | default | notes |
|---|---|---|
voice |
(required) | a streaming-capable voice_id from GET /v1/voices |
api_key |
$PYAI_API_KEY |
opaque PyAI key |
base_url |
https://api.pyai.com |
API base |
model |
pyai-speak |
TTS model |
sample_rate |
24000 |
output PCM rate |
Requests response_format: pcm at the session sample rate and streams the raw
PCM straight into the agent's audio output (low time-to-first-byte).
Notes
- Billing/limits follow your PyAI key (
hear.minutes,speak.minutes); a realtime STT session counts against your key's concurrency. - Built on the official PyAI Python SDK (
pyai-sdk). - Hear streaming supports
en,es,fr,de,hi,it,pt, andnl. Pass the explicit language for non-English audio. - LiveKit Cloud, telephony, your LLM, and worker hosting are separate from PyAI Hear and Speak metering.
- For a fully managed agent, including turn-taking, reasoning, tools, caller continuity when enabled on an Agent profile and a caller key is available, and optional telephony, use PyAI Omni instead.
- Licensed under Apache-2.0. The source is included in the wheel and source distribution.
Language is detected automatically when language is omitted. Pass an explicit
supported language only when you intend to pin recognition.
0.1.2 release
Includes the pyai.v1 WebSocket handshake marker alongside the credential
subprotocol for compatibility with the current Hear endpoint. TTS continues
to reuse an aiohttp session and forward PCM audio as it arrives.
Metadata
Release files for livekit-plugins-pyai 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| livekit_plugins_pyai-0.1.2.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| livekit_plugins_pyai-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / livekit_plugins_pyai-0.1.2.tar.gz
| Download URL | livekit_plugins_pyai-0.1.2.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9e3148f6b055869c7513fb7a51810eb3c5dccfb4c092e210a74b3fb0aec035d
|
|
BLAKE2b-256 checksum How to use checksums |
6663bd782e10695e32c6a67c0497aa4d292b3857b61a817ed76970ae2bd3b753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 8, 2026.
Transparency logRelease files / livekit_plugins_pyai-0.1.2-py3-none-any.whl
| Download URL | livekit_plugins_pyai-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1074a02518e788bbfb672506648ed437a6e7abee6527828c1d93028d3baf1f5f
|
|
BLAKE2b-256 checksum How to use checksums |
230f21eea83d0c4ab442a7cbde274ff984793e8e90c81126ee02bfed45fa19c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 8, 2026.
Transparency log