https://www.boundaryml.com logo
🟡 Question About Using BAML for Templating and Pa...
# questions
c
Hi, is it possible to use BAML only for templating and parsing if I want to handle the LLM calls myself?
v
yes! you can use our modular api
from @bammy Yes! BAML provides a lower-level API that lets you handle the LLM calls yourself while still using BAML for templating and parsing. You can access the HTTP request before sending it and use your own HTTP client (like requests in Python or fetch in Node.js) to make the API calls. Then you can use BAML's parser to handle the response. For specific implementation details, I'd recommend checking out the docs or asking in the BAML Discord server. https://docs.boundaryml.com/guide/baml-advanced/modular-api
c
Thanks that is super helpful!
v
btw out of curiosity, is there something you're trying to do by owning the llm call yourself?
c
I am trying to have LLM invoke multiple tools continuously during streaming, but I don't want to tool calls to interrupt the flow (so in essence it just triggers the tool and perform some side effects and don't need to reprompt). And also my project is already using langfuse for observability, so looking to keep using their wrapper
v
that makes total sense 🙂