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

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

Total release size: 128.3 MB

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-win_arm64.whl
Size 16.4 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
f77565d23a4cae4c72818158f4b2709162b503feace7491e9fae40e79c953414
BLAKE2b-256 checksum
How to use checksums
76a070adf08525c9fb9e44df7fcb3778887ee354fdc4f886c6b842ea1a266c2a
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-win_amd64.whl
Size 17.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9667b1a3a9fb331e5d7694efe267353a3441a9f66072c6d9e6768a78a2c0f948
BLAKE2b-256 checksum
How to use checksums
6233b3ab5edd1505b0f613c7b9ea45f3a0c3c408d998190199f19d86958bf009
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-musllinux_1_1_x86_64.whl
Size 16.5 MB
Tags CPython 3.10 Linux musl 1.1+ x86-64 abi3
SHA-256 checksum
How to use checksums
cec491cf768539f6dbb41610118b34bad586adb604aef20af4fcaf96ca05f518
BLAKE2b-256 checksum
How to use checksums
1f3ca1b010e2d3795c4345ba938a30550fe92c291c85fcc14e4c82c239f8225c
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-musllinux_1_1_aarch64.whl
Size 15.4 MB
Tags CPython 3.10 Linux musl 1.1+ ARM64 abi3
SHA-256 checksum
How to use checksums
1369d18bcd35ae7a989693824be1be798c44d00e64799acc8471995d69175ea5
BLAKE2b-256 checksum
How to use checksums
723486398dba5c932733dbfdb49dbaac946166c116e88d5250e98fa92cd678e6
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-manylinux_2_24_aarch64.whl
Size 15.2 MB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 abi3
SHA-256 checksum
How to use checksums
2767adc6b206a9360729e61246882215223da16a077395aca236bff3af549a96
BLAKE2b-256 checksum
How to use checksums
b570047973c09ad35b04fd3111d53d479b16b14d8b4b291f2654a6b4cd164601
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5429a1312b9dab40b940173530d8a515942b336894d4d33a4a48ec0df166f74a
BLAKE2b-256 checksum
How to use checksums
f73e133ad238e9e205b9a84bf37fe4164261a3082bd9df24422ebb973670ec52
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-macosx_11_0_arm64.whl
Size 14.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
427fac5cb6e89f573ebf31b36b1f5b7c4423edb74b65479e6553eacbe52df566
BLAKE2b-256 checksum
How to use checksums
a7b2e4f67318c45fc95abb68640240d95a866961dfc63f793a2eef6ebd24f1be
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 24, 2026.

Transparency log

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

Download URL baml_bridge-0.22.3.dev2026102300-cp310-abi3-macosx_10_12_x86_64.whl
Size 15.9 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
09acac208de333f725fe765d7bfe867f2827d64b23195d2b1087454c15b139cb
BLAKE2b-256 checksum
How to use checksums
d8161965804e539b0bef86110ce094a1586db96273d56b0c21a610fdddbadad0
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 24, 2026.

Transparency log

Security for baml-bridge 0.22.3.dev2026102300

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.dev2026102300-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 24, 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