baml-bridge
BAML python bindings (new system, bex_engine)
What it is and what it does
baml_bridge is the runtime layer that powers BAML SDK packages generated by the baml-cli tool. It provides the core BamlRuntime singleton that manages BAML program execution, handles protobuf serialization and deserialization, and exposes observability primitives (Collector and BamlCtxManager) for monitoring and debugging. The package wraps the bex_engine backend and is designed primarily as an indirect dependency—generated BAML SDK code imports it automatically at runtime.
The package is built as compiled wheels for multiple platforms and Python versions (3.10–3.13, CPython). While it can be used directly for runtime authoring and testing, most users will encounter it as a transitive dependency of their generated BAML SDK. It requires protobuf >= 6.31.1 and Python 3.10+.
Use it for:
- Running BAML programs generated by baml-cli generate --target python without manually managing the runtime.
- Authoring custom BAML runtime extensions or bridge implementations.
- Testing BAML SDK packages that depend on baml_bridge for initialization and execution.
- Monitoring BAML program execution via the Collector and BamlCtxManager observability APIs.
- Integrating BAML-generated code into Python applications that need structured LLM interactions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings for the BAML runtime, exposing the BamlRuntime singleton, protobuf encoding/decoding, and observability primitives that generated BAML SDK packages use at runtime.
Yes, if you are using BAML-generated Python code—it is the required runtime layer. Install directly only if you are authoring BAML runtime extensions or running bridge tests; otherwise, it will be pulled in automatically by your generated SDK. No known vulnerabilities; active maintenance and permissive license.
Install
baml-bridge on PyPI
pip
pip install baml-bridgeuv
uv add baml-bridgepoetry
poetry add baml-bridgeInstalling baml-bridge
Before you install
Medium install friction due to compiled wheels across multiple platforms (macOS, Linux, Windows, ARM/x86). Released 2 days ago with active maintenance status. Requires Python 3.10+.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
from baml_bridge import BamlRuntime
rt = BamlRuntime.initialize_runtime(
root_path=".",
files={"main.baml": baml_source},
sdk_root="my_sdk",
)
Requires Python 3.10 or later; protobuf >= 6.31.1 must be installed.
Verify before relying
- Whether direct use outside of generated BAML SDK code is documented or supported.
- Performance characteristics and memory footprint of the BamlRuntime singleton.
- Compatibility guarantees between baml_bridge versions and generated SDK versions.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — protobuf, typing-extensions |
| Maintenance | actively maintained — 2 days since the last release |
| First released | |
| Downloads | 87,864/month — #13,764 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: baml_bridge-0.16.0-cp310-abi3-macosx_10_12_x86_64.whl; baml_bridge-0.16.0-cp310-abi3-macosx_11_0_arm64.whl; baml_bridge-0.16.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; baml_bridge-0.16.0-cp310-abi3-manylinux_2_24_aarch64.whl; baml_bridge-0.16.0-cp310-abi3-musllinux_1_1_aarch64.whl; baml_bridge-0.16.0-cp310-abi3-musllinux_1_1_x86_64.whl; baml_bridge-0.16.0-cp310-abi3-win_amd64.whl; baml_bridge-0.16.0-cp310-abi3-win_arm64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
baml-pybaml-py is the Python runtime for executing…
unclear · top 15,000 on PyPI
protobuf-py-extNative Rust-based encoder/decoder extension…
unclear · top 15,000 on PyPI
protobuf-pyGenerates well-typed, readable Python code from…
permissive · top 15,000 on PyPI
bbpbDecode and re-encode Protocol Buffer messages…
permissive · top 15,000 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
databento-dbndatabento-dbn provides Python bindings for…
permissive · top 5,000 on PyPI
protobuf-decoderDecodes protobuf binary messages without…
permissive · top 15,000 on PyPI
opentelemetry-exporter-otlp-proto-grpcExports telemetry data from Python applications…
permissive · top 1,000 on PyPI
brotlipybrotlipy provides Python bindings to the Brotli…
permissive · top 5,000 on PyPI
smg-grpc-protoProvides pre-compiled Python gRPC stubs for…
permissive · top 5,000 on PyPI