A prompting language for building reliable AI workflows and agents with type-safe, structured outputs across multiple programming languages.
BAML is a prompting language and framework that adds engineering rigor to prompt engineering by treating LLM prompts as typed functions. It solves the problem of unreliable and unstructured LLM outputs by providing a schema-first approach, enabling developers to build robust AI workflows and agents with type-safe, structured data across multiple programming languages.
Developers and engineers building AI-powered applications, agents, or workflows who need reliable, structured outputs from LLMs and want to integrate prompts seamlessly into their existing codebases in languages like Python, TypeScript, or Go.
Developers choose BAML because it replaces error-prone string manipulation with a type-safe, schema-driven approach, dramatically improving iteration speed with built-in tooling and enabling reliable structured outputs with any LLM, even those without native function-calling support.
The AI framework that adds the engineering to prompt engineering (Python/TS/Ruby/Java/C#/Rust/Go compatible)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
BAML treats prompts as typed functions with structured inputs and outputs, reducing errors in LLM responses, as demonstrated in the ChatAgent example with clear type definitions.
You can call BAML functions from Python, TypeScript, Ruby, and other languages without rewriting your app, shown in the Python code snippet for agent workflows.
Includes IDE extensions (VS Code, JetBrains) and a playground for fast prompt testing and visualization, enabling parallel testing to speed up development cycles.
Schema-aligned parsing allows reliable tool-calling with any LLM, even without native APIs, as highlighted with support for models like Deepseek-R1 and OpenAI O1.
Provides fully type-safe streaming interfaces for real-time UIs in frameworks like Next.js, with examples and hooks for building responsive applications.
Developers must learn BAML's custom language for prompts, which can delay initial adoption compared to using familiar string templates or existing frameworks.
Requires installing IDE extensions and a Rust compiler for compilation, adding complexity that might not be justified for simple or one-off projects.
As a newer project, BAML has fewer third-party integrations and community plugins compared to established alternatives like LangChain, which could limit extensibility.
With weekly updates mentioned in the FAQ, there's a risk of API changes affecting existing code, requiring ongoing maintenance despite claims of stability.