https://www.boundaryml.com logo
I am gonna play with BAML playground
# suggestions
m
I am gonna play with BAML playground today and document everything I see as a first time user
OK first, what I am hoping for, and where my head is at before I start: I am Sylvia, and I have a good intuition for context management. I am looking for a tool that helps me "talk to an LLM as if I were code". I see 3 potential solutions: - Vibe code a basic gui This adds a ton of overhead to iteration, and means that iteration is constrained by the GUI. It is weak and unappealing. - Use Anthropic's Console I want to prompt the model like it will be prompted at runtime, where my prompts are formatted like JSON. If I hand wrote all that JSON, that sounds overwhelming and like a lot of work - BAML Playground magically solves everything I have heard about this tool called BAML playground, and I already intend to use BAML on my project. I am envisioning BAML playground to be like a REPL for talking to LLMs using BAML - Just like I would use a Jupyter notebook for prototyping DSP algorithms when working on a synthesizer, I could use BAML playground to prototype prompts If BAML playground is what I hope it to be, it could do most of the heavy lifting of versioning prompts for me. ‎
I install the plugin from the vs code marketplace I have just installed the plugin on the marketplace, and I want to open it somehow. I have seen Vai do this while screensharing, but I can't find the right button and there isn't any link to documentation I have googled BAML documentation, and when I click "playground" it just redirects me to promptfiddle I click Guide, and I find what I am looking for: "installation: editors/VS Code"
Copy code
Once you open a .baml file, in VSCode, you should see a small button over every BAML function: Open Playground.
Now, I know that in order to get started I will have to create a .baml file. I already know how to do this, and so I will
I install baml in a new venv Now, I have installed baml in a new venv. I run baml-cli generate. This is familliar. I remember resume.baml, but now I see the "run test" and "run functions" mentioned in the documentation. I click run test. It asks for my API Key. I give it my API key, and click run test again.
Copy code
Error: recursive use of an object detected which would lead to unsafe aliasing in rust
    at IB (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/baml_schema_build.js:2:54832)
    at wasm://wasm/03453d76:wasm-function[14351]:0xb76473
    at wasm://wasm/03453d76:wasm-function[14353]:0xb76490
    at wasm://wasm/03453d76:wasm-function[5390]:0x9fbd6a
    at q.client_name (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/baml_schema_build.js:2:15733)
    at U2I (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/index.js:849:4548)
    at h2 (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/index.js:49:34204)
    at J2 (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/index.js:49:62992)
    at No (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/index.js:49:73602)
    at Uo (https://file+.vscode-resource.vscode-cdn.net/Users/Moof/.vscode/extensions/boundary.baml-extension-0.205.0-darwin-x64/dist/playground/dist/assets/index.js:49:107783)
that's no good
I don't think this is my fault, because I feel like clicking "run test" on an example test is supposed to work
I reload, and run it again. the error is gone. Now, I will attempt to replicate the error.
I cannot replicate it, the test works
Now, I am looking for the test results. In order to use the BAML playground for a REPL like workflow, I will need to be able to see the results, store the results, and manipulate the results. The BAML playground isn't really looking like it does what I was hoping.
Now, I am confused as to the purpose of tests, and why BAML is set up the way that it is. I don't see any asserts in the example test, or any of the other stuff I would expect to see from a useful test. "If BAML playground isn't the REPL of my dreams, what is it?" I wonder? So I go to the docs, curious about the intent behind this system which right now is feeling rather unintuitive and annoying ‎
The docs don't have much in the way of an explanation as to the purposes of these tests, but I do figure out how to view the LLM response, so it's starting to make a little bit more sense. I decide to leave the playground there, as a curiosity that doesn't really satisfy the need I have in my workflow.
‎ now, however, a dangerous dream has been planted in my head. I wonder, "how would it feel to work with BAML inside a jupyterlab environment?" I am thinking of asking Clade for a basic dockerfile, getting that up and running, and just having my whole python project mounted into the container. I reason, "If BAML Playground isn't a REPL, why don't I just go and use a well established REPL that I am familiar with?" ‎
a
thanks for all the feedback! I definitely agree that - Playground crashing bugs are really bad - It's not easy to understand immediately how to assert test outputs, nor how to manipulate the output of a function and transform it/analyze it (as python notebooks do). We should definitely add a bunch of starter examples! - We have some stuff planned on testing workflows that will make things feel super seamless, but we're like a month away from our first release on that aspect