MCPcopy Index your code
hub / github.com/PatterAI/Patter

github.com/PatterAI/Patter @v0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.0 ↗ · + Follow
9,386 symbols 34,502 edges 700 files 3,453 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://raw.githubusercontent.com/PatterAI/Patter/main/docs/github-banner.png" alt="Patter SDK" width="100%" />

Patter SDK

PyPI npm MIT License Python 3.11+ TypeScript 5+

AboutHow It WorksDocumentationQuickstartSkillsTemplates


About

Patter is the open-source SDK that gives your AI agent a phone number. You build the agent; 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.

  • Build with one API in Python or TypeScript — same surface, same hooks, same events, at full parity.
  • Choose the provider for every layer — LLM, STT, TTS, realtime engine, carrier — and swap any of them with one line.
  • Run locally with a built-in tunnel and dashboard, or simulate a whole call from your terminal — no phone required.

How It Works

Patter is the full voice stack between your application and the phone network — not just glue between an LLM and a carrier. It runs the agent loop and owns every layer of the call, and you pick the provider for each one. Compose them in Realtime, Pipeline, or Hybrid mode.

27+ provider integrations across the voice stack · 3 voice modes · 2 SDKs (Python & TypeScript) at parity.

Layer Choose from
LLM — text generation OpenAI · Anthropic · Google Gemini · Groq · Cerebras
STT — speech-to-text Deepgram · AssemblyAI · Cartesia · Soniox · Speechmatics · Whisper
TTS — text-to-speech ElevenLabs · OpenAI · Cartesia · LMNT · Rime · Telnyx
Realtime — all-in-one voice OpenAI Realtime · Gemini Live · Ultravox · ElevenLabs ConvAI
Telephony — phone carriers Twilio · Telnyx · Plivo
Audio — VAD & suppression Silero VAD · Krisp · DeepFilterNet

On top of the stack: an automatic LLM fallback chain (provider failover mid-call), built-in tools / call transfer / guardrails that behave identically on every carrier, and a vendor-neutral OpenTelemetry trace of each call.

Documentation

Visit the docs, or jump straight to a quickstart: TypeScript · Python.

Skills for Coding Agents

Using Claude Code, Claude Desktop, OpenClaw, Hermes, Cursor, Codex, or another AI coding agent?

Install Patter skills for voice agents →

npx skills add patterai/skills

The bundle works in ~55 agent harnesses that consume the Anthropic Agent Skills standard. Install once; every agent on your machine learns the SDK. Skills live in their own repository: PatterAI/skills.

Quickstart

Provider and carrier credentials are read from environment variables (e.g. TWILIO_ACCOUNT_SID, OPENAI_API_KEY) — the docs list the full catalog. Swap Twilio for Telnyx or Plivo to change carrier.

TypeScript

npm install getpatter
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 });

Python

pip install getpatter
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)

tunnel: true spawns a Cloudflare quick tunnel and points your number at it — ideal for local dev. For production, use a static webhook_url (or ngrok); see Tunneling.

Telemetry

Note Patter collects anonymous, opt-out usage data (SDK version, bucketed provider/model and call facts) to help us prioritise — never call content, prompts, phone numbers, keys, or free text.

Opt out any time: Patter(telemetry=False) (new Patter({ telemetry: false })), getpatter telemetry disable, or PATTER_TELEMETRY_DISABLED=1 (also honours DO_NOT_TRACK=1); auto-off in CI/tests. Inspect without sending: PATTER_TELEMETRY_DEBUG=1. Full details: Telemetry.

Templates

Each template is a self-contained repo — clone, add your .env, and run. Python and TypeScript both included.

Template Description Repo
Inbound Agent Answer calls as a restaurant booking assistant patter-inbound-agent
Outbound Calls Place calls with AMD and voicemail drop patter-outbound-calls
Tool Calling CRM lookup + ticket creation via webhook tools patter-tool-calling
Custom Voice Pipeline mode: Deepgram STT + ElevenLabs TTS patter-custom-voice
Dynamic Variables Personalize prompts per caller using CRM data patter-dynamic-variables
Custom LLM Bring your own model patter-custom-llm
Dashboard Real-time monitoring with cost + latency tracking patter-dashboard
Production Setup Everything enabled: tools, guardrails, recording, dashboard patter-production
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

Star History

Star History Chart

Contributors

Thanks to all our amazing contributors!

License

MIT — see LICENSE.

Extension points exported contracts — how you extend this code

CronTask (Interface)
(no doc) [13 implementers]
libraries/typescript/src/scheduler.ts
TurnData (Interface)
(no doc)
docs/examples/pipeline-custom-agent.ts
CallCost (Interface)
(no doc)
dashboard-app/src/components/CallTable.tsx
ToolExecutor (Interface)
(no doc) [6 implementers]
libraries/typescript/src/llm-loop.ts
TranscriptEntry (Interface)
(no doc)
docs/examples/conversation-history.ts
Call (Interface)
(no doc)
dashboard-app/src/components/CallTable.tsx
LLMProvider (Interface)
(no doc) [27 implementers]
libraries/typescript/src/llm-loop.ts
TranscriptEvent (Interface)
(no doc)
docs/examples/conversation-history.ts

Core symbols most depended-on inside this repo

expect
called by 4956
libraries/typescript/src/evals/assertions.ts
push
called by 554
libraries/typescript/src/audio/transcoding.ts
getLogger
called by 533
libraries/typescript/src/logger.ts
debug
called by 354
libraries/typescript/src/logger.ts
close
called by 323
libraries/typescript/src/types.ts
info
called by 234
libraries/typescript/src/logger.ts
warn
called by 194
libraries/typescript/src/logger.ts
parse
called by 189
libraries/typescript/src/evals/llm-judge.ts

Shape

Method 4,671
Function 2,935
Class 1,358
Interface 339
Route 83

Languages

Python69%
TypeScript31%

Modules by API surface

libraries/python/getpatter/stream_handler.py183 symbols
libraries/typescript/src/stream-handler.ts168 symbols
libraries/python/tests/unit/test_sentence_chunker.py143 symbols
libraries/python/tests/unit/test_server_unit.py138 symbols
libraries/python/tests/unit/test_providers_io_unit.py138 symbols
libraries/python/tests/unit/test_pipeline_hooks.py96 symbols
libraries/python/tests/test_telemetry.py96 symbols
libraries/python/tests/integration/test_pipeline_e2e.py90 symbols
libraries/python/tests/unit/test_new_api_python.py86 symbols
libraries/typescript/src/server.ts71 symbols
libraries/python/tests/unit/test_input_chain.py68 symbols
libraries/python/getpatter/client.py66 symbols

For agents

$ claude mcp add Patter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page