BAML
by Boundary
A typed language for LLM functions. Define inputs, outputs, and prompts, get reliable structured output.
OSS
BAML
Added 17 May 2026
Overview
BAML is a domain-specific language for LLM functions. Define your input and output types, write the prompt, and BAML generates typed client code in the language of your choice. The result is LLM calls that act like regular functions, with first-class testing, observability, and provider-agnostic deploy.
Best for
Best for
Teams who want LLM calls to feel like real typed functions
Use cases
- Define LLM functions once, use them from any language
- Get typed structured output with strong validation
- Run evals and tests on prompts the way you do on code
- Swap providers without rewriting the calling code
Notes
Why it matters
The promise is appealing: LLM calls as typed, testable, language-agnostic functions. BAML is the clearest articulation of that vision shipping today.
How teams use it in production
Define LLM functions in BAML, generate clients, call them like regular typed functions from your app. Run evals against test cases in CI like any other code change.
What to watch
Whether a DSL is the right abstraction, or whether annotated typed functions in the host language (Instructor, structured-output SDKs) win. The argument is live.
Pros
- Truly cross-language, generate clients in Python, TS, Ruby
- Strong VSCode tooling with prompt previews
- Test and eval as first-class citizens
- Provider-agnostic deploy, no SDK lock-in
Cons
- Learning a new DSL is a real adoption cost
- Smaller community than Instructor
- Less drop-in than patching an existing SDK