A full-stack voice AI application built with LiveKit Agents, Next.js, and Rime TTS. Real-time voice conversations powered by GPT-4.1 Mini, with high-quality TTS and advanced speech recognition.
Deploy to production on Render with auto-scaling. Develop locally with Docker.
- Deploy to Production (Render)
- Features
- Repository Structure
- Local Development with Docker
- Local Docker Commands
- Customization
- Environment Variables
- Troubleshooting
- Additional Documentation
- Contributing
- License
This project is pre-configured for production deployment to Render using the included render.yaml blueprint.
What you get:
- ✅ Next.js web app with voice UI
- ✅ LiveKit voice agent service
- ✅ Auto-scaling and health checks
- ✅ Separate app and agent services
- ✅ Environment variable management
Deployment steps:
-
Fork this repository to your GitHub account
-
Set up LiveKit Cloud:
- Sign up at LiveKit Cloud
- Create a new project
- Get your API key, secret, and WebSocket URL
-
Create environment variable group on Render:
- Go to Render Dashboard
- Create an environment group with these variables:
LIVEKIT_API_KEY- Your LiveKit API keyLIVEKIT_API_SECRET- Your LiveKit API secretLIVEKIT_URL- Your LiveKit WebSocket URLRIME_API_KEY- Get from Rime.aiOPENAI_API_KEY- Get from OpenAIASSEMBLYAI_API_KEY- Get from AssemblyAI
-
Create a new Blueprint Instance on Render:
- Click "New" → "Blueprint Instance"
- Connect your forked repository
- Select branch (usually
main) - Select the environment group you created
-
Deploy:
- Click "Apply" to create all services
- Render will:
- Build and deploy Next.js app
- Build and deploy LiveKit agent
- Link services together
-
Access your deployed app:
- Web App:
https://your-app-name.onrender.com - Agent will auto-connect via LiveKit Cloud
- Web App:
Important: Agent Resource Requirements
On Render, use the Standard plan or higher for the agent worker service. The included render.yaml is already configured with auto-scaling and health checks for production workloads.
- 🎙️ Real-time Voice Conversations - Natural voice interactions powered by LiveKit
- 🧠 Smart AI Agent - Uses GPT-4.1 Mini for intelligent responses
- 🗣️ High-Quality TTS - Rime TTS with multiple voice options
- 🎧 Advanced STT - AssemblyAI for accurate speech recognition
- 🔇 Noise Cancellation - Built-in background noise reduction
- 🚀 Production-Ready Deployment - Pre-configured for Render with auto-scaling and Docker
render-voice-agent/
├── agent/ # LiveKit voice agent
│ ├── agent.ts # Agent implementation (GPT-4.1 + Rime + AssemblyAI)
│ ├── AGENT_README.md # Agent configuration and customization
│ ├── Dockerfile # Production agent container
│ └── Dockerfile.dev # Development agent container
├── app/ # Next.js application
│ ├── api/ # API routes (LiveKit token generation)
│ ├── components/ # React components
│ │ └── VoiceAgent.tsx # Voice UI component
│ ├── page.tsx # Main application page
│ └── globals.css # Global styles
├── docker-compose.yml # Full-stack local development (app + agent)
├── render.yaml # Production deployment configuration (Render.com)
├── package.json # Dependencies and scripts
└── README.md
Requirements for local development:
- Docker & Docker Compose
- At least 8 GB of RAM available for the agent (for AI model loading)
- Node.js 20 or higher (optional, for running without Docker)
- LiveKit Cloud account (sign up)
- API keys for Rime, OpenAI, and AssemblyAI
Local setup:
- Clone the repository:
git clone <your-repo-url>
cd render-voice-agent- Set up LiveKit Cloud credentials:
# Authenticate with LiveKit Cloud
lk cloud auth
# Generate credentials and save to .env
lk app env -wThis creates a .env file with:
LIVEKIT_API_KEY=...
LIVEKIT_API_SECRET=...
LIVEKIT_URL=wss://...- Add additional API key to
.env:
RIME_API_KEY=your-rime-api-key- Start all services locally with Docker:
docker-compose upThis will:
- ✅ Automatically download AI model files during first build
- ✅ Start Next.js app on localhost:3000
- ✅ Start LiveKit voice agent
☕ First time? The initial build takes 2-3 minutes to download AI models.
- Access your local application:
Open http://localhost:3000 in your browser and start a voice conversation!
Ready for production? See Deploy to Production (Render) above.
Start all services locally:
docker-compose up -dStop all local services:
docker-compose downView local logs:
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f app
docker-compose logs -f agentRebuild after code changes:
docker-compose up -d --buildAlternative: Run without Docker (local development):
# Step 1: Install dependencies and download AI models
npm install
npm run agent:download
# Step 2 (Terminal 1): Run the Next.js app
npm run dev
# Step 3 (Terminal 2): Run the LiveKit agent
npm run agent:devEdit agent/agent.ts:
tts: new TTS({
model: 'mistv2',
voice: 'lagoon', // Try: rainforest, lagoon, astra
}),Available voices: rainforest, lagoon, astra, and more. See Rime TTS docs.
Update the instructions in the Assistant class in agent/agent.ts:
instructions: `You are a friendly and helpful voice assistant...`Frontend:
- Next.js 16 - React framework
- LiveKit Components React - Pre-built voice UI components
- Tailwind CSS - Styling
Agent:
- LiveKit Agents - Voice agent framework
- Rime TTS - Text-to-speech
- OpenAI GPT-4.1 Mini - Language model
- AssemblyAI - Speech-to-text
- Silero VAD - Voice activity detection
Infrastructure:
- Docker - Containerization
- Render - Cloud hosting
- LiveKit Cloud - Real-time communication platform
Required environment variables (.env):
# LiveKit Cloud (get with: lk cloud auth && lk app env -w)
LIVEKIT_API_KEY=...
LIVEKIT_API_SECRET=...
LIVEKIT_URL=wss://...
# API Keys
RIME_API_KEY=... # Get from https://rime.ai/
OPENAI_API_KEY=... # Get from https://platform.openai.com/api-keys
ASSEMBLYAI_API_KEY=... # Get from https://www.assemblyai.com/1. Agent won't start:
# Ensure all API keys are set
cat .env
# Download model files
npm run agent:download
# Check LiveKit Cloud authentication
lk cloud auth2. No audio in browser:
- Ensure microphone permissions are granted
- Check browser console for errors (F12)
- Verify LiveKit Cloud connection in network tab
- Try a different browser (Chrome recommended)
3. Local Docker build fails:
# Ensure Docker is running
docker ps
# Try rebuilding from scratch locally
docker-compose build --no-cache
# Check local Docker logs
docker-compose logs agent4. Local Docker port conflicts:
# Check what's using the port
lsof -i :3000
# Change port in docker-compose.yml if needed5. Agent connection errors:
- Verify LIVEKIT_URL is correct (should start with
wss://) - Check LiveKit Cloud project is active: https://cloud.livekit.io/
- Ensure API keys match the LiveKit project
- Check agent logs:
docker-compose logs agent
6. API key errors:
- Verify all API keys are valid and active
- Check API key permissions and quotas
- Ensure keys are properly set in
.env - For Render deployment, verify environment variables are set in the Render dashboard
Getting more help:
- Local development: Check logs with
docker-compose logs <service-name> - Production issues: Check the Render dashboard for logs and metrics
- Verify all environment variables are set correctly (
.envlocally, Render dashboard for production) - See detailed troubleshooting in
QUICK_START.md - Join the LiveKit Discord community
QUICK_START.md- Comprehensive local development guide with Dockeragent/AGENT_README.md- Agent configuration and customization- Render Documentation - Production deployment guides
External Resources:
Contributions are welcome! Please feel free to submit a Pull Request.
MIT