--- id: baml-bridge version: "0.16.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # baml-bridge — BAML python bindings (new system, bex_engine) License: permissive · Maintenance: active · Downloads: 87.9K/mo ## 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 above — 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 pip install baml-bridge uv add baml-bridge 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_current - Install friction: medium - Maintenance: active - Downloads: 87.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags BAML runtime bindings, BAML Python bridge, protobuf encoder decoder, BAML SDK runtime, bex_engine Python, BAML observability, generated BAML code runtime, baml, runtime-bindings, llm-framework [View on SkillFed](https://skillfed.io/packages/baml-bridge) · [View on PyPI](https://pypi.org/project/baml-bridge/)