The
pipecat-pyai package is maintained by PyAI. It does not replace your
transport, LLM, context aggregator, or application processors.What stays under your control
Pipecat still owns frame order and routing. You can place custom processors before, between, or after the PyAI services and keep the deployment model you already use.Prerequisites
- Python 3.11 or newer
- A Pipecat application with a transport and LLM service
- A PyAI key with
hear:streamandspeak:synthesizescopes - A voice id from
GET https://api.pyai.com/v1/voices
Install
Install the verified public release from PyPI:Add PyAI to the pipeline
Put Hear after the transport input and Speak before the transport output:transport, user_aggregator, assistant_aggregator, and llm
refer to the objects your Pipecat application already creates. Your VAD and
turn configuration remain in effect.
Complete task shape
Configuration
Hear speech-to-text
InterimTranscriptionFrame plus finalized TranscriptionFrame objects. Hear
streaming is English-only.
Speak text-to-speech
TTSAudioRawFrame objects at the configured rate. Use a streaming-capable
stock, cloned, or designed voice id available to the same PyAI organization.
Share a TTS HTTP session
For applications that already manage anaiohttp.ClientSession, pass it to
the TTS service:
Run and verify
1
Start your Pipecat bot
Run the same transport and deployment command you use today.
2
Send a two-turn conversation
Speak one short request, wait for agent audio, then interrupt or ask a
follow-up. This verifies transcript finalization, context flow, TTS, and
interruption behavior.
3
Inspect pipeline metrics
Confirm the Pipecat task receives transcript frames and TTS usage metrics.
Log the transport region, worker region, LLM, VAD settings, voice, and PyAI
region with any latency result.
4
Exercise failure handling
Test an invalid key, missing scope, and exhausted concurrency so your
pipeline presents a safe fallback instead of silently stopping.
Production notes
- Keep your Pipecat worker, transport media server, and PyAI speech endpoints in nearby regions.
- A running Hear service counts against the PyAI key’s realtime concurrency.
- Hear and Speak meter against your PyAI account. Pipecat Cloud, transport, your LLM, and worker hosting remain separate.
- Keep a bounded queue and timeout around custom processors so one integration cannot stall caller audio indefinitely.
- Use Omni instead when you want PyAI to own turn-taking, reasoning, tools, caller continuity when an Agent profile has continuity enabled and a caller key is available, and optional managed telephony as one system.
Troubleshooting
Which path should I choose?
Choose Pipecat + PyAI for custom frame processors, transport flexibility, branching, and per-stage observability. Choose Omni when one managed speech-to-speech contract is more valuable than operating the pipeline.Pipecat documentation
Review Pipecat’s pipeline, transport, and deployment model.
PyAI Omni overview
Compare the managed speech-to-speech path.