> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page.
> For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server.

We provide a BAML VSCode extension:     [https://marketplace.visualstudio.com/items?itemName=Boundary.baml-extension](https://marketplace.visualstudio.com/items?itemName=Boundary.baml-extension)

| Feature                                                   | Supported |
| --------------------------------------------------------- | --------- |
| Syntax highlighting for BAML files                        | ✅         |
| Code snippets for BAML                                    | ✅         |
| LLM playground for testing BAML functions                 | ✅         |
| Jump to definition for BAML files                         | ✅         |
| Jump to definition between Python/TS files and BAML files | ✅         |
| Auto generate `baml_client` on save                       | ✅         |
| BAML formatter                                            | ❌         |

## Opening BAML Playground

Once you open a `.baml` file, in VSCode, you should see a small button over every BAML function: `Open Playground`.

![](/_fern-img/0217c4846970898f3b072bc28b4954d4e9f8a15a0a21d4461e48fdbd40d07cdc.webp)

Or type `BAML Playground` in the VSCode Command Bar (`CMD + Shift + P` or `CTRL + Shift + P`) to open the playground.

![](/_fern-img/d7cada3e96eb92c9fdec347f2d2cb4fed65a5aebcfc6936e43fae518e69c2b01.webp)

## Setting Env Variables

Click on the `Settings` button in top right of the playground and set the environment variables.

It should have an indicator if any unset variables are there.

![](/_fern-img/ec960fe709582781bb3c8fff1bc4e77d40d745289afc9cad2aa8e679d580bcbc.webp)

The playground should persist the environment variables between closing and opening VSCode.

> **Tip**
>
> You can set environment variables lazily. If anything is unset you'll get an error when you run the function.

> **Info**
>
> Environment Variables are stored in VSCode's local storage! We don't save any additional data to disk, or send them across the network.

## Running Tests

* Click on `Run tests below` in the right pane of the playground to run all tests.

![](/_fern-img/a875a553ef4333ceef0678fc00891d1ae0adaa62e42009da885555022f5df5e0.webp)

* Press the `▶️` button next to an individual test case to run that just that test case.

## Reviewing Tests

* Click the numbers on the left to switch between test results.

* Press the `▶️` button next to the drop-down to re-run your tests.

![](/_fern-img/960455c8134e50b2cf098db81066a189d45dce96b1f019cef6fd506ba6863edf.webp)

> **Tip**
>
> * Toggle the `🚀` to enable running the tests in parallel.

## Switching Functions

The playground will automatically switch to the function you're currently editing.

To manually change it, click on the current function name in the playground (next to the dropdown) and search for your desired function.

## Switching Test Cases

You can switch between test cases by selecting it in the results pane or the test selection pane on the right.

![](/_fern-img/d67ac5f31c2f04e5fd671042427eedfdafa55a7dc071e9ac11c78b7f135a5ca9.webp)

You can customize what you see in the Table View, or switch to the Detailed view:

![](/_fern-img/83e5a8bf00e915212ef56b67ee75aef1535d463fb2471a724f83eba36bcc88fb.webp)