Skip to content

Repository files navigation

LiveKit + Cartesia Python Voice Agent

Deploy a sandbox appLiveKit Agents DocsLiveKit CloudBlog

A basic example of a voice agent using LiveKit with Cartesia.

Dev Setup

Clone the repository and install dependencies to a virtual environment:

cd cartesia-livekit-voice-agent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Set up the environment by copying .env.example to .env.local and filling in the required values:

  • LIVEKIT_URL
  • LIVEKIT_API_KEY
  • LIVEKIT_API_SECRET
  • OPENAI_API_KEY
  • CARTESIA_API_KEY

You can also do this automatically using the LiveKit CLI:

lk app env

The easiest and quickest way to chat with the agent is via the console:

python3 agent.py console

You can also run it with a frontend. For that, run the agent:

python3 agent.py dev

Then use a frontend application to communicate with the agent. Some examples of frontends are available in livekit-examples. You can also create your own frontend following one of the client quickstarts, or test instantly against one of LiveKit's hosted Sandbox frontends.

For more information, you can also checkout the Cartesia Plugin for LiveKit

About

Voice agent using LiveKit (orchestration), Cartesia (STT + TTS), and OpenAI (LLM)

Topics

Resources

Stars

26 stars

Watchers

4 watching

Forks

Used by

Contributors

Languages