Skip to content

PatterAI/patter-production

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patter

Patter: Production Setup

Full production configuration with custom LLM, guardrails, tools, dynamic variables, recording, dashboard, and all lifecycle callbacks.

Part of the Patter Voice AI SDK.

Prerequisites

Quick Start

Python

cd python
cp ../.env.example .env   # fill in your keys
pip install -r requirements.txt
python main.py
# Dashboard: http://localhost:8000/dashboard

TypeScript

cd typescript
cp ../.env.example .env   # fill in your keys
npm install
npx tsx main.ts
# Dashboard: http://localhost:8000/dashboard

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY Yes Anthropic API key for Claude (or swap with your LLM)
DEEPGRAM_API_KEY Yes Deepgram API key for speech-to-text
ELEVENLABS_API_KEY Yes ElevenLabs API key for text-to-speech
TWILIO_ACCOUNT_SID Yes Twilio account SID
TWILIO_AUTH_TOKEN Yes Twilio auth token
TWILIO_PHONE_NUMBER Yes Your Twilio phone number (E.164)
WEBHOOK_URL No Public URL for webhooks (auto-tunneled if omitted)
DASHBOARD_TOKEN Yes Secret token for dashboard authentication

What This Demonstrates

  • Pipeline mode — separate STT (Deepgram), LLM (Claude), and TTS (ElevenLabs) providers
  • Custom LLMon_message callback to call Anthropic Claude (swap with any LLM)
  • Guardrails — block competitor mentions, PII, medical/legal topics from agent responses
  • Tools — function calling with webhook-backed or local tool handlers
  • Dynamic variables{customer_name}, {account_id} placeholders in system prompts
  • Recordingrecording=True enables Twilio call recording
  • Dashboarddashboard=True with token auth for real-time call monitoring
  • Lifecycle callbackson_call_start, on_call_end, on_metrics for logging and CRM integration
  • Cost tracking — custom pricing overrides for accurate per-call cost breakdown

Architecture

Phone Call
  |
  v
Twilio --> Patter Server (port 8000)
              |
              +-- on_call_start() --> CRM lookup, variable overrides
              |
              +-- Deepgram STT --> transcription
              |
              +-- on_message() --> Claude API --> response text
              |
              +-- Guardrails --> filter response
              |
              +-- ElevenLabs TTS --> audio
              |
              +-- on_metrics() --> monitoring
              |
              +-- on_call_end() --> save transcript, log cost
              |
              +-- Dashboard (SSE) --> real-time UI

Next Steps

License

MIT

About

Patter template: Full production setup with tools, guardrails, recording, and dashboard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors