https://www.boundaryml.com logo
max-time-to-token
# suggestions
b
Feature request: In the fallback/round robin clients, add an optional "max-time-to-token" or "max-response-time" that considers the model in the call stack a failure if it takes too long. I've found that many providers have massive hang times before sending a 429 (on vertex yesterday I saw a 9 second pause before responding). At that point I'd like to move to the next model in my fallback
g
I like this idea. Made a ticket: https://github.com/BoundaryML/baml/issues/2536
b
Hey @greg (BAML) just checking in, is this slated for any upcoming sprints?
g
Hey @benepstein . I'm going to take a crack at this today. There's a related ticket: https://github.com/BoundaryML/baml/issues/1630
Do you have any thougts about that ticket? Especially about the importance of having fine-grained control over connection/first-token/idle/total timeouts?
b
I think time to first token and total are both very useful. I could see wanting that timeout to be different on a function level instead of a client level, because some functions are more complex and have longer outputs. But I could also imagine that would be extremely complex on your end, and the simple workaround is to just create new clients. In my case I’d likely just configure it to say “here’s my fallback chain, if the client takes more than 200ms for the first token, or more 2 seconds total, cancel and go to the next one.
g
Cool, thanks!
Yes, function-spceific timeouts would be complicated, but I'll see if we can do this in a way that client registry can override.
"first token" - should that include thinking tokens? Or you want the time-to-first-parsable-token? (In other words, do you want to fail your request if a model thinks too much)
b
thats a great question
i generally turn off thinking entirely so i'm a biased user, for me it's first usable token
the 'job to be done' for me, as a user, is: Is the LLM provider I'm using down right now? I need to know asap (2seconds). If it's down, fail fast and try my next provider. This is for our realtime product, so when a request doesnt come back fast I need to know about it