What is Patter?
Patter is an open-source SDK that gives your AI agent a phone number. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed MIT. To get started: install the SDK.
Overview
Patter is an open-source SDK that gives your AI agent a phone number. You write the agent logic; Patter handles everything between it and the phone network — the agent loop, the language model, speech-to-text, text-to-speech, real-time voice, audio processing and the telephony carrier. The project positions itself as an open-source alternative to hosted voice-agent platforms such as Vapi and Retell, for builders who want to own the stack.

Every layer of a call is pluggable. A carrier (Twilio, Telnyx or Plivo) puts the call on the internet, the SDK transcodes the audio and handles barge-in, and an engine produces the reply. In engine mode a single realtime provider such as OpenAI Realtime, Gemini Live, Ultravox or ElevenLabs ConvAI does speech-to-speech; in pipeline mode you pick separate STT, LLM and TTS vendors; a third, hybrid mode is also available. The README counts more than 27 provider integrations across the stack, and any of them can be swapped with one line.
The SDK ships in Python and TypeScript with the same surface, hooks and events in both. On top of the voice stack it adds an automatic LLM fallback chain for mid-call provider failover, built-in tools, call transfer and guardrails that behave the same on every carrier, an OpenTelemetry trace of each call, and an embedded web dashboard for live calls, latency and per-component cost. It runs in your own process under the MIT licence, with your own provider keys.
What it does
- One API in Python and TypeScript at full parity — a working phone agent takes about four lines
- Choose the provider for every layer: LLMs (OpenAI, Anthropic, Gemini, Groq, Cerebras), STT (Deepgram, AssemblyAI, Whisper and more), TTS (ElevenLabs, Cartesia, Rime and more)
- Realtime, pipeline and hybrid voice modes, with realtime engines such as OpenAI Realtime, Gemini Live, Ultravox and ElevenLabs ConvAI
- Telephony over Twilio, Telnyx or Plivo, with a built-in Cloudflare quick tunnel for local development
- Tool calling, call transfer, guardrails and an automatic LLM fallback chain, plus Silero VAD, Krisp and DeepFilterNet audio processing
- Embedded dashboard for live calls, latency waterfalls and cost breakdowns, and a vendor-neutral OpenTelemetry trace per call
Getting started
Patter installs from PyPI or npm as `getpatter`. Provider and carrier credentials are read from environment variables such as TWILIO_ACCOUNT_SID and OPENAI_API_KEY; the docs list the full catalogue.
Install the SDK
Pick the language you build in — both packages expose the same API.
pip install getpatter
# or
npm install getpatterGive an agent a phone number (Python)
Create a Patter instance with a carrier and number, define an agent with a realtime engine and a system prompt, and serve it. `tunnel=True` spawns a Cloudflare quick tunnel and points your number at it; in production use a static webhook URL instead.
from getpatter import Patter, Twilio, OpenAIRealtime
phone = Patter(carrier=Twilio(), phone_number="+15550001234")
agent = phone.agent(
engine=OpenAIRealtime(),
system_prompt="You are a friendly receptionist for Acme Corp.",
first_message="Hello! How can I help?",
)
await phone.serve(agent, tunnel=True)Or the same agent in TypeScript
Swap Twilio for Telnyx or Plivo to change carrier.
import { Patter, Twilio, OpenAIRealtime } from "getpatter";
const phone = new Patter({ carrier: new Twilio(), phoneNumber: "+15550001234" });
const agent = phone.agent({
engine: new OpenAIRealtime(),
systemPrompt: "You are a friendly receptionist for Acme Corp.",
firstMessage: "Hello! How can I help?",
});
await phone.serve({ agent, tunnel: true });Switch to pipeline mode for full control
Instead of one engine, pick each stage: speech-to-text, the LLM and text-to-speech. Each reads its API key from the environment.
from getpatter import DeepgramSTT, AnthropicLLM, ElevenLabsTTS
agent = phone.agent(
stt=DeepgramSTT(),
llm=AnthropicLLM(),
tts=ElevenLabsTTS(),
system_prompt="...",
)
await phone.serve(agent)Start from a template
Self-contained template repos cover inbound and outbound calls, tool calling, custom voices, a dashboard and a production setup. Clone one, add your keys and run.
git clone https://github.com/PatterAI/patter-inbound-agent
cd patter-inbound-agent
cp .env.example .env # fill in your keys
cd python && pip install -r requirements.txt && python main.pyCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Answer inbound calls with an AI receptionist or booking assistant on a Twilio, Telnyx or Plivo number
- Place outbound calls with answering-machine detection and voicemail drop
- Let a phone agent look up CRM records or create tickets mid-call through tool calling
- Replace a hosted per-minute voice platform with a self-hosted SDK where you choose every LLM, STT and TTS vendor
How Patter compares
Patter alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| VoiceStudio | ★ 121k | A local-first desktop voice studio that clones and designs voices, dubs video, and handles dictation, running 16 text-to-speech and 11 speech-recognition engines on your own hardware. |
| Whisper | ★ 114k | OpenAI's speech recognition model that transcribes and translates audio across many languages. |
| GPT-SoVITS | ★ 64.3k | An open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning. |
| Voicebox | ★ 61.6k | Local-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP. |
| VibeVoice | ★ 57.6k | Microsoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts. |
| whisper.cpp | ★ 55.7k | A dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers. |
| Coqui TTS | ★ 46.3k | A library of text-to-speech models including the multilingual XTTS voice-cloning model. |
| Patter | ★ 1.1k | Open-source Python and TypeScript SDK that gives an AI agent a phone number |
