The Voice.GradientFlow agent runs as a standalone Python worker process using the LiveKit Agents Python SDK. When a user starts a Playground conversation, or a caller opens a share link, the app dispatches a job to the worker.

How it works

  1. The app creates a room with the agent configuration in the room metadata. Every participant in the room receives room metadata, so provider keys typed in Settings are left out of it
  2. It calls AgentDispatchClient.createDispatch() to dispatch the job to the registered Python worker. Those keys ride in the dispatch metadata, which only the worker’s job receives
  3. The browser receives a JWT and joins the room
  4. The worker picks up the job, reads the config from room metadata, puts the keys back, builds the LLM/TTS/STT instances, and starts the session

Running the worker

Start the Next.js app and the Python worker in separate terminals:
For production:
See Python Worker for full setup instructions and supported providers.

Deploying with Docker

See Docker Compose for running the worker alongside the web app in a container.