Skip to main content

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.


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 exist for hosts that need them, and neither is required for a working result:

BITHUMAN_API_SECRET your key
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.


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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for bithuman 2.11.2
File
bithuman-2.11.2-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
bithuman-2.11.2-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details
bithuman-2.11.2-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
bithuman-2.11.2-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
bithuman-2.11.2-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details
bithuman-2.11.2-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
bithuman-2.11.2-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
bithuman-2.11.2-cp312-cp312-manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64 Details
bithuman-2.11.2-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
bithuman-2.11.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
bithuman-2.11.2-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details
bithuman-2.11.2-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
bithuman-2.11.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
bithuman-2.11.2-cp310-cp310-manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64 Details
bithuman-2.11.2-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 377.3 MB

Release files / bithuman-2.11.2-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL bithuman-2.11.2-cp314-cp314-manylinux_2_28_x86_64.whl
Size 22.6 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
98538fda48f4fd22799dc550690448af2092cd1adb87599ecb298467d05142af
BLAKE2b-256 checksum
How to use checksums
469d322d7333a2af09b073f1799d1e2c6ba624473419b4c1e23dea70391c523b
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.2-cp314-cp314-manylinux_2_28_aarch64.whl

Download URL bithuman-2.11.2-cp314-cp314-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags CPython 3.14 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9ad3e0069b154dc13c9a2a103d8285415d757e639a7a59e2761baf6f8a8e2959
BLAKE2b-256 checksum
How to use checksums
5650e221566d5368218feaec02cd98933836dafc5953c350523c87810d51e2e6
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.2-cp314-cp314-macosx_14_0_arm64.whl

Download URL bithuman-2.11.2-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
8ebee0988b56a8900f08fcfb632a459a01dbae00c3c2916b37fb78c2af27aedb
BLAKE2b-256 checksum
How to use checksums
5802b3575d795f3a3ce807ff7eee61f47605af74923fca1ba0513f2134e78684
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.2-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL bithuman-2.11.2-cp313-cp313-manylinux_2_28_x86_64.whl
Size 22.6 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
57c011d6bc3018ee7151d50549252a3043b084dea02d0a465a0610b81f2da6fc
BLAKE2b-256 checksum
How to use checksums
d440bb315a191c137980623041d518ff161c19f540826776435f677f0b03508d
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.2-cp313-cp313-manylinux_2_28_aarch64.whl

Download URL bithuman-2.11.2-cp313-cp313-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
dfafd6e84e34c8ae79fb0600833d9b342bf821c265c45af4d23edb7cdf455e1c
BLAKE2b-256 checksum
How to use checksums
e258dcc84ccef9d860f1f701aec6468b5285672276db96d3b6a95a6139b87219
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.2-cp313-cp313-macosx_14_0_arm64.whl

Download URL bithuman-2.11.2-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
610ea1e91d9147164e888791647fb1189e0eae500bf890cecad686bba2be78b0
BLAKE2b-256 checksum
How to use checksums
1902b55114b6b689e13163ac8134a56ff5e88c14dc9d1612165847db07d6cf7d
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.2-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL bithuman-2.11.2-cp312-cp312-manylinux_2_28_x86_64.whl
Size 22.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fae144c522e61cd36dc8fa1552c01f39c49acc2082569001109424c15e7be912
BLAKE2b-256 checksum
How to use checksums
aedbb73815f9f611cf81b3699f34f87c7400b9e25ce5f423604719ea6b415baa
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.2-cp312-cp312-manylinux_2_28_aarch64.whl

Download URL bithuman-2.11.2-cp312-cp312-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
3b03b241eb8ffd90a19c5a455725ae227298613478fd17d35ab10c6e1e2755c6
BLAKE2b-256 checksum
How to use checksums
ebcd5605ebc50500ee13c0cad05bff958f3b33c4c192fc026be01295a965f82f
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.2-cp312-cp312-macosx_14_0_arm64.whl

Download URL bithuman-2.11.2-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
29cc423a095714cf2058d3867540a4dad74abdff26f8c3ea3df1e2b59fdfc053
BLAKE2b-256 checksum
How to use checksums
d0bf8938b0024e6b629e0102c6e4649a6f1cf62707741fa301e1a1351c6afbf8
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.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL bithuman-2.11.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 22.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
02f0e3369a1a8409c05c57c172d94dcf64da83d9b7da4df15663c04f29f7aaf4
BLAKE2b-256 checksum
How to use checksums
a518d768dcdb7e03da4f091b0ea75e817cb82192e81fae3b1de0a82c9854d4da
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.2-cp311-cp311-manylinux_2_28_aarch64.whl

Download URL bithuman-2.11.2-cp311-cp311-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f0d548d8dbe9fbc0eebe102eb8128bcd3a93118a23ca840f0648084c152f9fdd
BLAKE2b-256 checksum
How to use checksums
7f951f5c3a65d3ab0aef68131d2c0f406a0f5010b881c7a28b71f8ca455f4dea
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.2-cp311-cp311-macosx_14_0_arm64.whl

Download URL bithuman-2.11.2-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
cc1e50cae715cefca7344e8a1b46a3a1d64c388dbd2680ba2b9c05d13b516573
BLAKE2b-256 checksum
How to use checksums
5dcfcbf0c8f6ba33b5ac531c25c15ea7057115e69bb12cf4ff68a81cc41cf588
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.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL bithuman-2.11.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 22.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8e01150217aa2182ee949bfdd8562c6a22201e27c269a37e8dfb11108b49024d
BLAKE2b-256 checksum
How to use checksums
4a19e9777c95ffbab9abcee6edd4aa719932464873f4e8ecad1c157dc79d2bec
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.2-cp310-cp310-manylinux_2_28_aarch64.whl

Download URL bithuman-2.11.2-cp310-cp310-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
800ede0ec4e284edde0778aeea4ab25da11c4685ec6565845b4242d2afd9e66e
BLAKE2b-256 checksum
How to use checksums
c1e9cb224863ddf970babf661623ece90eb1c28f5fe2302e434cbf2cf8d25068
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.2-cp310-cp310-macosx_14_0_arm64.whl

Download URL bithuman-2.11.2-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
63da89747fc77c56e917e9e1009e0ac388ca2c9c4ff5c03e7bb61285af502449
BLAKE2b-256 checksum
How to use checksums
aa82d14fc2600ce83fc7d4ad2006e7aa2b7b310ffd4610f2b4d0b256a2d77422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

2.11.2 This release

15 release files

2.3.4

15 release files

1.15.2

3 release files

1.15.1

3 release files

1.15.0

3 release files

1.14.0

3 release files

1.13.0

3 release files

1.12.4

3 release files

1.12.3

3 release files

1.12.2

3 release files

1.12.1

3 release files

1.12.0

3 release files

0.8.1

24 release files

0.1.3

3 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page