Engines
An engine is an end-to-end speech-to-speech runtime. Pass an engine instance tophone.agent(engine=...) and Patter wires the audio stream straight through to the provider — no separate STT or TTS is needed.
Patter ships with two engine classes today:
OpenAIRealtime— OpenAI’s Realtime APIElevenLabsConvAI— ElevenLabs Conversational AI
from getpatter import OpenAIRealtime) and a namespaced class (from getpatter.engines import openai → openai.Realtime()). They are equivalent.
If you need full control over STT, LLM, and TTS independently, use pipeline mode instead and omit engine=.
OpenAIRealtime
OpenAI’s Realtime API — the lowest-latency option.| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | "" | OpenAI API key. Reads from OPENAI_API_KEY when empty. |
voice | str | "alloy" | One of "alloy", "echo", "fable", "onyx", "nova", "shimmer". |
model | str | "gpt-4o-mini-realtime-preview" | OpenAI Realtime model ID. |
ElevenLabsConvAI
ElevenLabs Conversational AI — premium voice quality using a managed agent configured in the ElevenLabs dashboard.| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | "" | ElevenLabs API key. Reads from ELEVENLABS_API_KEY when empty. |
agent_id | str | "" | ElevenLabs agent ID (from the ConvAI dashboard). Reads from ELEVENLABS_AGENT_ID when empty. |
voice | str | "" | Optional override for the agent’s default voice ID. |
What’s Next
LLM
Compare engine mode with pipeline mode.
STT
STT for pipeline mode.
TTS
TTS for pipeline mode.

