bithuman
Run a bitHuman avatar on your own machine, in your own process.
pip install bithuman
python -m bithuman A63GVG1577 speech.wav # -> A63GVG1577.mp4
Two arguments — an avatar and some audio — and a video you can play. The
avatar is the ten-character code the service gave it (fetched once, which is
free) or a file you already have. Run python -m bithuman with no arguments
to list the avatars your key can open.
No audio to hand? This package ships 15 s of speech, so the first run needs nothing you do not already have:
python -m bithuman A63GVG1577 "$(python -c 'import bithuman,os;print(os.path.join(os.path.dirname(bithuman.__file__),"assets","demo_sample.wav"))')"
python -m bithuman --help prints that path on your machine.
In your own program it is the same two things:
import bithuman, os
speech = os.path.join(os.path.dirname(bithuman.__file__),
"assets", "demo_sample.wav") # 15 s, ships in the wheel
avatar = bithuman.open("A63GVG1577.imx")
for image in avatar.render(speech):
show(image)
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 — eight names
| 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 else, and nothing to configure. This package runs the avatar on this machine, so there is no choice left about where or how it runs.
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. (This line read "one per 40 ms of speech" until 2026-09-06, which
was true of every avatar the package could open at the time and is not true of
an expression-2 one.)
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":
frames = avatar.render(speech)
for image in frames:
if interrupted:
frames.close()
break
show(image)
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("A63GVG1577.imx") as avatar:
for image in avatar.render(speech):
show(image)
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(source)
for image in avatar.render(audio):
show(image)
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 beside you, which is where a key
usually already is. 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, Intel Macs | not built — pip install refuses loudly 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://raw.githubusercontent.com/bithuman-product/homebrew-bithuman/main/install.sh | sh
brew install bithuman-product/bithuman/bithuman-cli # macOS, equivalently
That is an invariant, not an accident: a pip-installed command named
bithuman would overwrite the one Homebrew put at the same path, and every
check would still report success. tests/test_no_console_script.py fails if a
release ever grows one — on every push and pull request (the source side,
with three firing controls) and again inside each publish job, run directly
against the wheels being uploaded. A directory that is declared and holds no
bithuman wheel exits 2: a publish that cannot be graded is refused, not
passed.
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. Install pillow
beside it:
pip install livekit-plugins-bithuman pillow
That plugin imports PIL.Image at module scope and its published metadata does
not declare pillow, so installing it on its own ends at
ModuleNotFoundError: No module named 'PIL' the first time you import it. The
metadata is upstream's, not ours — this line is the whole fix, and
the deploy guide carries it
too.
On Python 3.10 and 3.14 there is a second one, and pillow alone does
not clear it. That plugin declares bithuman behind a
python_version >= "3.11" and python_version < "3.14" marker, so on those two
interpreters pip reports success and installs no bithuman at all — which takes
cv2 with it, and the import dies there instead. This package publishes cp310
and cp314 wheels that install and import cleanly, so name it yourself:
pip install livekit-plugins-bithuman pillow bithuman # Python 3.10 / 3.14
Both workarounds have an expiry: pillow and the dropped marker are already
merged upstream in
livekit/agents#7280 and are
waiting on a plugin release. A release after that commit needs neither word.
Coming from 2.10.0?
3.0.0 is a clean break. Thirty-two names became eight, and fourteen error classes became four.
| if you see | do this |
|---|---|
cannot import name 'AsyncBithuman' (or Bithuman, AudioChunk, VideoFrame, VideoControl) |
bithuman.open(...) and avatar.render(audio) replace all of them |
cannot import name 'Fixture' (or Runtime, EP_AUTO, ComposedFrame) |
same: they were the layer under render, and there is no layer to reach for now |
no module named 'bithuman.api' (or .models, .exceptions, .config, .bhci) |
the values they held are gone from the surface; the four refusals replace the error classes |
a DeprecationWarning when you import the 2.x offline-render module |
it still works until 4.0.0; the warning names the module and the class names to write instead (bithuman.offline, OfflineRenderer, OfflineRenderError) |
module 'bithuman' has no attribute '__version__' |
importlib.metadata.version("bithuman") |
| you install the 2.x extra for offline rendering | it still installs the same three packages until 4.0.0; the extra is now bithuman[offline] |
| your frames look blue | frames are RGB now, not BGR — image[:, :, ::-1] if you feed OpenCV |
except BithumanError never fires |
except bithuman.AvatarError |
Frames are still (height, width, 3) uint8 arrays, still 25 per second, still
in order.
2.10.0 is on PyPI forever and keeps resolving exactly as it does today. Pin
bithuman<3 to stay on it.
Licence
Proprietary — this package carries the runtime. See LICENSE.
Release files for bithuman 2.11.7
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.7.tar.gz | 2.1 kB | Details |
Built distributions (wheels)
Total release size: 378.7 MB
Release files / bithuman-2.11.7.tar.gz
| Download URL | bithuman-2.11.7.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46d81cb41e8f3fe93f05955d0a0fe7a872f1266db4ec59dd5d8c4e4f53c694be
|
|
BLAKE2b-256 checksum How to use checksums |
d3d8876a0749deab86613605bf7921096bda93ad54f0c07e002cd7daeccdbbd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.7-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6bed2b11d193578298011840cbe179a4df494d4b94171f9bf2d802d55d443a2d
|
|
BLAKE2b-256 checksum How to use checksums |
b87474814cde656f2f0f070b7b3311a5677819184f1835f7789287b0a9b4010e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp314-cp314-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.7-cp314-cp314-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
8fe2f04a34e8a5e32f072ce5ae9dbbb247dba1b2259394937a637e9c5aa1bac5
|
|
BLAKE2b-256 checksum How to use checksums |
f8a500b91d3bda76f77fdd967b434988540a319aad80e7c2034b9115830a9669
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp314-cp314-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.7-cp314-cp314-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.9 MB |
| Tags | CPython 3.14 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1950b3c4aac0b29c98948a3b5d69733925e01fdd4dc9d4ba393258240c9d6fed
|
|
BLAKE2b-256 checksum How to use checksums |
d084385b7919074bc7d5997bfe4029db50e98315920f0ee8e0ab7d073124fbc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.7-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dcfa8358b5bbf9e569fcdbf36028121165b41b6a364debd09281956609f11694
|
|
BLAKE2b-256 checksum How to use checksums |
ec4dc94993796b87a83837d074f9e1e492fbf529f306a5f6cc988dc24620efcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp313-cp313-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.7-cp313-cp313-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
58bff272b7063d504d284fe0ab4727de2746d6e904e25d56dc6ea372974c4f9a
|
|
BLAKE2b-256 checksum How to use checksums |
089a6a323df0bef5fc25e832c7b04c084abcca1fbb2a1c3ad2c4974ce35f4f85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.7-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.9 MB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2d52440a7ee1151d6da9a14210ed253f4bd6bc96c1a128372bf4b09ec25704d3
|
|
BLAKE2b-256 checksum How to use checksums |
bb9f207bd06a81904c4c9f09ab9e8d03bc8ff6c9092ab7fcda7f832dd3416a60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.7-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d444cf3ccbb5ce0fbb9ab173b02970a34e2798ba0229b33bcd0a68c727b0cad5
|
|
BLAKE2b-256 checksum How to use checksums |
e5c09b685b0e3977dffbfec54eb8d89c1277b93949893aa185e43f305c13fc9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.7-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
c27fca162be4d65f9e340ec368162724bb531e85d601ace712e124c031e604af
|
|
BLAKE2b-256 checksum How to use checksums |
bbe57eb5d70fd8e6df9c45c9b57f2a054508d13ad277934859a5d944bac60c3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.7-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.9 MB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5347fbd68665de0a6b0c4b92698c7f562adc712c7962cf001d516fbbc4e8b68a
|
|
BLAKE2b-256 checksum How to use checksums |
9a52776c5946fd228ca8ae7aff0c051977e8c12f46be501b0fc2f5ccc492a5c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.7-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f918be04ed024ace0ec5753cd1b3a2e0f2d743ecfeec9ea70ca144a20f3deda8
|
|
BLAKE2b-256 checksum How to use checksums |
6adabc5d9dafd0e20bf9af6835d807a69f16d92b0770819b9f2fb04f56fa3ab8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp311-cp311-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.7-cp311-cp311-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
662fe1b1d4012e0a5fd40a2ac921cc8d32b12a131dbc0e88ef7c2052bfec8ecc
|
|
BLAKE2b-256 checksum How to use checksums |
42b4c3ceaac0688bad39cd5c13422991509d009231df5a3156ce8b6953648f6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.7-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.9 MB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
af7df471dba72e4f0ebc547d24ade6f7f0540c0ee7ccaa18534a5cf0c9b64696
|
|
BLAKE2b-256 checksum How to use checksums |
1af019ad3c6562fceded5f2995564901b8e53d90122aa59fe5ae724ddc38ad8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | bithuman-2.11.7-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a1aa4e2eecec89b62ab1b5f906bdb0d537c8d1ce303d7979fc939a4ab8156e10
|
|
BLAKE2b-256 checksum How to use checksums |
d7682a06edcafdb1b64be9d890cd63386ec5358b54a8ca40679783be0248802f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp310-cp310-manylinux_2_28_aarch64.whl
| Download URL | bithuman-2.11.7-cp310-cp310-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
459face6143b123e614a03c37d29e96b810285d887de601db67d4136e31b0db1
|
|
BLAKE2b-256 checksum How to use checksums |
b4be8c588960746f34c791183779460d1adceed9bce660820ac63dba5c6caffe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / bithuman-2.11.7-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | bithuman-2.11.7-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 31.9 MB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
802b8c6a68161f9ed3e299824c8ba81a690e313fd4172b6db6184166bebe101f
|
|
BLAKE2b-256 checksum How to use checksums |
e12c86d9e6e2a1cd9d1d6a5b24e2585db1e7b53c70102fca3bd0acca1376f312
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|