BAML
QuickstartPodcastTeamChangelogagent tries baml
DiscordGitHub8,423ImageLearn BAML
ImageLearn BAMLQuickstartPodcastTeamChangelogagent tries baml
DiscordGitHub8,423

Modern programming languages weren’t built for agents.

ImageBAML is Basically A Made-up Language.

We designed it to fight slop. As you read the code, it should feel like TypeScript (unions, generics, lambdas), but with no escape hatches (like as any).

ImageBAML has the:

  • Imagesyntax and readability of TypeScript
  • Imagecorrectness and tooling of Rust
  • Imagecompile times and concurrency of Go
  • Imagedynamism and nothing else of Python

The parts different from TypeScript are:

Observability and profiling

Every function traced and profiled, locally. Agents can read the traces.

AI functions

Streaming, batching, websockets, voice, any provider.

The anti-slop type system

No any, no unchecked casts, no imports. But we did add pattern matching.

Agent-first toolchain

Compiles faster than Go, searches better than ripgrep, packs smaller binaries than Bun.

Workflow primitives

Concurrency, retries, cancellation, codemode, sandbox. It’s a lot, just read the code.

Better testing

Generate tests from data or prod traces. Grade flaky (AI) functions over many runs.

And, most importantly:

Incremental adoption

ImageBAML runs standalone on:

  • ImagemacOS
  • ImageLinux
  • ImageWindows

or inside your existing projects in:

  • ImagePython
  • ImageTypeScriptNode
  • ImageTypeScriptWeb
  • ImageJava
  • ImageC#
  • Image.NET
  • ImageC++
  • ImageGo
  • ImageRust
  • ImageKotlinAndroid
  • ImageSwiftiOS
  • ImagePHPsoon
  • ImageRubysoon

But not JavaScript. Never JavaScript. Plz stop.

Type-safe like OpenAPI, but capable like FFI.


Observability and profiling

Agents write more code than any human can read. Telemetry is the only way to understand what happened. ImageBAML traces every function instead of sampling a percentage. It’s 6x faster than OpenTelemetry in Rust, 200x faster in Python, and the traces 1000x smaller.

OTEL
llm call…captured

The field forgets as fast as it learns. 147 events dropped since you opened this page.

BAML
llm call…captured

Nothing is forgotten.

loading editor…

Read more → How BAML keeps tracing fast enough to always leave on

AI functions

Calling a model should feel like calling a function, not wiring up an SDK. In BAML it’s a typed function: declare the input and output types, get structured data back. Malformed output gets repaired against your types by schema-aligned parsing, so every model gets better at structured output.

loading editor…

Read more → AI functions in BAML

The anti-slop type system

Every invariant you can’t enforce is one an agent will eventually violate. Start with type erasure: we don’t do it, so there’s no any or unchecked cast for a model to hide behind. In BAML, invalid states don’t compile.

TypeScript
1
2
3
4
5
6
7
8
interface User {
name: string;
email: string;
}
// 'as' is an unchecked promise the compiler believes
const user = JSON.parse(raw) as User;
user.email.toLowerCase();
BAML
loading editor…

Read more → The BAML language

Agent-first toolchain

For decades, tooling was built for humans: LSPs, autocomplete, hover docs. It’s about time the real author of the code got fair treatment. An LSP for you, baml describe and friends for them. And a really fast compiler for both.

$ baml run main
Compiling 1 file(s)
Compiled 1 file(s) in 1s
"hi, world"
$ baml run greet -- --name "hacker news"
Greeting { message: "hi, hacker news" }
$ baml run greet -- --help
function greet(name: string) -> Greeting
Options:
--name <string>
# any function is a target; its params become --flags

Read more → The BAML toolchain

Workflow primitives

How has everyone accepted async as a good idea? Half your codebase ends up as two copies of the same function, one sync and one async. Like Go, BAML has green threads. Unlike Go, you can await what they return.

