Debuly
BAML logo

BAML

Open-source, TypeScript-like programming language for agents, with typed LLM functions, built-in tests and SDK generation.

Open source

What is BAML?

BAML is a Turing-complete programming language from Boundary, made for software that agents and humans both write. Its syntax feels close to TypeScript, but types stay meaningful at runtime, there is no any type, and errors are typed with exhaustive pattern matching. LLM calls are native functions, so prompts, tests, testsets and evaluations live in the same language. The baml describe command helps coding agents discover code by its structure, baml run executes any function from the terminal, and generated SDKs let you adopt it step by step from Python or TypeScript. The toolchain installs with Homebrew or an install script, and editor support covers VS Code and Cursor. The language and local toolchain are free and open source, and run on your machine without calling Boundary servers. A hosted BAML Cloud for observability, team controls and governance is announced but has no published pricing. The project is pre-1.0, so some APIs may change.

Use cases

  • Define typed LLM functions
  • Extract structured data from models
  • Test prompts with built-in evals
  • Generate Python or TypeScript SDKs
  • Write agent code with typed errors
  • Run functions from the command line

Who it's for

  • Software engineers
  • AI engineers
  • Agent builders

Why use BAML

  • Runtime types and typed errors make invalid states harder to represent in agent-written code.
  • LLM functions, tests and evals share one language, so prompt changes are checked in the same place.
  • Generated SDKs let you adopt it one function at a time from existing Python or TypeScript.
  • Everything runs locally for free, with no call to Boundary servers.
  • baml describe gives coding agents a structured way to inspect your code.

BAML features

  • TypeScript-like syntax with unions, generics and interfaces
  • Runtime types with no any or unchecked casts
  • Typed errors with exhaustive pattern matching
  • Green threads with spawn and await
  • Native LLM functions, tests, testsets and evaluations
  • baml describe for AST-aware code discovery
  • baml run to execute any function from the CLI
  • SDK generation for Python and TypeScript
  • Local playground and VS Code or Cursor extension
  • baml agent install for coding-agent guidance

BAML integrations

  • Python
  • TypeScript
  • Node.js
  • VS Code
  • Cursor
  • Homebrew

How to get started with BAML

  1. Install the toolchain with Homebrew, the install script or the Windows installer.
  2. Create a project with baml new, which sets up baml.toml and a baml_src folder.
  3. Write a typed function in a .baml file and check it with baml check.
  4. Run it from the terminal with baml run, or generate an SDK to call it from Python or TypeScript.
  5. Add editor support with baml ide install and agent guidance with baml agent install.

BAML limitations

  • Pre-1.0, so some APIs and tooling may change
  • BAML Cloud pricing has not been published
  • The older v0 DSL docs describe a different, legacy version
  • A new language to learn alongside your existing stack

BAML pricing

BAML is open source, so you can use and self-host it for free.

Prices can change and may vary by country or exclude tax. Check the official pricing page.

BAML alternatives

The main BAML alternatives listed on Debuly are Instructor, Outlines, Pydantic AI, Marvin, TypeChat and Guidance. The table compares pricing and platforms; order is A–Z.

BAML compared with its alternatives
ToolPricingStarting pricePlatforms
BAMLOpen source—CLI, macOS, Linux, Windows
GuidanceOpen source—API
InstructorOpen source—API, Self-hosted
MarvinOpen source—Python, CLI
OutlinesOpen source—API
Pydantic AIOpen source—API, CLI, Self-hosted
TypeChatOpen source——
  1. Guidance

    Python library for steering language models, combining constrained generation with ordinary control flow so outputs follow regexes, grammars or JSON schemas.

  2. Instructor

    Open-source library that gets validated, typed structured data out of LLMs using Pydantic models and automatic retries.

  3. Marvin

    Open source Python framework from Prefect for getting structured output from LLMs and building agent workflows from tasks and threads.

  4. Outlines

    Python library from .txt that makes LLM output match a type you define, such as a Pydantic model, enum or regex, during generation.

  5. Pydantic AI

    A type-safe, model-agnostic Python framework for building agents and LLM applications, from the team behind Pydantic.

  6. TypeChat

    Microsoft library that builds natural-language interfaces by using your own types to define what a model must return.

BAML FAQ

How much does BAML cost?

Free. The BAML language and local toolchain are open source. A hosted BAML Cloud has been announced for later, and no pricing for it has been published.

Is BAML open source?

Yes. The source and license are on GitHub, and the pricing page states BAML is free and open source. It is currently pre-1.0.

Does BAML have a free plan?

There are no plans to pick from. The local toolchain is free and runs on your machine without calling Boundary servers.

Which languages can use BAML?

You can generate SDKs for incremental adoption from Python and TypeScript, and the docs also describe a TypeScript bridge for Node.js applications.

Does BAML need an API key to start?

No. The first example in the get-started guide runs a function from the terminal without a model provider or API key.

What are alternatives to BAML?

Common alternatives for structured LLM output are Instructor, Outlines, Pydantic AI, Marvin and TypeChat.

Sources & verification

Facts on this page come from the official sources below, each with the date we read it. Written by Debuly; the vendor did not review this page.

SourceTypeAccessed
boundaryml.com/exploreofficial
github.com/BoundaryML/bamlrepository
boundaryml.com/pricingpricing
boundaryml.com/tosofficial
boundaryml.com/official
docs.boundaryml.com/homedocs
developer.boundaryml.com/baml/get-startedofficial

Image credits

  • Logo: from boundaryml.com · fetched · Vendor trademark, used only to identify the product; removed on request
  • Cover: none collected yet, so a generated tile is shown.

Spot an error? Report an issue with this listing. We also remove a logo or image on the owner's request.