Talk to GPT-OSS

3 months ago 1

Run a simple voice assistant with Python that uses gpt-oss for the LLM.

This guide walks you through the setup of talking to gpt-oss using LiveKit Agents for Python. In less than 2 minutes, you'll have a voice assistant that you can speak to in your terminal, browser, telephone, or native app.

The following sections describe the minimum requirements to get started.

LiveKit Agents requires Python 3.9 or later.

You need a LiveKit server instance to transport realtime media between user and agent. The easiest way to get started is with a free LiveKit Cloud account. Create a project and use the API keys in the following steps. You may also self-host LiveKit if you prefer.

Use the instructions in the following sections to set up your new project.

Install the following packages to build a complete voice AI agent with your STT-LLM-TTS pipeline, noise cancellation, and turn detection:

pip install \ "livekit-agents[assemblyai,groq,cartesia,silero,turn-detector]~=1.0" \ "livekit-plugins-noise-cancellation~=0.2" \ "python-dotenv"

Create a file named .env and add your LiveKit credentials along with the necessary API keys for your AI providers.

STT-LLM-TTS pipeline:

ASSEMBLYAI_API_KEY=<Your Deepgram API Key> GROQ_API_KEY=<Your OpenAI API Key> CARTESIA_API_KEY=<Your Cartesia API Key> LIVEKIT_API_KEY=%{apiKey}% LIVEKIT_API_SECRET=%{apiSecret}% LIVEKIT_URL=%{wsURL}%

Use the agent.py file in this repo.

You first need to download the model files for the turn-detector, silero, or noise-cancellation plugins:

python agent.py download-files

Start your agent in console mode to run inside your terminal:

Your agent speaks to you in the terminal, and you can speak to it as well.

Start your agent in dev mode to connect it to LiveKit and make it available from anywhere on the internet:

Use the Agents playground to speak with your agent and explore its full range of multimodal capabilities.

Congratulations, your agent is up and running. Continue to use the playground or the console mode as you build and test your agent.

💡 Agent CLI modes

In the console mode, the agent runs locally and is only available within your terminal.

Run your agent in dev (development / debug) or start (production) mode to connect to LiveKit and join rooms.

Follow these guides bring your voice AI app to life in the real world.


This document was rendered at 2025-08-05T23:20:56.508Z. For the latest version of this document, see https://docs.livekit.io/agents/start/voice-ai.md.

To explore all LiveKit documentation, see llms.txt.

Read Entire Article