Skip to main content
LiveKit Agents is LiveKit’s open-source Python framework for voice AI agents. With the Simli plugin, a Simli avatar joins the agent’s LiveKit room: the agent sends it its voice, and the avatar publishes lip-synced video and voice on the agent’s behalf, so any LiveKit frontend shows them as the agent’s.

What you need

  • A LiveKit server that’s reachable from the internet: a LiveKit Cloud project (the free tier works), or a self-hosted LiveKit server with a public address. You need its URL, API key and API secret.
  • A Simli API key, from your Simli dashboard
  • A key for your model provider. The starter uses OpenAI’s Realtime API, so an OpenAI API key is all it needs: there’s no separate speech-to-text or text-to-speech provider.
  • Python 3.10 or later (the starter uses uv), and Node.js 20.9 or later for the starter’s web page
A LiveKit server running on your own machine (localhost, or livekit-server --dev) won’t work. Simli’s servers join your room from the internet, so LIVEKIT_URL must be reachable from the internet: use LiveKit Cloud, or a self-hosted server with a public address.

Run the starter

create-simli-app-livekit-agents

A LiveKit Agents voice agent on OpenAI’s Realtime API, with a Simli Trinity-2 avatar and a small web page to talk to it. Its lockfile pins the versions it was tested with.
In a second terminal, start the web page. Its token route reads the LiveKit key and secret on the server, so they never reach the browser.
Open http://localhost:3000, click Start and allow the microphone. The avatar greets you once it’s ready. The agent registers as simli-agent and only joins rooms whose token dispatches it by that name, as the page’s token does, so other agents in your LiveKit project don’t join too. To rename it, set LIVEKIT_AGENT_NAME in both .env and frontend/.env.local. LiveKit’s Agents Playground works too: connect it to your project and set Agent name to simli-agent.

Build it yourself

1. Install the packages

2. Set your keys

Put them in a .env file next to your agent:
.env
The Simli plugin reads the LIVEKIT_* values too: it gives the avatar a token to join the room.

3. Add the avatar to your agent

This is the core of the starter’s agent. The starter’s agent.py has the complete file.
agent.py
The order matters: connect, start the avatar, wait for it to join, and only then start the session and greet. Audio the agent sends before the avatar is ready is lost.
This gives a Trinity-2 face Simli’s default 768x768 video. For a 16:9 video, the avatar’s position, a starting camera or your own background, see Trinity-2 in LiveKit Agents and Pipecat (temporary).

4. Run it

Both connect to your LiveKit project and wait. The agent joins a room, and starts a Simli session, when the room’s token dispatches it by name: simli-agent, or your LIVEKIT_AGENT_NAME. python agent.py console talks to the agent in your terminal instead. It’s voice only, with no avatar, since there’s no LiveKit room. The starter’s agent handles that case. The LiveKit CLI can also run the same agent.py, with lk agent dev and lk agent console.

5. Talk to it

Use the starter’s web page, LiveKit’s Agents Playground with Agent name set to simli-agent, or any LiveKit agent frontend whose token dispatches that name, such as agent-starter-react. The avatar’s video arrives as the agent’s video.

Troubleshooting

  • The Simli avatar didn’t start: the Simli error logged just before says why. 401 means SIMLI_API_KEY is wrong, 400 means the face ID wasn’t found, and 429 means your Simli account is already running as many sessions as it can.
  • The Simli avatar didn’t join the room: usually Simli couldn’t reach your LiveKit server. LIVEKIT_URL must be reachable from the internet, not localhost.
  • The page says the avatar didn’t join: check that the agent is running, that .env and frontend/.env.local hold the same LIVEKIT_* values, and that LIVEKIT_AGENT_NAME matches in both if you set it.

Before you go to production

  • Anyone who can join a room in your LiveKit project starts a conversation, which uses your Simli minutes and model credit. The starter page’s token route hands a token to anyone who opens the page, so put it behind your own sign-in before you deploy it.
  • The avatar leaves the room as soon as its agent does, so ending the agent’s session, or deleting the room, ends the Simli session and its billing. A brief network blip on the agent’s side doesn’t count: LiveKit resumes the connection.
  • To deploy the agent, run python agent.py start on any server, or see LiveKit’s deployment guide. The page builds with npm run build and runs with npm start, or deploys to any Next.js host.

Learn more