Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

baml_bridge

Python bindings for the BAML runtime (powered by bex_engine).

baml_bridge is the bridge layer that generated baml_sdk packages import at runtime: it provides the BamlRuntime singleton, the protobuf encoder/decoder and the function/method factories.

from baml_bridge import BamlRuntime

rt = BamlRuntime.initialize_runtime(
    root_path=".",
    files={"main.baml": baml_source},
)

This package is generally consumed indirectly via the code generated by baml-cli generate --target python — direct use is reserved for runtime authors and bridge tests.

Python callback execution

Passing a Python callable to BAML uses the environment of the call that invokes it. Reusing a callback across threads, event loops, or requests does not retain its registration environment.

BAML entry Python callback Execution environment
Synchronous Synchronous Calling Python thread, with its current context
Synchronous Coroutine result Bridge-owned worker loop, with copied caller context
Asynchronous Synchronous or coroutine result Originating application loop, with copied entry context

Each dispatch of an async entry receives a separate copy of its application ContextVars. Callback writes do not change the awaiting task's context or another dispatch's context. An async callback need not run in the caller's exact asyncio.Task.

A synchronous entry blocks its calling thread, including any application loop running there. Coroutine callbacks of that entry must use resources of their executing worker loop. Awaiting resources owned by the blocked loop is unsupported.

Returned BAML closures support closure(...) and await closure.call_async(...). Passing a closure back into BAML preserves its native function handle. Each new invocation selects its own environment.

Cancelling a BAML call cancels executing coroutine callbacks on their owning loops. Callback tasks retain their arguments and context until their bodies and async cleanup finish. Cancellation does not interrupt a synchronous Python body. A callback that suppresses cancellation may finish later; its result does not revive the cancelled BAML call.

Requirements

  • Python 3.10+
  • protobuf >= 6.31.1

License

Apache-2.0

Metadata

Release files for baml-bridge 0.23.1.dev2026102500

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 baml-bridge 0.23.1.dev2026102500
File Actions
baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_arm64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_amd64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_x86_64.whl CPython 3.10 abi3 Linux musl 1.1+ x86-64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_x86_64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_aarch64.whl CPython 3.10 abi3 Linux musl 1.1+ ARM64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_aarch64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_24_aarch64.whl CPython 3.10 abi3 Linux glibc 2.24+ ARM64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_24_aarch64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_11_0_arm64.whl
baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 129.0 MB

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_arm64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_arm64.whl
Size 16.4 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
9d95b88a712fd5de1b309f58c50836f84d9929e18b25fee751c9cf7c41b3cadf
BLAKE2b-256 checksum
How to use checksums
ca2188b9295484c244fd2ef4a2909165acc9e2dbd4d14fff728b14ed4b73eaaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_amd64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_amd64.whl
Size 17.6 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e9d14cab3ae4f67729057b0dc196135978c596e07c80daf722895570cc7f78e4
BLAKE2b-256 checksum
How to use checksums
1688118fff680a6a5c6ab6e22de3a061ee4de6210b25865c26f0a365d56e7ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_x86_64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_x86_64.whl
Size 16.6 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
72c2ed2a4ae28ba0f60a24d85b2defb4a2325d73ecc3654f2afae3d69fa32ac4
BLAKE2b-256 checksum
How to use checksums
25e33d879e2387e67823d532381bc22f1e897d0565bdb351d8c797dc78534ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_aarch64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-musllinux_1_1_aarch64.whl
Size 15.5 MB
Tags CPython 3.10 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
42227b9b5536f52ec0550e1aef77453cd42506a213fdd91ecc1f4f0d721f35e6
BLAKE2b-256 checksum
How to use checksums
231cde6ebaf2f9b57a81205f92249653e1daa76f0e4cdc725646a8cfc873b180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_24_aarch64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_24_aarch64.whl
Size 15.3 MB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 abi3
SHA-256 checksum
How to use checksums
7188428e661e156862e23a9e45cf3449c988e5c4208c3be93d11eb3550473ea3
BLAKE2b-256 checksum
How to use checksums
3eede163f9157264dbe370cae4bf8366ad28d26d5a834b820d5755263ec20e3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c07fdafd80db4bcfb92ff6381a5339550f29bb212087783b5d601b19b52dc7b4
BLAKE2b-256 checksum
How to use checksums
e1a941da5bcd97c0d4e7a5c90f44709ca7b534e9aac50d61e2ec15be298468f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_11_0_arm64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_11_0_arm64.whl
Size 15.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c0e2bc27fa1ff81c3687f25cff3f4ea5265bdc004e13d5ff3da19162f1065b97
BLAKE2b-256 checksum
How to use checksums
ecd991ebb6d90fb592301c05d6d849be280345efa16f9bb7576c215bb77e2b0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_10_12_x86_64.whl

Download URL baml_bridge-0.23.1.dev2026102500-cp310-abi3-macosx_10_12_x86_64.whl
Size 16.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e57bec5b03f7f14d98a9e7e5a533e7a6d900b0fa7ea7dec70306baa763ade095
BLAKE2b-256 checksum
How to use checksums
ebd5b6f0a2d77b0f1adf666ddfc930f11ed5eab803ff5d359ccd1007957114d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for baml-bridge 0.23.1.dev2026102500

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for baml_bridge-0.23.1.dev2026102500-cp310-abi3-win_arm64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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