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
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.
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_* 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’sagent.py has the complete file.
agent.py
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
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 tosimli-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.
401meansSIMLI_API_KEYis wrong,400means the face ID wasn’t found, and429means 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_URLmust be reachable from the internet, notlocalhost. - The page says the avatar didn’t join: check that the agent is running, that
.envandfrontend/.env.localhold the sameLIVEKIT_*values, and thatLIVEKIT_AGENT_NAMEmatches 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 starton any server, or see LiveKit’s deployment guide. The page builds withnpm run buildand runs withnpm start, or deploys to any Next.js host.
Learn more
- The starter’s README: changing the face, model, voice and prompt
- LiveKit’s guide to Simli
- LiveKit Agents docs: tools, other models and more