Get Started
Learn how to host your BAML code on Boundary Functions and call it over HTTP.
This is a preview feature, available starting with baml-cli v0.66.0
.
The BAML language, compiler, and runtime will always be 100% free and open-source: we will always allow you to run BAML functions directly in your own backends.
Boundary Functions’ goal is to make it even easier to host and run BAML functions, by adding support for features like rate limits, telemetry, and end-user feedback.
Boundary Functions allows you to host your BAML functions on our infrastructure, exposing one REST API endpoint per BAML function.
This guide will walk you through:
- creating a Boundary Cloud account,
- deploying your BAML code to Boundary Functions,
- setting your API keys, and
- calling your BAML functions.
Once you’ve deployed your BAML functions, you can use the OpenAPI client to call them.
Get Started
First, create your account and organization at https://dashboard.boundaryml.com.
Then, log in from your terminal:
and run this command in your baml_src/
directory:
This will prompt you to create a new Boundary project, deploy your BAML code to it, and then point you to the dashboard, where you can set environment variables and create API keys to use to call your BAML functions.
Once you’ve set the environment variables you need (probably ANTHROPIC_API_KEY
and/or OPENAI_API_KEY
), you can call your BAML functions!
If you still have the ExtractResume
function that your BAML project was created with,
you can use this command to test it out:
Congratulations! You’ve gotten your first BAML functions working on Boundary Functions.
Local development and testing
To test your BAML functions locally, you can use baml-cli dev
:
which will allow you to call your functions at http://localhost:2024/call/<function_name>
instead of
https://api2.boundaryml.com/v3/functions/prod/call/<function_name>
using the exact same curl
command: