Backed by
Extract any type of structured data, reliably
BAML is our templating language for structured text generation
$ npm install @boundaryml/baml
$ pip install baml-py
Trusted by developers at
Haven AI
BAML turns messy prompt templates into typed functions that are easier to run and test. No regexes, try-catch loops, or type errors.
Calling BAML functions feels as easy as calling a regular function
Ship code that just works ❤️
Built by former engineers from

Get started in 5 minutes

Frequently asked questions

Does BAML use LLMs to generate code?
No, BAML uses a custom-built compiler.
What does BAML stand for?
Basically, A Made-up Language
What is the BAML compiler written in?
Mostly Rust 🦀
What models do you support?
Openai, Anthropic, Gemini, Mistral, or you can bring your own! We also have plans to support non-generative models.
How do I deploy with BAML?
BAML files are only used to generate Python or Typescript code. You don’t need to install the BAML compiler in your actual production servers. Just commit the generated code as you would any other python code, and you're good to go
Is BAML secure?
Your BAML-generated code never talks to our servers. We don’t proxy LLM APIs -- you call them directly from your machine. We only publish traces to our servers if you enable it explicitly.
How do you make money?
BAML and the VSCode extension will always be 100% free and open-source.

Our paid capabilities only start if you use Boundary Studio, which focuses on Monitoring, Collecting Feedback, and Improving your AI pipelines. Contact us for pricing details at
Why not use Pydantic / Instructor or Langchain?
Here’s our detailed comparison vs Pydantic and other frameworks.
TL;DR: BAML is more than just a data-modeling library like Pydantic.
1) Everything is typesafe. 2) The prompt is also never hidden from you. 3) It comes with an integrated playground, and 4) can support any model.
Why make a new programming language?
We started building SDKs for TypeScript and Python (and even experimented with YAML), and they were simply not sufficient. Inspired by technologies by Prisma and Terraform, we set out to build a better DX for AI.
Have a different question or want to learn more about integrating BAML for your team?
Join our community onDiscord