Skip to main content
Complete chatbot with avatar that users can talk to on the web.

Quick Start

1

Install

pip install bithuman --upgrade livekit-agents openai
2

Get accounts

3

Set environment

export BITHUMAN_API_SECRET="your_secret"
export BITHUMAN_MODEL_PATH="/path/to/model.imx"
export OPENAI_API_KEY="your_openai_key"
export LIVEKIT_API_KEY="your_livekit_key"
export LIVEKIT_API_SECRET="your_livekit_secret"
export LIVEKIT_URL="wss://your-project.livekit.cloud"
4

Setup web interface

git clone https://github.com/livekit/agents-playground.git
cd agents-playground
npm install && npm run dev
5

Run agent

View source code on GitHub
python examples/agent-livekit-openai.py dev
6

Open browser

Go to http://localhost:3000 and join a room to chat.

What It Does

  1. User speaks in browser
  2. AI processes speech and responds intelligently
  3. Avatar shows AI’s response with dynamic movement
  4. Works from any device with internet
Built with:
  • OpenAI GPT-4 for intelligent conversation
  • LiveKit for web streaming
  • bitHuman for avatar animation

Run Modes

ModeUse CaseDescription
devProductionConnects to LiveKit for web browsers
consoleTestingRuns in terminal for debugging

Customization

Change the agent’s personality by editing the instructions:
agent=Agent(
    instructions=(
        "You are a helpful customer service assistant. "
        "Be friendly, professional, and solve problems quickly."
    )
)
Example personalities:
  • Tech Support: “You are a patient tech expert who explains things simply”
  • Sales Assistant: “You are an enthusiastic product advisor”
  • Teacher: “You are an encouraging tutor who makes learning fun”

Common Issues

ProblemSolution
Agent won’t startCheck all API keys are set
No audio in browserAllow microphone permissions, try Chrome
Can’t connectCheck LiveKit URL format: wss://your-project.livekit.cloud

Next Steps