A real-time voice conversation playground for Google's Gemini 2.0 API, built with Nuxt 3 and LiveKit. This project enables seamless voice communication with AI using advanced multimodal capabilities.
- 🎙️ Real-time voice conversation with Gemini 2.0
- 📝 Audio transcription and visualization
- 🎭 AI personality presets for different conversation styles
- 🔐 Secure API key management
- 📱 Responsive design with mobile support
- ⚡ LiveKit WebRTC for low-latency audio streaming
- Node.js 18+ or Bun
- Python 3.8+ with uv package manager
- Google AI API key with Gemini 2.0 access
- LiveKit Cloud account (for real-time voice features)
This project uses Bun as the package manager:
# Clone the repository
git clone <repository-url>
cd realtime-playground-nuxt
# Install dependencies
bun install
Create a .env
file in the root directory:
# Google AI API Configuration
GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key_here
# LiveKit Configuration (optional for local development)
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret
LIVEKIT_URL=wss://your-livekit-url
The project includes a Python-based LiveKit agent for handling real-time voice communication. Set it up separately:
# Navigate to the agent directory
cd agent
# Install Python dependencies using uv
uv sync
# Create a .env file in the agent directory
cat > .env << EOF
LIVEKIT_URL=wss://your-livekit-url
LIVEKIT_API_KEY=your_livekit_api_key
LIVEKIT_API_SECRET=your_livekit_api_secret
EOF
# Start the agent in development mode
uv run --env-file .env python main.py dev
Start the Nuxt development server:
bun dev
Open http://localhost:3000 in your browser.
-
Google AI API Key:
- Visit Google AI Studio
- Create a new API key
- Ensure you have access to Gemini 2.0
-
LiveKit (Optional):
- Sign up at LiveKit Cloud
- Create a project and get your API credentials
- Enter your Google AI API key in the application
- Select an AI personality preset or create a custom one
- Click "Start Conversation" to begin voice chat
- Speak naturally - the AI will respond in real-time
Edit the preset configurations in the application to:
- Change AI personality traits
- Modify response styles
- Set conversation contexts
- Adjust voice characteristics
- Framework: Nuxt 3 with Vue 3 Composition API
- State Management: Pinia stores
- UI Components: shadcn/ui with Tailwind CSS v4
- Real-time: LiveKit SDK for WebRTC connections
- API: Nuxt server routes for LiveKit token generation
# Start development server
bun dev
# Build for production
bun run build
# Run linting
bun run lint
# Check code formatting
bun run format:check
# Preview production build
bun run preview
├── agent/ # Python LiveKit agent
│ ├── main.py # Agent entry point
│ ├── .env # Agent environment variables
│ └── .venv/ # Python virtual environment
├── components/ # Vue components
├── composables/ # Vue composables and utilities
├── stores/ # Pinia state management
├── server/ # Nuxt server API routes
├── plugins/ # Nuxt plugins
├── assets/ # Static assets and styles
├── public/ # Public static files
└── data/ # Application data and configurations
# Build and deploy
bun run build
Deploy the .output
directory to Vercel or your preferred hosting platform.
# Build Docker image
docker build -t gemini-playground .
# Run container
docker run -p 3000:3000 gemini-playground
Variable | Description | Required |
---|---|---|
GOOGLE_GENERATIVE_AI_API_KEY |
Google AI API key for Gemini access | Yes |
LIVEKIT_API_KEY |
LiveKit API key | No* |
LIVEKIT_API_SECRET |
LiveKit API secret | No* |
LIVEKIT_URL |
LiveKit server URL | No* |
*LiveKit credentials are optional for local development but required for production deployment.
- Audio not working: Ensure microphone permissions are granted
- Connection failed: Check API keys and network connectivity
- Build errors: Verify all dependencies are installed with
bun install
Some dependencies may need updates:
@livekit/components-core
- check for latest version@troisjs/trois
- may need Vue 3 compatible alternativevue-syntax-highlighter
- may need replacement
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.