Installation
Install BAML VSCode Extension
https://marketplace.visualstudio.com/items?itemName=gloo.BAML
If you are using python, enable typechecking in VSCode’s settings.json
:
"python.analysis.typecheckingMode": "basic"
Install BAML CLI
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/.
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.
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:...
Learn BAML
- PromptFiddle: Interactive examples to learn BAML. (recommended)
- BAML Tutorials: Advanced guides on using BAML.
- BAML Syntax: Documentation for BAML syntax.
- BAML Starters for NextJS and FastAPI
Ensure BAML CLI can generate your Python / TS client
Save a .baml
file using VSCode, and you should see a successful generation message pop up!