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.22.3.dev2026102200

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

Total release size: 126.6 MB

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-win_arm64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-win_arm64.whl
Size 16.1 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
3432edfaf7a1ea12779e274050fe8fb4bc5b3f924f1f0e27e8bb9e8923f7370e
BLAKE2b-256 checksum
How to use checksums
8c5731e7ff37924de8f6162e96ceccbb3b67de0abffa2a502abb405cdb4b5bce
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-win_amd64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-win_amd64.whl
Size 17.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cbd48fb45944659ba1c3a862f82d80eac60c8d6e0ee7cadbd62a9408ed290313
BLAKE2b-256 checksum
How to use checksums
23bc29017f88f730378006a4c6434abc8e50effa6186bf5defc4b74f66290180
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-musllinux_1_1_x86_64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-musllinux_1_1_x86_64.whl
Size 16.3 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
b9458e2545543b2390dc48f79656ad08a4e1ff23bb333f15478e87bf7296c037
BLAKE2b-256 checksum
How to use checksums
68ee532f7dfbc5ea8559e4382584f10e982e4ada3ccb12bd27895f8167c7da64
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-musllinux_1_1_aarch64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-musllinux_1_1_aarch64.whl
Size 15.2 MB
Tags CPython 3.10 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
54920b936afb81575c180a22ea826ee687a1aa976f027e2cec50101cd8d29250
BLAKE2b-256 checksum
How to use checksums
778f0732b1499d700983f5f8bbfd4ef6cc1a28a99b9c8c0fbec9b8285e744101
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-manylinux_2_24_aarch64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-manylinux_2_24_aarch64.whl
Size 15.1 MB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 abi3
SHA-256 checksum
How to use checksums
058f37ec292fc6b77cfdd9d8ae4282c760afd429710361cc7dbd7389f96e00d2
BLAKE2b-256 checksum
How to use checksums
95cd22e90f16e3a494cc0799b687ef7ee18924d7873e695259ee04c36097cc81
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0945bd2d32049b8f9978ca863db5782292caa3c0cd5384ca2c88af75c6d17385
BLAKE2b-256 checksum
How to use checksums
1aa968eb3029065780e766c4471c6e7fbf09363dc870d1381ff2995c1ccdc4f4
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-macosx_11_0_arm64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-macosx_11_0_arm64.whl
Size 14.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bce324bdf11aab426776fa449603da30c37fde0921fbbd0652bc90e4d9579bab
BLAKE2b-256 checksum
How to use checksums
ca66b1045c8f10d0f2219e25d54f19b171d5dec5b72631941a99c8d991fa8406
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 23, 2026.

Transparency log

Release files / baml_bridge-0.22.3.dev2026102200-cp310-abi3-macosx_10_12_x86_64.whl

Download URL baml_bridge-0.22.3.dev2026102200-cp310-abi3-macosx_10_12_x86_64.whl
Size 15.7 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
07f7d9db888952039c3fe51191f358143830e7adc27662e693238f70c1a3c41c
BLAKE2b-256 checksum
How to use checksums
286fef3758484c871b5423b5434cd3a314c1c1e832ae8797f82ee9a8b3828eea
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 23, 2026.

Transparency log

Security for baml-bridge 0.22.3.dev2026102200

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.22.3.dev2026102200-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 23, 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