Skip to main content

bithuman

๐Ÿ“ Repo status (2026-07 monorepo cutover). This essence-1 engine + its SDK bindings now live in the bithuman-models monorepo at models/essence-1/. The bithuman CLI and bithuman-serve launcher are in bithuman-cli; the public multi-language SDK + Flutter/Apple plugin are in homebrew-bithuman; serving/generation stay in platform. The former bithuman-sdk-internal, bithuman-apps, and standalone essence-2 repos are ARCHIVED (read-only) โ€” references to them below are historical.

This is the Python flavor of L2: a platform-specific SDK for app developers. It wraps the L1 libessence engine. For the CLI tool โ€” an L3 app โ€” see the CLI docs.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ L3: Apps (bithuman-cli + homebrew-bithuman)                 โ”‚
โ”‚   - bithuman CLI       brew / pip install bithuman-cli      โ”‚
โ”‚   - Flutter plugin ยท Mac/iPad reference apps                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ–ผ consumes
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ L2: Platform SDKs (app developers)                          โ”‚
โ”‚   - Python wheel       pip install bithuman    โ—„โ”€โ”€โ”€โ”€ you are here
โ”‚   - Swift package      SwiftPM Bithuman                     โ”‚
โ”‚   - Kotlin AAR         ai.bithuman:sdk                      โ”‚
โ”‚   - Rust crate (in-tree)                                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ–ผ wraps
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ L1: libessence engine (cross-platform C++ core)             โ”‚
โ”‚   - portable C ABI, same source on every target             โ”‚
โ”‚   - macOS ยท iOS ยท Android ยท Linux ยท Windows                 โ”‚
โ”‚   - never imported directly by app developers               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Library only โ€” the CLI moved out

This wheel ships the library only. The bithuman command-line tool (bithuman run model.imx, bithuman render, bithuman doctor) lives in the sibling bithuman-cli PyPI wheel (an L3 app); bithuman-cli depends on this bithuman wheel for the in-process avatar runtime, and both share the same libessence native engine.

# Library โ€” embed the runtime in your own app
from bithuman import AsyncBithuman
avatar = await AsyncBithuman.create(model_path="model.imx", api_secret="bh-...")
# CLI โ€” separate wheel
pip install bithuman-cli
bithuman run model.imx

Python bindings for the bitHuman SDK โ€” the portable C++ avatar engine (libessence) that powers our cross-platform lipsync pipeline. The wheel ships a native pybind11 module that talks directly to libessence, so you get the same per-frame cost as our Swift and Kotlin clients with none of the GIL noise.

On an Apple M5 with 24 GB unified memory we measure ~640 FPS sustained compose (1.56 ms/frame mean, 2.03 ms p99) for a 1248ร—704 avatar, with ~206 MB peak RSS end-to-end. Cold load is ~14 ms for the fixture and ~400 ms for the first compose tick (lazy ONNX init).

This package is namespace-isolated from the v0 bithuman SDK; you can install both side-by-side.

Install

pip install bithuman                 # the library (slim wheel โ€” no CLI, no brain)

Status. As of 2.3, the PyPI bithuman wheel is a slim library-only wheel. The bundled Rust CLI and conversation brain that 2.0โ€“2.2.x shipped have been extracted into the sibling bithuman-cli wheel (pip install bithuman-cli, with bithuman-cli[local] for the on-device brain). This wheel exports the avatar runtime only: AsyncBithuman (streaming) and Bithuman (sync single-shot).

Compatibility

  • Platforms: macOS arm64, Linux x86_64, Linux arm64 โ€” all ship as wheels. Windows is tracked for a follow-up.
  • Python: 3.10 โ€“ 3.14 (cp310 through cp314). CPython only.
  • ABI: wraps the libessence engine core (2.3.6, ABI v7) via pybind11.
  • Auth: ships with live heartbeat against api.bithuman.ai baked into libessence. Bithuman.load(api_secret=...) / AsyncBithuman.create(api_secret=...) is the entry point; BITHUMAN_API_SECRET env var works too.

What you get

The package exposes three API tiers (all importable from bithuman):

Tier Types Use whenโ€ฆ
Async AsyncBithuman (alias AsyncAvatar), AudioChunk, VideoControl, VideoFrame Streaming a live conversation / hosting a service
Sync facade Bithuman (alias Avatar), ComposedFrame, EP Offline / batch single-shot rendering
Low-level Fixture, Runtime, EP_CPU/EP_AUTO/EP_COREML/EP_NNAPI/EP_QNN Direct C ABI access, custom audio pipeline

Error types: BithumanError (base), TokenError / TokenExpiredError / TokenValidationError / TokenRequestError / AccountStatusError (auth), ModelError / ModelNotFoundError / ModelLoadError / ModelSecurityError / ExpressionModelNotSupported (fixture), RuntimeNotReadyError.

