Realtime Voice Translation
Realtime Voice Translation with Cerebras AI + LiveKit
Experience ultra-fast realtime voice translation powered by Cerebras AI's inference and LiveKit's voice infrastructure. Translate conversations to any language in real-time with sub-second latency.
Prerequisites
You'll need three API keys:
- Cerebras API Key - Get yours at https://cloud.cerebras.ai
- OpenAI API Key - For speech-to-text (Whisper) and text-to-speech. Get it at https://platform.openai.com
- LiveKit Credentials - For WebRTC audio streaming
Getting LiveKit Credentials
Follow the complete setup guide at: https://inference-docs.cerebras.ai/integrations/livekit
Quick steps:
- Sign up at LiveKit Cloud
- Create a new project
- Go to Settings → Keys and generate an API key pair
- Copy your:
- LIVEKIT_URL (starts with
wss://) - LIVEKIT_API_KEY
- LIVEKIT_API_SECRET
- LIVEKIT_URL (starts with
Running the Translation Agent - Start Jupyter Notebook
Start a new terminal and run the following commands:
# Install Jupyter
pip3 install jupyter
Launch Jupyter with the correct Python kernel:
# Register the kernel
python3 -m ipykernel install --user --name=translation-agent --display-name="Python 3.12 (translation-agent)"
# Start Jupyter
jupyter notebook translation_agent.ipynb
Important: When you open the notebook, make sure to select the "Python 3.12 (translation-agent)" kernel from the kernel menu (top right).
Why Jupyter in a Browser?
Running Jupyter in a browser (not VS Code or other IDEs) ensures proper microphone access via the LiveKit widget. The browser's native WebRTC support provides the best experience for realtime voice interaction.
1. Install Dependencies
Run this cell to install the necessary packages (uncomment if needed).
2. Setup & Credentials
Set your API keys here. You can also use a .env file in the same directory.
4. Run the Agent
Run this cell to start the agent. It will display an embedded microphone widget.
How it works:
- An embedded audio widget appears below (microphone access is requested automatically)
- Click "Allow" when your browser asks for microphone permission
- Speak into your microphone - the agent will translate and respond
- To stop: interrupt this cell (Kernel → Interrupt) or restart the kernel
Note: This cell blocks until you stop it. The agent runs continuously while this cell executes.
5. Change Target Language (Optional)
To translate to a different language, change TARGET_LANGUAGE in cell 3 and re-run cells 3 and 4.
Supported languages:
- English
- Spanish (Español)
- German (Deutsch)
- French (Français)
- Italian (Italiano)
- Portuguese (Português)
- Japanese (日本語)
- Chinese (中文)