2

Install BAML compiler

brew install boundaryml/baml/baml

You should be able to run baml --version and see the version number. The VSCode Extension will keep the compiler up to date for you.

If you don’t have brew, see: https://brew.sh/. If you don’t have scoop, see: https://scoop.sh/.

3

Add BAML to a project

In your python project, run baml init.

After running baml init, add or modify baml files in the ./baml_src directory

4

Update the python dependency

The BAML CLI will install a python package called baml into your project (not to be confused with the baml CLI of the same name).

Run baml update-client to make sure the python package is installed and on the latest version.

5

Set up Boundary Studio (optional)

Create an account at https://app.boundaryml.com.

Set up a project and generate a secret.

In your .env file, set the following values generated from the web app:

BOUNDARY_PROJECT_ID=proj_...
BOUNDARY_SECRET=gloo:...
6

Learn BAML

  • BAML Tutorials: Learn how to use BAML with examples and how-to-guides. (Recommended)
  • BAML Syntax: Documentation for BAML syntax.

Ensure baml builds

  • VSCode

  • terminal

Save a .baml file using VSCode, and you should see a successful generation message pop up!