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 Cloud project: the free Build plan works, with no card required. You need its URL, API key and API secret. The starter runs its models on LiveKit Inference: Deepgram Nova-3 for speech-to-text, Gemma 4 31B as the LLM and Cartesia Sonic 3.5 for text-to-speech. The LiveKit project’s credentials pay for them, so there are no OpenAI, Deepgram or other model keys.
  • A Simli API key, from your Simli dashboard. The free plan works.
  • 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. LiveKit Inference also runs only on LiveKit Cloud, so the starter needs a LiveKit Cloud project. The Simli plugin itself works with a self-hosted server with a public address too, if your agent brings its own model plugins and keys.
On the free plans, LiveKit’s Build plan includes $2.50 of LiveKit Inference credit a month, and Simli’s free plan 50 avatar minutes a month and 1 session at a time. The starter’s README has the details.

Run the starter

create-simli-app-livekit-agents

A LiveKit Agents voice agent on LiveKit Inference, 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
LiveKit Inference bills the models to the project in these LIVEKIT_* values. The Simli plugin reads them 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.

Trinity-2 options

This gives a Trinity-2 face Simli’s default 768x768 video. From livekit-plugins-simli 1.8.10, SimliConfig also takes Trinity-2’s options, and sends them only when you set them. For a 16:9 video with the avatar at the bottom centre:
The fields are streaming_width, streaming_height, avatar_position_x, avatar_position_y, camera, and background_id and foreground_id. Set max_idle_time yourself: the plugin’s default is 30 seconds. On an older plugin, upgrade, or see Trinity-2 in LiveKit Agents and Pipecat.

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, but it still needs the LIVEKIT_* values for LiveKit Inference. 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 avatar appears but never answers, and the agent logs STT, LLM or TTS errors: LiveKit Inference refused the request. Check that LIVEKIT_API_KEY and LIVEKIT_API_SECRET belong to the project in LIVEKIT_URL, and whether this month’s Inference credit is used up.
  • 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 LiveKit Inference credit. The starter page’s token route has no sign-in, so a production build refuses to hand out tokens (403) until you add your own sign-in, or set ALLOW_UNAUTHENTICATED_SESSIONS=true for a demo.
  • 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