A full-stack voice AI application built with LiveKit Agents, Next.js, and Rime TTS. Real-time voice conversations powered by GPT-5.2, 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.ai- (LLM and STT use LiveKit Inferenceβbilled via LiveKit Cloudβso OpenAI and AssemblyAI keys are not required.)
-
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-5.2 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-5.2 + Rime + AssemblyAI via LiveKit Inference)
β βββ 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)
- Rime API key for TTS (LLM and STT use LiveKit Inference; no OpenAI or AssemblyAI keys needed)
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-5.2 (via LiveKit Inference) - Language model
- AssemblyAI (via LiveKit Inference) - 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
# Required for TTS (Rime)
RIME_API_KEY=... # Get from https://rime.ai/
# Optional: only if you switch from LiveKit Inference to provider plugins
# OPENAI_API_KEY=... # For OpenAI plugin (LLM)
# ASSEMBLYAI_API_KEY=... # For AssemblyAI plugin (STT)1. Agent won't start:
# Ensure LiveKit and Rime keys are set (OpenAI/AssemblyAI optional when using LiveKit Inference)
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