bithuman
Run a bitHuman avatar on your own machine, in your own process.
pip install bithuman
DEMO=$(python -c 'import bithuman,os; print(os.path.join(os.path.dirname(bithuman.__file__), "assets", "demo_sample.wav"))')
python -m bithuman render sofia-ramirez "$DEMO" # -> sofia-ramirez.mp4
Two arguments — an avatar and some audio — and a video you can play (with
your API secret in BITHUMAN_API_SECRET; see the key). The
avatar is a showcase name (python -m bithuman list), your agent's ten-character
code (python -m bithuman list --mine; fetched once, which is free), or a file
you already have. The audio above is 15 s of speech that ships with this package,
so the first run needs nothing you do not already have. The commands are
spelled as in the separate bithuman CLI: render <avatar> <audio> [-o out.mp4] [--limit N] [--json] and list [--mine]. If you signed in with that CLI
(bithuman login, which this package does not install), the secret it saved is
read here too.
In your own program it is the same two things. The command above fetched the
avatar to ~/.cache/bithuman/showcase/:
import bithuman, os
speech = os.path.join(os.path.dirname(bithuman.__file__),
"assets", "demo_sample.wav") # 15 s, ships in the wheel
avatar_file = os.path.expanduser("~/.cache/bithuman/showcase/sofia-ramirez.imx")
avatar = bithuman.open(avatar_file)
frames = 0
for image in avatar.render(speech): # each image: (height, width, 3) uint8, RGB
frames += 1
print(frames, "frames")
That is the whole thing: open an avatar, then render audio through it.
both families, the same two lines
An essence-2 avatar and an expression-2 avatar are opened and rendered by the code above, unchanged. Nothing you write says which one you have, and you do not have to know.
expression-2 needs one extra package on the machine:
pip install "bithuman[expression-2]"
Open an expression-2 avatar without it and the refusal says so, and says that line. Nothing else differs.
offline rendering, without 3 GB of CUDA you will never run
bithuman[offline] adds torch and onnxruntime. From PyPI's default index that
resolves to the CUDA build of torch, and the extra costs 3.18 GB of
wheels — 2.45 GB of it nvidia-*, cuda-* and triton that the offline
route never executes. Install torch first from
PyTorch's own selector — choose the
Compute Platform without CUDA and run the one line it prints — and the
same extra then resolves to 0.18 GB, with no CUDA wheel in the set at all
(the extra asks for torch>=2.1, and any build satisfies it):
pip install "bithuman[offline]" # after torch, from the line the selector printed
(Measured 2026-09-19 on Linux x86_64 with pip install --dry-run --report:
49 wheels / 3.18 GB from the default index alone, 30 wheels / 0.18 GB with
PyTorch's CUDA-free index beside it. Use the default index only if you
actually want CUDA.)
The surface
| you write | it means |
|---|---|
bithuman.open(source) |
open the avatar file on this machine; returns an Avatar |
avatar.render(audio) |
yield the frames for that audio |
Avatar |
what open gives you |
AvatarError |
catch this for any refusal |
InvalidAvatar |
we cannot find it, or it is not a usable avatar |
NotSupported |
this avatar cannot run here |
NotAuthorised |
the key is missing, invalid, or out of credit |
Failed |
we could not do it — the message says which |
There is nothing to configure: this package runs the avatar on this machine.
For a live conversation, where audio arrives as it is spoken, use
AsyncBithuman (streaming below).
audio in
audio is 16 kHz mono, and it is either a buffer or a stream — the same call:
avatar.render(speech) # an audio file path
avatar.render(samples) # int16 or float32 in [-1, 1]
avatar.render(raw_bytes) # 16 kHz mono, signed 16-bit
avatar.render(microphone()) # any iterable of the above
frames out
Each frame is a (height, width, 3) uint8 array in RGB order, in order, at
the avatar's own frame rate, which is a property of the avatar, not something
to choose: 25 per second for Essence 2, 20 per second for Expression 2.
import cv2
for image in avatar.render(speech):
cv2.imshow("avatar", image[:, :, ::-1]) # OpenCV wants BGR
cv2.waitKey(1)
stopping early
Someone interrupting the avatar is "stop consuming and close the iterator":
images = avatar.render(speech)
for n, image in enumerate(images):
if n == 50: # e.g. the user started talking
images.close()
break
releasing it
with frees everything at the end of the block; without it, the avatar is
freed when it is garbage collected.
with bithuman.open(avatar_file) as avatar:
for image in avatar.render(speech):
frames += 1
streaming a live conversation
AsyncBithuman takes audio as it arrives and yields frames with their audio,
paced at the avatar's play rate:
from bithuman import AsyncBithuman # inside an async function:
avatar = await AsyncBithuman.create(model_path=avatar_file) # reads BITHUMAN_API_SECRET
await avatar.push_audio(pcm16_bytes, 16000, last_chunk=False) # as the audio arrives
await avatar.flush() # end of the reply
async for frame in avatar.run():
if frame.has_image:
show(frame.bgr_image) # BGR numpy array
if frame.audio_chunk:
play(frame.audio_chunk.array) # the audio that goes with this frame
await avatar.shutdown()
The full example is at https://docs.bithuman.ai/platforms/python/app.
The four refusals
Each one leads to a different fix, and none of them asks you to know anything about how we are built.
try:
avatar = bithuman.open(avatar_file)
for image in avatar.render(speech):
pass
except bithuman.InvalidAvatar:
... # fix the path or the code, or fetch the avatar again
except bithuman.NotSupported:
... # use the cloud package, or another device
except bithuman.NotAuthorised:
... # fix the credential
except bithuman.Failed:
... # retry, then report it
Every one of them is an AvatarError, so except bithuman.AvatarError catches
all four.
The key
Rendering is metered, and the key belongs in the environment rather than in your code:
export BITHUMAN_API_SECRET=...
Without one, render refuses with NotAuthorised before it hands you a
frame. Get a key at https://www.bithuman.ai/developer/api-keys.
python -m bithuman also reads a .env file in the current directory; that is
deprecated and will stop, so export the variable instead. What is already in
the environment always wins.
Where it runs
| Python | 3.10 – 3.14 |
| macOS | Apple silicon |
| Linux | x86-64 and arm64 |
| Windows | Windows 11, x86-64 (64-bit Python) |
| Intel Macs, Windows on Arm | no wheel — pip install refuses rather than quietly giving you an old release |
ffmpeg is used to read an audio file when it is on your PATH; when it is
not, the decoder this package already installs reads the same file in this
process, so it is not something to install first.
Two environment variables:
BITHUMAN_API_SECRET |
your API secret, from https://www.bithuman.ai/developer/api-keys — rendering is metered, so it is required unless you pass api_secret=. BITHUMAN_API_KEY is read as a deprecated alias |
BITHUMAN_CACHE_DIR |
where a prepared avatar is kept (default ~/.cache/bithuman) |
This package never puts a command on your PATH
pip install bithuman installs a library and nothing else — and
python -m bithuman is why that costs you nothing: a module needs no script,
cannot collide with one, and is there the moment pip finishes. The full
bithuman command-line tool (a live avatar, a conversation) is a different
artifact and is not installed with pip:
curl -fsSL https://install.bithuman.ai | sh
brew install bithuman-product/bithuman/bithuman-cli # macOS, equivalently
That is on purpose: a pip-installed command named bithuman would overwrite
the one the CLI installer or Homebrew put at the same path.
Using it from a LiveKit agent
The LiveKit integration is a separate package, livekit-plugins-bithuman,
published by LiveKit out of github.com/livekit/agents:
pip install livekit-plugins-bithuman "bithuman[expression-2]"
Do not give that plugin your account API secret. Up to and including
1.8.4, the plugin copies the secret it is given into the avatar's participant
attributes, which every participant in the LiveKit room can read. Keep the
secret on your server under another name (BITHUMAN_MASTER_SECRET), mint a
one-hour runtime token per session (POST /v1/runtime-tokens/mint) and pass
that token to the plugin instead. The worker is at
https://docs.bithuman.ai/platforms/livekit.
Licence
Proprietary — this package carries the runtime. See LICENSE.
Metadata
Release files for bithuman 2.11.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bithuman-2.11.20.tar.gz | 2.1 kB | Details |
Built distributions (wheels)
Total release size: 443.6 MB
Release files / bithuman-2.11.20.tar.gz
| Download URL | bithuman-2.11.20.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3d9e21e742a5ee02c80c170ead536444195cb56688e6869431d35dfbe455b9a
|
|
BLAKE2b-256 checksum How to use checksums |
3bd06d73c131936198e62e87b222934e960c4584535990d6d44063e2a8ef56b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp314-cp314-win_amd64.whl
| Download URL | bithuman-2.11.20-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 13.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
654a1cd715d52c09b12da0bb6fd31467b71b272d1a602098ab12aa4632611357
|
|
BLAKE2b-256 checksum How to use checksums |
8a996080ed58d583cee062393de63df00f7142f7626734ec344eae0fa47dfc86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.20-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
032461199533e2938024acd4b5610d7353282090a616d9aa7db3bdeb78ed9b47
|
|
BLAKE2b-256 checksum How to use checksums |
1af5f763a18e9a8508b96218cd594f029790abe52f59208f1461f20edcc65c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp314-cp314-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.20-cp314-cp314-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.3 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
378b0414b669267d19cf28ce445e25c6610d1c3a3983a5a6a903363cb9b468d9
|
|
BLAKE2b-256 checksum How to use checksums |
b19e77d52834c7d8c0bb9c0ba300b5eaeca9526b6241bcea268892e2d8e14e0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp314-cp314-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.20-cp314-cp314-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.14 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
acf036bdd46e1275c877fd26bdd2c5f460c0871ce02be75a9a6fa46ea06b0649
|
|
BLAKE2b-256 checksum How to use checksums |
51af0422e021d4e4213834e7f603ee78397d2ecd5cee10b6ccbebb555469f90a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp313-cp313-win_amd64.whl
| Download URL | bithuman-2.11.20-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 13.1 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dfdbd89600b5385518f694c1232bdaf23a685664196e80362e68bb827c934b87
|
|
BLAKE2b-256 checksum How to use checksums |
8b7334bd8170a12ae8764b77726e6deef501789e10d816334b78839f77576562
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.20-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
97340cd65df52878c421df1da9a749c9d6a2a41f39102db830d471140a5fafb7
|
|
BLAKE2b-256 checksum How to use checksums |
c5ec57d9d7b44034c1aa566133fe319c5de2fc69a20aa7b5e6ff10f7a231e594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp313-cp313-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.20-cp313-cp313-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.3 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
7ee67c4b7c085ff5bfa6f832a2d611bbd21696ded852e3aa57acc495b6dafdec
|
|
BLAKE2b-256 checksum How to use checksums |
9413a9b53aed350a83c7abc9d51f30818152be66b639066ef6c7c2218f13f8dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.20-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5078c4c4f08e46393a81e841ef7cf2ba329e39be3f06b7088e92eaf0deb680f0
|
|
BLAKE2b-256 checksum How to use checksums |
2110095fc156109e1bf4676d3bf0cff89c290356ff2e000b4dec2315573d67a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp312-cp312-win_amd64.whl
| Download URL | bithuman-2.11.20-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 13.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
96e17e213d5c2110df68d6354045a50922cdd89371df29714f98d03a9df08bb1
|
|
BLAKE2b-256 checksum How to use checksums |
f53723bd3f96eb2f84000b153be21da2181ad9610dea6b14b3eb305d1840353d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.20-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0d8b81e56e4426cc7e4f3041f1ab49270a9b2a82de803dbe538cac0912c603e9
|
|
BLAKE2b-256 checksum How to use checksums |
64e6e80f96a0b19fd3265f3cc0c3767705be35a8faa8e4ed550865841ff84493
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.20-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.3 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
910437f38b94378f83cbb543ce308a1a92b8a87f1d11559b816f5bab5fe240c9
|
|
BLAKE2b-256 checksum How to use checksums |
39a51cc62ead40422d4aaf7f4a73c42fc9c3fdd57a42775f7fc6044854a3d95d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.20-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
41c6c48ffbf3def9535a557d304fd09b37bac499999d12c5ce39b61c09cc0df5
|
|
BLAKE2b-256 checksum How to use checksums |
39baa43a607f7cdc75e1581a92a9f103d3a656bfb8cf3d9bfe241d4c0829f83e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp311-cp311-win_amd64.whl
| Download URL | bithuman-2.11.20-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 13.1 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7ac498707c4b7ce3dde9e81c85cfdf6e084d57c59a8f06655809c4eea391c1f3
|
|
BLAKE2b-256 checksum How to use checksums |
cbf2d76e9a25a63477445d6f70d97dc2023f38fccd2e1fcc8ef2f8b153b1469a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.20-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a2d51b54aef9b48f8a73c19c08757d20f9176a84ca3a8b373a05a0ce95d82900
|
|
BLAKE2b-256 checksum How to use checksums |
395b2aaf2de155f16171704f8596239676c2c3e7a8679d8504cff70bafa4a054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp311-cp311-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.20-cp311-cp311-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.3 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
cbf1efaf0580a909bc238edd4c20139af560b06198a119479208069b890de790
|
|
BLAKE2b-256 checksum How to use checksums |
9033e4ac43e5684d220090acaf003e5f2d6568de826cb7c81385de65f144fcc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.20-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
915f3fcde198d68d682425233851f8326c3ed01ee6528172cb61d7c53e568dd5
|
|
BLAKE2b-256 checksum How to use checksums |
ab934f5cd50c0ce6f97266702817d1e87242d38e1afaeaf9967dffe5aa2d5938
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp310-cp310-win_amd64.whl
| Download URL | bithuman-2.11.20-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 13.1 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b71b3bfba442df1c003cf42e5988711bd8b40297a9645dd01b298fe7014290c8
|
|
BLAKE2b-256 checksum How to use checksums |
c6a57292896b7721e6368c0a892b8ac833a9a863d33e9d78127248eabd7e4569
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.20-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2c44442fee9331245c9f35e4c701e6d9a5eb3978e7965ea54fc25488afd97ca2
|
|
BLAKE2b-256 checksum How to use checksums |
50eaafc2d053177fa39a11841d0d8d7b930e6a867eb6cb4a6985fbacf0a63c01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp310-cp310-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.20-cp310-cp310-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
687c6ac7d8cda972244a55932f560c83e6e16cf4a8171e09b5cb6f1533928676
|
|
BLAKE2b-256 checksum How to use checksums |
2d85d9e9480f397b6dcf2de98d2a9408fde790332730db70e627fb03ed092c50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / bithuman-2.11.20-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.20-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.4 MB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c3f39d0639a7a0b3bb0e0c09bb50a46753a1b951b8d9c5db23d1a65cc3ac41fe
|
|
BLAKE2b-256 checksum How to use checksums |
56c8b3acd0fb8db69070104912e106ae537b8f058aa3e5aa359ac910d6bb217a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|