A complete voice conversation pipeline built with LiveKit, OpenAI, and Rime. This project demonstrates how to wire together a full STT → LLM → TTS loop to create natural, bidirectional voice conversations, and serves as a practical starting point for building your own voice agents on LiveKit.
flowchart LR
User(["🎙️ User"])
subgraph LiveKit Room
direction LR
VAD["Voice Activity\nDetection\n(Silero)"]
STT["Speech-to-Text\n(OpenAI Whisper)"]
LLM["Large Language\nModel\n(OpenAI GPT-4o)"]
TTS["Text-to-Speech\n(Rime Arcana)"]
NC["Noise\nCancellation\n(BVC)"]
end
Speaker(["🔊 Speaker"])
User -->|"raw audio"| NC
NC --> VAD
VAD -->|"speech segments"| STT
STT -->|"transcript"| LLM
LLM -->|"response text"| TTS
TTS -->|"synthesised audio"| Speaker
| Service | Purpose | Link |
|---|---|---|
| LiveKit Cloud | Room infrastructure + API credentials | cloud.livekit.io |
| OpenAI | STT (Whisper) + LLM (GPT-4o) | platform.openai.com |
| Rime | Text-to-Speech | app.rime.ai/tokens |
git clone https://github.com/your-org/livekit-agent.git
cd livekit-agentbrew install uv # macOS (skip if already installed)Copy the example env file and fill in your credentials:
cp .env.local .envOpen .env and set the following:
LIVEKIT_URL=wss://<your-project>.livekit.cloud
LIVEKIT_API_KEY=<your-livekit-api-key>
LIVEKIT_API_SECRET=<your-livekit-api-secret>
OPENAI_API_KEY=<your-openai-api-key>
RIME_API_KEY=<your-rime-api-key>LiveKit - cloud.livekit.io
- Sign up or log in
- Go to Settings → API Keys
- Generate an API key + secret and copy your project WebSocket URL
OpenAI - platform.openai.com/api-keys
- Sign up or log in
- Go to Dashboard → API Keys → Create new secret key
Rime - app.rime.ai/tokens
- Sign up or log in
- Generate a new API token from the dashboard
uv run main.py download-filesuv run main.py consoleRuns the full pipeline in your terminal. Speak into your microphone and the agent will respond over your speakers. Great for rapid iteration without needing a cloud room.
uv run main.py devRegisters the agent as a worker against your LiveKit project. Join the room from the LiveKit Playground or any LiveKit-compatible client to test end-to-end.
uv run main.py startRuns the agent in production mode, ready to handle concurrent rooms at scale.