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.dev2026101800

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

Total release size: 124.9 MB

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-win_arm64.whl
Size 15.9 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
9e051742dcda572eb8be271e87b2d921937a0377c862763991a160ae5d5c1f7e
BLAKE2b-256 checksum
How to use checksums
dd02093ab81a3d1c974ce924f998265afe8c12fdb83dafc1120ca0bff7ac0685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-win_amd64.whl
Size 17.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
98cbb11c7fd1481045cf9e89b0fb9517c90224fbd84bf5929b6e0da51087d2f0
BLAKE2b-256 checksum
How to use checksums
5b50e2081cb6b3e2b81ccf14669512f78c33aec86c3db2dc6c5134cc7ddc043e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-musllinux_1_1_x86_64.whl
Size 16.1 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
1bcd03d57415df3b48146239f44c4f49e5287ab36b718334b4fead846a59c053
BLAKE2b-256 checksum
How to use checksums
430904faaa0f5e248cfab169a8493fc7bc0002bada5b09198c6bac84d3ea971e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-musllinux_1_1_aarch64.whl
Size 15.0 MB
Tags CPython 3.10 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
d261a812c129d80040a15ced17336c8b111c9f8c977f65a5b7c1f51e61816a26
BLAKE2b-256 checksum
How to use checksums
d5715b7ba7ba204c10b6258a332489b0ffd498b5939efa4dd8b712a0db0a38c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-manylinux_2_24_aarch64.whl
Size 14.8 MB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 abi3
SHA-256 checksum
How to use checksums
bef3203aa57dab161b668c10f0a4ca80d625615bc8f290af960b5ab6f9482d7a
BLAKE2b-256 checksum
How to use checksums
73ecd30a5b663fe1f3cde50a141de8fa1c7961ca5e4ba43061bce4a681878924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 15.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
76a7367f775e38c2d4f018e8ddb999c06b79b9800b2d089a4512862f0df7b61f
BLAKE2b-256 checksum
How to use checksums
d40b8f61abd13df6916fa7c757350c40ee8c31dac785aa0b00b471c0d3d01ccd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-macosx_11_0_arm64.whl
Size 14.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b55f327bcc555881335b886416026ebe9bb8daf0da488b6e33d175184d29559e
BLAKE2b-256 checksum
How to use checksums
ec2e29c7523c691c8089da9b84c17fe9bfabcdc85bfa3a0390f7754b454bf6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026101800-cp310-abi3-macosx_10_12_x86_64.whl
Size 15.5 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f18cb5183870b1267baf88a0fa02f9c483a5c3cafdaf3527146d5f81caa0b092
BLAKE2b-256 checksum
How to use checksums
a28ab6b07309b9b4f0e4bdc057cfb4e3bb668ea2f745b5b81535846e56dc53d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 19, 2026.

Transparency log

Security for baml-bridge 0.22.3.dev2026101800

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.dev2026101800-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 19, 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.

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