Patter

Open-source voice-AI SDK. The Vapi/Retell alternative for builders who want to own the stack. Give your AI agent a phone number in 4 lines — Python and TypeScript, MIT licensed, Twilio, Telnyx, and Plivo.

Last verified:

Visit Patter

What is Patter?

Patter is an open-source SDK that gives your AI agent a phone number, connecting any AI agent to real phone calls with just 4 lines of code. It handles telephony, speech-to-text (STT), text-to-speech (TTS), and real-time audio streaming so developers can focus on building the agent logic itself. The SDK works with Python and TypeScript, supports both Twilio and Telnyx telephony providers, and runs locally on your own infrastructure.

Key features include multiple voice modes (OpenAI Realtime for lowest latency, ElevenLabs ConvAI for managed conversation flow, and custom Pipeline mode for independent STT/TTS control), built-in call transfer and recording capabilities, guardrails to block terms or replace responses, Cloudflare tunnel support without needing ngrok, and a real-time dashboard for live metrics and latency tracking. The SDK supports tool calling so agents can call external APIs mid-conversation, dynamic variables for personalizing prompts per caller, and outbound calls with machine detection/voicemail drop.

Patter is designed for AI engineers, voice AI builders, and developers who want to build voice-enabled AI agents while maintaining control over their stack. It's ideal for teams building customer service agents, receptionists, appointment booking assistants, reminder calls, or any use case requiring AI agents to handle real phone calls. The MIT license and open-source nature make it attractive for builders who want an alternative to hosted services like Vapi or Retell.

Patter pricing

Pricing model: Freemium

Patter SDK is open-source and free under MIT license. There is no cost for the SDK itself. Users must bring their own telephony provider (Twilio or Telnyx) and pay standard carrier rates for phone numbers and call minutes. Users must also bring their own AI provider credentials (OpenAI, ElevenLabs, Deepgram, Anthropic, Groq, Cerebras, Google, Cartesia, Rime, LMNT, Soniox, Speechmatics, AssemblyAI) and pay those providers directly for STT, TTS, and LLM usage. A hosted Patter Cloud option is planned for future release but not currently available.

Patter pros

  • Open-source SDK with MIT license
  • Connects AI agent to phone in just 4 lines of code
  • Works with both Python and TypeScript
  • Supports Twilio and Telnyx with equal feature parity
  • Runs locally on your own infrastructure
  • OpenAI Realtime mode for lowest latency conversations
  • Built-in Cloudflare tunnel support, no ngrok needed
  • Call transfer and recording built-in as system tools
  • Supports 5 LLM providers: OpenAI, Anthropic, Groq, Cerebras, Google
  • Multiple STT providers: Deepgram, Whisper, Cartesia, Soniox, Speechmatics, AssemblyAI
  • Multiple TTS providers: ElevenLabs, OpenAI, Cartesia, Rime, LMNT
  • Tool calling works across all LLM providers
  • Outbound calls with machine detection and voicemail drop
  • Real-time dashboard with live metrics and latency tracking
  • Guardrails to block terms and replace responses before reaching caller
  • Dynamic variables for personalizing prompts per caller
  • Non-English agents with auto-language detection
  • PatterTool for integration with LangChain/OpenAI Assistants/MCP

Patter cons

  • No hosted Patter Cloud option currently available (coming in future release)
  • SDK runs entirely in your process - must bring your own carrier credentials
  • Call recording only available with Twilio, not Telnyx
  • Requires Python 3.11+ or TypeScript environment
  • Must manage your own telephony provider account and phone number
  • Must manage your own AI provider API keys and costs
  • Production deployment requires setting up stable webhook URL instead of tunnel
  • Custom LLM logic requires passing on_message handler to serve()

Frequently asked questions about Patter

What is Patter and what does it do?

Patter is an open-source SDK that gives your AI agent a phone number. It connects any AI agent to real phone calls with 4 lines of code. Patter handles telephony, speech-to-text, text-to-speech, and real-time audio streaming so you can focus on building your agent. You build the agent, and Patter connects it to the phone.

What programming languages does Patter support?

Patter works with both Python and TypeScript, offering the same API surface in both languages. The Python SDK requires Python 3.11+. You can pick whichever stack fits your team.

Which telephony providers does Patter support?

Patter fully supports both Twilio and Telnyx with equal feature parity for DTMF, call transfer, and cost tracking. Both carriers work with the same SDK interface. The only difference is that call recording is Twilio-only.

What voice modes are available in Patter?

Patter offers three voice modes: OpenAI Realtime (lowest latency, high quality, best for fluid conversations), Pipeline mode with custom STT + LLM + TTS (low latency, high quality, best for independent control over voice providers), and ElevenLabs ConvAI (low latency, high quality, best for ElevenLabs-managed conversation flow). OpenAI Realtime is the default.

How do I get started with Patter?

Install with pip install getpatter, set environment variables for your carrier (TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN or TELNYX_API_KEY and TELNYX_CONNECTION_ID) and AI provider (OPENAI_API_KEY for default Realtime engine), then write 4 lines of Python: import Patter, Twilio, OpenAIRealtime; create Patter(carrier=Twilio(), phone_number='+15550001234'); create agent with phone.agent(engine=OpenAIRealtime(), system_prompt='...'); call await phone.serve(agent, tunnel=True). Run the script and call your number.

Does Patter support outbound calls?

Yes, Patter supports outbound calls with phone.call(to, agent=agent, machine_detection=True). You can enable voicemail detection and provide a voicemail_message to play when voicemail is detected instead of reaching a human.

Can I use my own STT and TTS providers?

Yes, Patter supports custom STT and TTS providers. For STT you can use Deepgram, Whisper, Cartesia, Soniox, Speechmatics, or AssemblyAI. For TTS you can use ElevenLabs, OpenAI, Cartesia, Rime, or LMNT. In pipeline mode, pass stt=DeepgramSTT() and tts=ElevenLabsTTS() to agent() to use your preferred providers.

Does Patter support tool calling?

Yes, tool calling is built-in. Use agent(tools=[Tool(...)]) to give your agent function-calling capabilities so it can call external APIs mid-conversation. Tool calling works across all 5 supported LLM providers (OpenAI, Anthropic, Groq, Cerebras, Google). You can also use the @tool decorator for async functions.

How do I deploy Patter to production?

In development, use tunnel=True which spawns a Cloudflare tunnel automatically. In production, replace tunnel=True with webhook_url='api.prod.example.com' in the Patter constructor to point to your stable production hostname. You can also use a pre-provisioned Static tunnel object with Patter(..., tunnel=Static(hostname='agent.example.com')).

Is Patter free to use?

Yes, the Patter SDK is open-source and free under the MIT license. However, you must bring your own telephony provider (Twilio or Telnyx) and pay their standard rates for phone numbers and call minutes. You also need to bring your own AI provider credentials and pay those providers directly for STT, TTS, and LLM usage. A hosted Patter Cloud option is planned for future release.

Categories

Use cases

Browse all AI tools on NeedAnAI