BAML: Schema-Aligned Parsing Enables Typed Prompts Across Any LLM Model
BoundaryML's BAML ("Basically a Made-up Language") is a typed prompting DSL that compiles to client libraries in Python, TypeScript, Ruby, Java, C#, Rust, and Go. Its core innovation is Schema-Aligned Parsing (SAP) — an algorithm that extracts structured outputs from any model response regardless of format, including markdown-wrapped JSON, chain-of-thought prefixes, or prose. This makes typed structured outputs work on Deepseek-R1, OpenAI O1, and any OpenAI-compatible endpoint on day one of release, without waiting for native tool-calling API support. Apache 2.0, fully offline-capable, Rust-built.
Why It Matters
BAML treats prompt engineering as schema engineering — functions with typed parameters and return values — which enables diff-based prompt review, streaming typed partials, and cross-language codegen from a single source of truth. SAP is the differentiator that makes this practical for production rather than constrained to models with perfect tool-calling compliance.