A production-ready, framework-agnostic template for integrating Pipecat voice AI agents with any frontend
Transform any web application into a voice-enabled AI assistant in minutes. This standardized template provides everything you need to integrate real-time voice conversations powered by Pipecat AI framework.
- โ Frontend Agnostic: Works with React, Vue, Angular, Next.js, or vanilla JavaScript
- โ Plug & Play AI Services: Easily swap STT, TTS, and LLM providers
- โ Docker Ready: Full containerization for instant deployment
- โ Production Tested: CORS, health checks, error handling, logging included
- โ WebRTC Real-time: Low-latency voice communication via Daily.co
- โ Well Documented: Comprehensive guides for customization and deployment
- โ Example Integrations: React, Vue, and vanilla JS examples included
- Docker & Docker Compose (recommended) OR
- Python 3.9+ and Node.js 18+
- Daily.co API key (free tier: https://dashboard.daily.co/)
git clone <your-repo-url>
cd pipecat-voice-agent-template
# Copy environment template
cp backend/.env.example backend/.envEdit backend/.env and add your keys:
DAILY_API_KEY=your_daily_api_key_here # Required
DEEPGRAM_API_KEY=your_deepgram_key # Speech-to-Text
CARTESIA_API_KEY=your_cartesia_key # Text-to-Speech
GOOGLE_API_KEY=your_google_key # Language ModelGet API Keys:
- Daily.co: https://dashboard.daily.co/developers
- Deepgram: https://console.deepgram.com/
- Cartesia: https://cartesia.ai/
- Google AI: https://makersuite.google.com/app/apikey
# Start both backend and frontend
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose downAccess your app:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8001
- API Docs: http://localhost:8001/docs
Backend:
cd backend
pip install -r requirements.txt
python server.pyFrontend:
cd frontend
npm install
npm run dev- Open http://localhost:3000
- Click "Enable Voice" button
- Start speaking - the AI will respond with voice!
// Step 1: Create a voice session
const response = await fetch('http://localhost:8001/create-room', {
method: 'POST'
});
const { room_url, token } = await response.json();
// Step 2: Connect using Pipecat Client SDK
import { RTVIClient } from '@pipecat-ai/client-js';
import { DailyTransport } from '@pipecat-ai/daily-transport';
const client = new RTVIClient({
transport: new DailyTransport(),
params: { baseUrl: room_url },
enableMic: true
});
await client.connect(token);See detailed integration guides: docs/FRONTEND_INTEGRATION.md
All AI services are configured in backend/bot.py. Mix and match providers:
# Change Speech-to-Text
from pipecat.services.assemblyai import AssemblyAISTTService
stt = AssemblyAISTTService(api_key=os.getenv("ASSEMBLYAI_API_KEY"))
# Change Text-to-Speech
from pipecat.services.elevenlabs import ElevenLabsTTSService
tts = ElevenLabsTTSService(
api_key=os.getenv("ELEVENLABS_API_KEY"),
voice_id="rachel"
)
# Change Language Model
from pipecat.services.openai import OpenAILLMService
llm = OpenAILLMService(
api_key=os.getenv("OPENAI_API_KEY"),
model="gpt-4"
)Supported providers:
- STT: Deepgram, AssemblyAI, Azure, Google, AWS Transcribe
- TTS: Cartesia, ElevenLabs, Azure, Google, AWS Polly, OpenAI
- LLM: Google Gemini, OpenAI GPT, Claude, Groq, Local (Ollama)
Full customization guide: docs/AI_SERVICE_CUSTOMIZATION.md
This template works with any frontend framework:
- Keep the backend as-is (it's framework-agnostic)
- Replace
/frontendwith your React/Vue/Angular/etc. app - Integrate using the REST API - See examples:
pipecat-voice-agent-template/
โโโ backend/ # Python FastAPI + Pipecat
โ โโโ bot.py # Voice AI agent configuration
โ โโโ server.py # REST API server
โ โโโ requirements.txt # Python dependencies
โ โโโ Dockerfile # Backend container
โ โโโ .env.example # Environment variables template
โ
โโโ frontend/ # Next.js frontend (swappable!)
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ ChatInterface.tsx
โ โ โโโ app/
โ โโโ package.json
โ โโโ Dockerfile
โ
โโโ docs/ # Documentation
โ โโโ FRONTEND_INTEGRATION.md # How to integrate any frontend
โ โโโ AI_SERVICE_CUSTOMIZATION.md # How to swap AI services
โ โโโ DEPLOYMENT.md # Production deployment guide
โ
โโโ examples/ # Example integrations
โ โโโ react-example/
โ โโโ vue-example/
โ โโโ vanilla-js-example/
โ
โโโ docker-compose.yml # Multi-container orchestration
โโโ README.md # This file
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Any Frontend โโโโโโโโโโโบโ FastAPI Server โ
โ (React/Vue/JS) โ REST APIโ (Backend) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ โ
โ WebRTC (Daily.co) โ
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Pipecat Client โโโโโโโโโโโบโ Pipecat Bot โ
โ (Browser SDK) โ โ (Python) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ AI Services โ
โ โข STT (Deepgram)โ
โ โข TTS (Cartesia)โ
โ โข LLM (Gemini) โ
โโโโโโโโโโโโโโโโโโโโ
Key Components:
- Backend Server (
server.py): REST API for room creation and health checks - Pipecat Bot (
bot.py): Voice AI agent with STT โ LLM โ TTS pipeline - Frontend: Any web app that can make HTTP requests and use WebRTC
- Daily.co: WebRTC infrastructure for real-time audio streaming
| Guide | Description |
|---|---|
| Frontend Integration | Integrate with React, Vue, Angular, vanilla JS |
| AI Service Customization | Swap STT, TTS, LLM providers |
| Deployment Guide | Deploy to AWS, GCP, Azure, Railway, Render |
Perfect for building:
- ๐ Voice Customer Support Bots
- ๐ Educational Voice Assistants
- ๐ฅ Healthcare Virtual Assistants
- ๐ช E-commerce Voice Shopping
- ๐ฎ Gaming Voice NPCs
- ๐ฑ Mobile App Voice Features
- ๐ Website Voice Interfaces
- Railway: One-click Docker deployment
- Render: Auto-deploy from GitHub
- AWS ECS/Fargate: Production-scale containers
- Google Cloud Run: Serverless containers
- Azure Container Apps: Multi-container support
See docs/DEPLOYMENT.md for detailed guides.
Creates a Daily.co room and starts a bot instance.
Response:
{
"room_url": "https://your-domain.daily.co/room-name",
"room_name": "room-name",
"token": "user-access-token"
}Health check endpoint.
Tests Daily.co API configuration.
Contributions are welcome! Please:
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - Use this template freely for commercial and personal projects.
- Pipecat - Voice AI framework
- Daily.co - WebRTC infrastructure
- Deepgram - Speech recognition
- Cartesia - Text-to-speech
- Google AI - Language models
- ๐ Documentation: docs/
- ๐ Issues: GitHub Issues
- ๐ฌ Pipecat Docs: https://docs.pipecat.ai
- ๐ฅ Daily.co Docs: https://docs.daily.co
If this template helps you build amazing voice AI applications, please star the repository!
