Boundary Studio
For the remaining of 2024, Boundary Studio is free for new accounts!
Boundary Studio 2 will be released in 2025 with a new pricing model.
To enable observability with BAML, you’ll first need to sign up for a Boundary Studio account.
Once you’ve signed up, you’ll be able to create a new project and get your project token.
Then simply add the following environment variables prior to running your application:
There you’ll be able to see all the metrics and logs from your application including:
- Cost
- Function calls
- Execution time
- Token Usage
- Prompt Logs
- and more…
Tracing Custom Events
BAML allows you to trace any function with the @trace decorator. This will make the function’s input and output show up in the Boundary dashboard. This works for any python function you define yourself. BAML LLM functions (or any other function declared in a .baml file) are already traced by default. Logs are only sent to the Dashboard if you setup your environment variables correctly.
Example
In the example below, we trace each of the two functions pre_process_text
and full_analysis
:
This allows us to see each function invocation, as well as all its children in the dashboard:
See running tests for more information on how to run this test.
Adding custom tags
The dashboard view allows you to see custom tags for each of the function calls. This is useful for adding metadata to your traces and allow you to query your generated logs more easily.
To add a custom tag, you can import set_tags(..) as below: