█

AI/TLDR

Buy me a coffee
Buy me a coffee

Patter

Open-source Python and TypeScript SDK that gives an AI agent a phone number

Audio, Music & VoiceOpen source
Language
Python
License
MIT
$pip install getpatter
IN SHORT

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.

Stacked-layer diagram with the Agent on top, Patter in the middle and the phone network at the bottom
Patter sits between your agent and the phone network and owns every layer of the call.Patter website ↗

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.

bashbash
pip install getpatter
# or
npm install getpatter

Give 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.

pythonpython
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.

typescripttypescript
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.

pythonpython
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.

bashbash
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.py

Commands 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.

ToolStarsWhat it does
VoiceStudio★ 121kA 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★ 114kOpenAI's speech recognition model that transcribes and translates audio across many languages.
GPT-SoVITS★ 64.3kAn 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.6kLocal-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.6kMicrosoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts.
whisper.cpp★ 55.7kA 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.3kA library of text-to-speech models including the multilingual XTTS voice-cloning model.
Patter★ 1.1kOpen-source Python and TypeScript SDK that gives an AI agent a phone number