Patter: Custom Voice
April 14, 2026 · View on GitHub
Patter: Custom Voice
Pipeline mode with independent STT and TTS providers -- use Deepgram for speech-to-text and ElevenLabs for text-to-speech, or mix and match any supported provider.
Part of the Patter Voice AI SDK.
Prerequisites
- Twilio account with a phone number
- OpenAI API key (used for the LLM)
- Deepgram API key for speech-to-text
- ElevenLabs API key for text-to-speech
Quick Start
Python
cd python
cp ../.env.example .env # fill in your keys
pip install -r requirements.txt
python main.py
TypeScript
cd typescript
cp ../.env.example .env # fill in your keys
npm install
npx tsx main.ts
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY | Yes | OpenAI API key (used for the LLM) |
TWILIO_ACCOUNT_SID | Yes | Twilio account SID |
TWILIO_AUTH_TOKEN | Yes | Twilio auth token |
TWILIO_PHONE_NUMBER | Yes | Your Twilio phone number (E.164) |
DEEPGRAM_API_KEY | Yes | Deepgram API key for STT |
ELEVENLABS_API_KEY | Yes | ElevenLabs API key for TTS |
WEBHOOK_URL | No | Public URL for webhooks (auto-tunneled if omitted) |
What This Demonstrates
provider="pipeline"for modular STT + LLM + TTSPatter.deepgram()for configuring Deepgram speech-to-textPatter.elevenlabs()for configuring ElevenLabs text-to-speech- Custom STT/TTS selection independent of the LLM provider
Next Steps
- Inbound Agent — answer calls with AI
- Outbound Calls — place calls with AMD
- Tool Calling — add webhook-backed tools
- Full documentation
- All templates
License
MIT