Version info: bithuman.__version__ (Python package), bithuman.__core_version__ (linked libessence), bithuman.__abi_version__.

Quickstart (async streaming โ€” AsyncBithuman)

Build the runtime with AsyncBithuman.create(...), feed PCM with push_audio, mark end-of-speech with flush(), and drain composed frames from the run() async iterator.

import asyncio
from bithuman import AsyncBithuman

async def main():
    avatar = await AsyncBithuman.create(
        model_path="model.imx",
        api_secret="bh-...",  # or BITHUMAN_API_SECRET env var
    )

    await avatar.push_audio(pcm_16k_mono_int16_bytes,
                            sample_rate=16000, last_chunk=True)
    await avatar.flush()      # end-of-speech marker

    async for frame in avatar.run():
        # frame.bgr_image is (H, W, 3) uint8 in BGR order
        ...

    await avatar.stop()

asyncio.run(main())

PCM accepted is int16 little-endian bytes; sample_rate is resampled to 16 kHz mono internally. WAV / MP3 / FLAC / OGG decoding is the caller's responsibility (use soundfile).

Quickstart (sync single-shot โ€” Bithuman)

For offline / batch rendering, Bithuman.load(...) then iterate compose(audio), which yields one ComposedFrame per 40 ms (25 fps) of input:

from bithuman import Bithuman

avatar = Bithuman.load("model.imx", api_secret="bh-...")
for frame in avatar.compose("speech.wav"):   # ndarray or WAV/MP3/FLAC path
    # frame.bgr is (H, W, 3) uint8 BGR; frame.frame_idx / frame.cluster_idx
    ...

Live avatar / CLI โ€” bithuman-cli (separate wheel)

The bithuman run / bithuman render command-line tool and the conversation brain (bithuman-cli[local] for the fully on-device whisper.cpp + llama.cpp + Supertonic stack) are no longer bundled in this wheel. They ship as the sibling bithuman-cli PyPI wheel, which depends on this bithuman runtime:

pip install bithuman-cli            # cloud brain (OpenAI Realtime)
pip install 'bithuman-cli[local]'   # fully on-device brain

bithuman run avatar.imx             # live avatar (browser-to-talk)

See the CLI docs and the bithuman-cli README for the full command surface and brain modes. Both wheels share the same libessence native engine.

Low-level API

If you need finer control or want to swap in a custom audio pipeline, the C ABI is exposed directly:

import numpy as np
from bithuman import Fixture, Runtime, EP_CPU

fx = Fixture("model.imx", preferred_ep=EP_CPU, intra_op_threads=1)
rt = Runtime(fx)
pcm = np.fromfile("speech.f32", dtype=np.float32)  # 16 kHz mono float32
cluster_idx, bgr = rt.tick_compose(pcm, frame_idx_hint=-1)
# bgr.shape == (fx.frame_height, fx.frame_width, 3), dtype uint8

Pass the entire pcm buffer to each tick_compose call; the runtime maintains an internal cursor and advances one tick per call until the audio is exhausted.

Zero-alloc hot path (since 1.12.4)

For tight render loops, pre-allocate the BGR buffer once and pass it via out=. The runtime writes into it in place and returns just the cluster_idx. This drops wrapper overhead to within ~3 % of raw libessence (vs ~8 % for the alloc-per-tick path):

out = np.empty((fx.frame_height, fx.frame_width, 3), dtype=np.uint8)
for _ in range(num_ticks):
    cluster_idx = rt.tick_compose(pcm, -1, out=out)
    # `out` now holds this tick's frame; read it before the next call.

The same out= keyword works on tick_compose_to_size. See docs/ARCHITECTURE.md ยง9 for the cross-wrapper perf table.

Build from source

You need the prebuilt parent C++ archive at engine/essence/build/libessence.a (run the parent CMake build first), plus the runtime deps from Homebrew (onnxruntime, webp, ffmpeg, hdf5, jpeg-turbo).

cd sdk/python
uv pip install -e '.[test]' --no-build-isolation   # only the `test` extra ships

The CMake glue links the prebuilt static archive directly โ€” it does NOT re-run the parent build, so iterate on bindings without paying the C++ rebuild cost.

Performance

Measured with tests/bench.py against the v1 compose path (audio โ†’ composited BGR frame) on Apple M5 24 GB, libessence 1.16.0:

Metric Alloc per tick out= reuse buffer
Steady-state mean 1.53 ms / frame 1.45 ms / frame
p99 1.66 ms 1.53 ms
Sustained throughput 655 FPS 692 FPS
Overhead vs raw libessence +8.3 % +2.6 %
Peak RSS (proc) 192 MB 182 MB

Wrapper overhead is within 5 % of raw libessence on the out= path; see docs/ARCHITECTURE.md ยง9 for the apples-to-apples methodology and the cross-wrapper comparison. Reproduce with:

