Docs index: /llms.txt · every page as Markdown: add .md

‹ Guides

Voice agent

A voice avatar on your own computer, with LiveKit running locally.

CLI 2.8.9Python 2.11.21

Everything except the voice model runs on your computer. LiveKit is an open-source real-time audio and video server: the voice agent and the avatar join one of its rooms, and your browser joins too. Here it is the stock livekit-server, OpenAI Realtime listens, thinks and speaks on your own OPENAI_API_KEY, and the bitHuman avatar renders on your CPU — no GPU needed.

The avatar name picks the model: wise-pup is Expression 2, sofia-ramirez is Essence 2, or pass your own agent code or avatar file. You need two secrets: your bitHuman API secret (both models refuse to render without it) and OPENAI_API_KEY.

Your machineYour browserlocalhost: your microphone, the avatar's videolivekit-serverthe room, on this machineThe agentrenders the avatar; the API secret stays hereOutsideOpenAI Realtimehears you andreplies, with yourkeybitHumancredential check andusage reportsspeechusage
A voice agent on your machine. Your browser, a local livekit-server and the agent all run on your machine; the agent renders the avatar from the reply's voice, and the API secret stays in its process. The agent sends your speech to OpenAI Realtime with your key, and sends bitHuman a credential check and usage reports with no audio, video, images or conversation text.

Use the CLI for a talking avatar with no code, Python for your own agent code, or the Python voice conversation for a desktop window with no LiveKit server.

With the CLI

The CLI starts livekit-server, the voice agent and the avatar, then opens its page in your browser.

# macOS (Apple silicon): installs livekit-server too
brew tap bithuman/bithuman https://gitlab.com/bithuman/sdk/homebrew-bithuman && brew install bithuman/bithuman/bithuman-cli
# Linux x86_64 or arm64: the download includes livekit-server
sudo apt install -y ffmpeg python3-venv            # Ubuntu/Debian; macOS gets both from brew
curl -fsSL https://install.bithuman.ai | sh

bithuman login                                   # opens your browser; in CI, export BITHUMAN_API_SECRET instead
export OPENAI_API_KEY="<your OpenAI key>"
bithuman run wise-pup                            # Expression 2; `bithuman run sofia-ramirez` for Essence 2

Expected output:

      http://127.0.0.1:8088/WISEPUP
  Opening your browser… (Ctrl-C to stop.)

The first run downloads the avatar and sets up the voice agent, which takes a minute or two and needs Python 3.11 or newer. Allow the microphone and say “hi”: the avatar answers, lip-synced, and stops when you talk over it. The voice settings are on CLI.

Pick the avatar

bithuman run <value>, or BITHUMAN_AVATAR=<value> in the Python example’s .env:

ValueYou get
wise-pupExpression 2, a sample avatar
sofia-ramirezEssence 2, a sample avatar
your agent code, e.g. A24EKJ8433your own avatar, downloaded with your API secret
a path to an avatar filea file you already have

Configuration

The Python example reads these from .env:

VariableDefaultWhat it does
BITHUMAN_MASTER_SECRET—Your API secret, passed to the plugin explicitly. Rendering is metered on it. It is named BITHUMAN_MASTER_SECRET, never BITHUMAN_API_SECRET, so the plugin cannot find it and copy it into the room; agent.py refuses to start while BITHUMAN_API_SECRET is set.
OPENAI_API_KEY—Your OpenAI key.
BITHUMAN_AVATARwise-pupWhich avatar (table above).
BITHUMAN_REALTIME_MODELgpt-realtime-2.1-miniThe OpenAI Realtime model.
BITHUMAN_VOICEcoralAny OpenAI Realtime voice.
BITHUMAN_INSTRUCTIONSa short assistant promptThe agent’s system prompt.
LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRETws://localhost:7880, devkey, secretYour LiveKit server (livekit-server --dev).

Cost: session time, talking or idle, bills bitHuman credits; OpenAI bills your own key (Pricing). Stops mid-sentence when you talk over it: Barge-in. Something wrong: Troubleshooting.

This section moved: docs.bithuman.ai/build/voice-agent/python#with-python

This section moved: docs.bithuman.ai/build/voice-agent/python#python-voice-conversation

This section moved: docs.bithuman.ai/build/voice-agent/python#requirements

This section moved: docs.bithuman.ai/build/voice-agent/python#get-the-code

This section moved: docs.bithuman.ai/build/voice-agent/python#run-it

This section moved: docs.bithuman.ai/build/voice-agent/python#how-it-works

This section moved: docs.bithuman.ai/build/barge-in

This section moved: docs.bithuman.ai/pricing

This section moved: docs.bithuman.ai/resources/troubleshooting#voice-agent