For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help on Discord
HomeGuideExamplesBAML ReferencePlaygroundAgents.mdChangelog
HomeGuideExamplesBAML ReferencePlaygroundAgents.mdChangelog
  • Introduction
    • What is BAML?
    • Why BAML?
    • What's the baml_src folder
    • What's baml_client
  • Installation: Editors
    • VSCode Extension
    • Cursor Extension
    • JetBrains IDEs
    • Zed
    • Claude Code
    • Others
  • Installation: Language
    • Python
    • Typescript
    • Go
    • Ruby
    • Rust
    • REST API (other languages)
    • Elixir
  • Framework Integration
  • Development
    • Environment Variables
    • Terminal Logs
    • Upgrade BAML versions
  • BAML Basics
    • Prompting with BAML
    • Switching LLMs
    • Testing functions
    • Streaming
    • Multi-Modal (Images / Audio)
    • Error Handling
    • Configuring Timeouts
    • Concurrent Calls
    • AbortSignal / Cancellation
  • BAML Advanced
    • Collector (track tokens)
    • LLM Client Registry
    • Dynamic Types
    • Reusing Prompt Snippets
    • Prompt Caching / Message Role Metadata
    • Checks and Asserts
    • Modular API
    • Prompt Optimization
  • Boundary Cloud
  • Comparisons
    • BAML vs Langchain
    • BAML vs Marvin
    • BAML vs Ai-SDK
    • BAML vs OpenAI SDK
    • BAML vs Pydantic
    • Contact
Help on Discord
LogoLogo
On this page
  • Opening BAML Playground
  • Setting Env Variables
  • Running Tests
  • Reviewing Tests
  • Switching Functions
  • Switching Test Cases
Installation: Editors

VSCode Extension

Was this page helpful?
Edit this page
Previous

Cursor

Next
Built with

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

FeatureSupported
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.

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

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.

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

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

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.
  • 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.

  • 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.

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