baml

Crates.iobaml
lib.rsbaml
version0.218.0
created_at2025-04-14 07:29:57.957067+00
updated_at2026-01-22 08:59:59.446169+00
descriptionBAML runtime for Rust - type-safe LLM function calls
homepagehttps://github.com/BoundaryML/baml
repositoryhttps://github.com/BoundaryML/baml
max_upload_size
id1632503
size264,079
(hellovai)

documentation

https://docs.boundaryml.com

README

baml

BAML runtime for Rust - Type-safe LLM function calls.

This crate provides the runtime support for BAML-generated Rust code. Users should not import from this crate directly - instead, use the generated baml_client crate which re-exports necessary types.

Features

  • Type-safe LLM function calls
  • Async streaming support
  • Runtime client registry
  • Dynamic type encoding/decoding
  • Error handling and diagnostics

Usage

This crate is typically used as a dependency by code generated by the BAML compiler. For usage instructions, see the BAML documentation.

Runtime Requirements

The BAML runtime requires the libbaml_cffi dynamic library at runtime. The library is:

  • Auto-downloaded from GitHub releases on first use (default behavior)
  • Cached in your user cache directory (~/.cache/baml/libs/ on Linux, ~/Library/Caches/baml/libs/ on macOS)
  • Configurable via environment variables

To disable auto-download (e.g., in air-gapped environments):

export BAML_LIBRARY_DISABLE_DOWNLOAD=true
export BAML_LIBRARY_PATH=/path/to/libbaml_cffi.dylib

License

Apache License - see the Repository for details.

Commit count: 2125

cargo fmt