https://www.boundaryml.com logo
I love the idea of this project, it's
# suggestions
a
I love the idea of this project, it's awesome. Two notes from a super fresh onboarding experience. - I don't like spending money testing all the new tools like BAML so I like to test with Ollama models first. It also tells me how the tools behave with weaker, worse models and responses. I was getting a parse error running the test in VSCode on a a simple Ollama Llama 3.2 client for the resume example from the init. I got it working after figuring out that BAML was using the system prompt only by default. Which leads to nil output from Ollama. I changed to
Copy code
function ExtractResume(resume: string) -> Resume {
  // Specify a client as provider/model-name
  // you can use custom LLM params with a custom client name from clients.baml like "client CustomHaiku"
  client CustomOllama
    Your response must be valid JSON, and should not include any Markdown formatting or extra text. Only provide the JSON object.

    {{ _.role("user") }}

    Extract from this content:
    {{ resume }}

    {{ ctx.output_format }}
  "#
}
and it all worked perfectly. But the debugging to get there required me to get the raw curl and get into my terminal even though I was using the extension. Maybe not optimizing for Ollama but at least making the entry point of the example code better for someone testing it out with Ollama, might not be a bad idea. (Like mentioning in the docs that Ollama needs to be
"http://localhost:11434/v1"
too with the v1.
- The other note is that with GoLang I like to keep my toolchain and the generated code in sync using
go tool baml-cli
for instance. But it doesn't seem like the VSCode configuration allows for that other than also keeping an install of the baml-cli in the GOBIN.
a
Thanks so much for the feedback. We will implement fixes for this, and make sure it works out of the box for local models. My guess is your ollama instance doesnt accept all origin domains (like our vscode browser extension), resulting in cors issue.
For Go, cc @Vaibhav (BAML 🐑) whos the lead there
a
@aaronv (BAML) fwiw the raw curls were working but just were returning empty content.
Copy code
curl -X POST 'http://localhost:11434/v1/chat/completions' ... -d "{
  \"model\": \"llama3.2\",
  \"messages\": [
    {
      \"role\": \"system\",
      \"content\": \"Extract from this content:\nVaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\nAnswer in JSON using this schema:\n{\n  name: string,\n  email: string,\n  experience: string[],\n  skills: string[],\n}\n\n\"
    }
  ]
}"
{...,"choices":[{"index":0,"message":{"role":"assistant","content":""}, ...}
thanks for responding so quick!
v
That’s for the feedback on go tool! I’ll check that out and see how we can integrate it