loading editor…

Read more → Workflows in BAML

Better testing

Engineers spent twenty years squashing flaky tests. Then AI made everything flaky. ImageBAML tests can grade distributions. Cases can be hard-coded examples, golden datasets, or real prod traces.

from a CSV
loading editor…
from object storage, at collection time
1
2
3
4
5
6
7
8
9
10
11
testset "from object storage" {
let res = baml.http.fetch("https://datasets.example.com/golden.csv");
let rows = res.text().split("\n");
for (let row in rows.slice(1, rows.length())) {
let cols = row.split(",");
test ("golden: " + cols[0]) {
assert.equal(classify(cols[0]), cols[1]);
}
}
}

Read more → Evals in BAML


RO🐘O🐘Melephants in the room

Image I’m hyped. How do I port my codebase to BAML?

Do not rewrite your codebase in BAML.

You can if you want. But we went the extra mile in the other direction: every type, every function, every method crosses the bridge to your language. Even generics. Even lambdas. Even tracing. ShImaget just works. Read more → Incremental adoption

Image Can models actually write BAML?

Decide for yourself. ImageBAML reads like TypeScript and is already an official language on GitHub, so models should know most of it. We don’t leave the rest up to vibes. We measure how agents write programs: how long it takes, what it costs, how many turns. baml describe wasn’t a coincidence. It’s a science.

And remember, today is the worst the models will ever be at BAML. Read more → Agent tries BAML

Image Is there an ecosystem?

npm install is-even. It depends on is-odd? That depends on is-number?! 🤯 We’re rethinking package management from first principles. For now, we’ve shipped a thorough standard library. For anything else, ask Claude to port what you need, or pass functions over the bridge.

Besides, no packages means no supply chain attacks. QED.

Image Are you trying to get bought by Microsoft?Anthropic?

No thank you.

The BAML language is and will always be open. Apache-2, free, works offline.

We make money on Boundary Web Services. Build the language, the runtime, and the tracing layer, and you can make things nobody else can. We think you’ll love paying for some of them.

Some of you may wish to build your own cloud. Good luck and Claudespeed.

For the rest, we’re launching with observability, and saving you from Datadog. Reach out if you want in early.

Try BAML

OTEL dropped 147 events while you read this page.

Set up BAML in this repo so I can write great agent first code. Install the toolchain (pick one for this machine): - Homebrew (macOS/Linux): brew install baml - curl (macOS/Linux): curl -fsSL https://pkg.boundaryml.com/install.sh | sh -s - Arch: yay -S baml-bin - Windows: irm https://pkg.boundaryml.com/install.ps1 | iex Then set up the project: - baml init - baml agent install - baml run main If this repo already has an app in another language, wire up the bridge so it can call BAML directly. Run baml bridge add <target> once, then baml bridge generate whenever the .baml files change. The add command prints the host package to install. Targets: - Python: python/pydantic - TypeScript: typescript/node - TS / Web: typescript/web - Go: go (also pass --sdk-import-path <MODULE>/baml_sdk) - Rust: rust - Java: java - Kotlin: java (the Gradle plugin adds the Kotlin layer) - C#: csharp - C++: cpp - Swift: swift - Pydantic v1: python/pydantic/v1 After that, use the BAML skill and baml describe to write and edit .baml files.
Get onboarded, live

Book a free 45-minute session with the team. We'll get you set up and work through your actual use case.

Book a session
Questions or feedback?

Join the BAML Discord. We're around to help you get set up, and we read every bit of feedback.

Join the Discord
ImageTry BAML

Boundary

Basically a made up language.

  • Company
  • About Us
  • Why BAML?
  • Privacy Policy
  • Terms of Service
  • Resources
  • Changelog
  • Docs
  • Jobs
  • Blog
  • Pricing
  • Social
  • GitHub
  • Twitter
  • Discord
  • LinkedIn
  • YouTube
Advertisement
Advertisement