scripts/bench-wrappers.sh

Linux wheels

Pre-built manylinux_2_28 wheels ship for x86_64 + aarch64 across cp310 through cp314 โ€” 10 wheels in total, all auditwheel-repaired with the full dep tree bundled (ORT, FFmpeg, HDF5, libjpeg-turbo, libwebp, libcurl, OpenSSL).

To rebuild them locally:

# One-time: build the dep-baked Docker images (~10 min each).
docker build --platform linux/amd64 -t libessence/manylinux-x86_64:0.1 \
    -f scripts/Dockerfile.manylinux-x86_64 scripts/
docker build --platform linux/arm64/v8 -t libessence/manylinux-aarch64:0.1 \
    -f scripts/Dockerfile.manylinux-aarch64 scripts/

# Per wheel build (~2 min):
docker run --rm --platform linux/amd64 -v "$REPO":/src \
    -e PYTAG=cp311 -e ARCH_INSIDE=x86_64 \
    libessence/manylinux-x86_64:0.1 \
    bash /src/sdk/python/scripts/build-wheel-in-container.sh

Limitations

  • Windows wheels not yet built โ€” tracked for a follow-up.
  • compose() emits a fixed 25 fps frame stream to match the model's internal rate; resample downstream if you need a different cadence.
  • preferred_ep=COREML/NNAPI/QNN is accepted but currently no-ops to CPU in the current build.

License

Commercial. Contact hello@bithuman.ai.

See also

  • docs.bithuman.ai โ€” full product + SDK docs
  • docs.bithuman.ai/cli โ€” bithuman CLI reference
  • homebrew-bithuman โ€” examples (Python, Swift, CLI, REST) + Swift package
  • bithuman-cli on PyPI โ€” the sibling CLI wheel
  • In-repo (private monorepo): engine/essence/README.md (engine internals), sdk/swift/README.md, sdk/kotlin/README.md, docs/BUILD_AND_RELEASE.md

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bithuman-2.8.0-cp313-cp313-manylinux_2_28_x86_64.whl (21.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

bithuman-2.8.0-cp313-cp313-macosx_14_0_arm64.whl (27.2 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

bithuman-2.8.0-cp312-cp312-manylinux_2_28_x86_64.whl (21.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

bithuman-2.8.0-cp312-cp312-macosx_14_0_arm64.whl (27.2 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

bithuman-2.8.0-cp311-cp311-manylinux_2_28_x86_64.whl (21.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

bithuman-2.8.0-cp311-cp311-macosx_14_0_arm64.whl (27.2 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

File details

Details for the file bithuman-2.8.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a61244262d505fce2b400de8ed54461a6b08f6440e97918a2daba37695588a53
MD5 822d77773c72defe4d8f24b9828edacc
BLAKE2b-256 467ae9046aeaf4be06e6df6f5685d1b78ccb3749b95d1cd240721d646aac98ab

See more details on using hashes here.

File details

Details for the file bithuman-2.8.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b9e31a484a0bddb812e195de810bafcd5325088ef0551e7d5cf58b6170cdfb80
MD5 52fcd86df864f4c4933cc92f64a8e8d8
BLAKE2b-256 e2a5b76c13ffd1782345935ce5b979696d7e87370ccd2c93010277747d1980bd

See more details on using hashes here.

File details

Details for the file bithuman-2.8.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc7cafe6c9cfa97cb2df907dabbba11a24d5d2cba48186df500bb5278d82a2a7
MD5 14a1d652c9d06764088aeb3ec2584d1a
BLAKE2b-256 3991aea58c9a055b33ce9f6b32288dca70530225c49adf1fee0450b7b818fb2b

See more details on using hashes here.

File details

Details for the file bithuman-2.8.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 7ae3119205b913253d940acc69eb08b612adb6ea338b60733b2c1a9a3bff57ce
MD5 0d28be9fb223197c057a367856d98dcf
BLAKE2b-256 d4f4dcf2ef22c13c36d6ffc7b81dd26e1f8716e3231716651c261e7586c95b0c

See more details on using hashes here.

File details

Details for the file bithuman-2.8.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da315779f8cdb55dbd945e61603781acbcd3743e4c91362dbc5b813193b26676
MD5 2ed77f75af260265c59931f68a9759c7
BLAKE2b-256 c76d1813b2414bee756f1312a2753844911ab684dcf9e468904d2fc6c2acd5cb

See more details on using hashes here.

File details

Details for the file bithuman-2.8.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for bithuman-2.8.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 93ab6e31674a1957f8e8692327ebfa3a088a0fcd5defa171ef14dae3c25c4a4b
MD5 3b755183011ca091c7cb134e20f2c1dd
BLAKE2b-256 c600bfdbfcbbd3a211844076a5e2faa20da58df0e338bc15bf5e293077298223

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page