baml-macros

Crates.iobaml-macros
lib.rsbaml-macros
version0.218.0
created_at2026-01-07 06:36:01.860683+00
updated_at2026-01-22 08:59:57.131855+00
descriptionDerive macros for BAML types
homepagehttps://github.com/BoundaryML/baml
repositoryhttps://github.com/BoundaryML/baml
max_upload_size
id2027627
size33,582
(hellovai)

documentation

https://docs.boundaryml.com

README

baml-macros

Derive macros for BAML types.

This crate provides procedural macros (BamlEncode and BamlDecode) for automatically implementing serialization and deserialization for Rust types used with BAML.

Usage

This crate provides the BamlEncode and BamlDecode derive macros. These are typically used via re-exports from the baml crate or generated baml_client crates:

use baml::{BamlEncode, BamlDecode};

#[derive(BamlEncode, BamlDecode)]
#[baml(name = "Person")]
struct Person {
    name: String,
    #[baml(name = "years_old")]
    age: i64,
}

This crate is a dependency of the baml runtime crate. End users typically interact with these macros through re-exports, not directly. For more information, see the BAML documentation.

License

MIT License - see the LICENSE file for details.

Commit count: 2125

cargo fmt