skillfed

baml-bridge

BAML python bindings (new system, bex_engine)

baml-bridge v0.16.0 87.9K downloads/30d#13,764 on PyPI
Permissive license Apache-2.0 Active released

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-bridge

uv

uv add baml-bridge

poetry

poetry add baml-bridge

Installing 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

License :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Libraries :: Python Modules

Tags

BAML runtime bindingsBAML Python bridgeprotobuf encoder decoderBAML SDK runtimebex_engine PythonBAML observabilitygenerated BAML code runtime
bamlruntime-bindingsllm-framework

More Python Modules packages