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)