https://www.boundaryml.com logo
🟡 I'm looking to use Baml for the way it handles ...
# questions
q
I'm looking to use Baml for the way it handles structured output streaming, but I'm also wondering if the final output tends to be generated faster than without Baml?
b
We haven't had anyone bring this up as an issue!
So as far as we know, not an issue 🙂
q
Sorry maybe I haven't been clear enough. Forget about streaming. Does Baml make the average response time faster? I was looking at this article: https://boundaryml.com/blog/sota-function-calling?q=0&cmp=latency which the title states about speed. But then the only thing I found is a better Mean TPS (Token per second I assume) and I have a hard time understanding those results. Therefore is it a clear benefit of Baml to produce faster reponses?
b
Short answer: yes
Long answer: BAML makes it easier to define faster LLM functions Model response latency depends on three things: - how big is the underlying model, i.e. how much math does it have to do to produce an answer - how much work has the model provider put into their server infrastructure (e.g. GPU capacity, hot paths) - how big are your prompts and the outputs you're asking for With most other techniques, it's really hard to (1) ask the LLM to respond in a concise way by default and (2) optimize your LLM functions without also updating your app code. The frameworks we've looked at generally waste a lot of your input and output tokens (because the required software to avoid being wasteful is hard to implement) and also result in code that makes it very hard to disentangle "this is the problem I want the LLM to solve" and "this is how I'm implementing my LLM function" (e.g. if you want to switch from asking the LLM for
Resume { name: string }
to
Resume { first_name: string, last_name: string}
you have to update a lot of code and it's kinda bug-prone to do so)
q
Thanks for your answer sam 🙏 . I'm going to give it a shot.
a
they're usually the same these days -- sorry for th elong delay. We haven't benchmarked recently. In general BAML uses less tokens for function calling so it's around the same or less, but we need to run benchmarks again / and more often.