Closed rdaigle007 closed 6 months ago
@rdaigle007 it looks like because Anthropic API returned an emtpy response. What would you like LiteLLM to do here?
(iirc The OpenAI python SDK raises an exception in this scenario too)
I'd assume propagate the empty response back to the client of the proxy.
FOr example, I'm using AutoGen multi-agent application. Such python applications are quite high-level (ie, not calling OpenAI directly), in that you define a number of agents... then you kick them off to solve a problem. SUch an exception from LiteLLM is causing the entire agent chain to break and exit. It's like like I can just catch exceptions at a specific openAI message-send/response and retry.
There will be more and more of these types of high level apps that will break with the way that LiteLLM is handling this.
And CLaude 3 is returning this empty message response quite a bit (and with an http 200 response). Hence would be super useful for LiteLLM to handle this common occurrence from Claude 3 in order to claim compatibility.
I realize this is an edge case, and is a weird behaviour from Claude. However, I've been a protocol developer for decades, and an important tenet of protocol development is to be very forgiving of the response you receive in order to make applications more reliable.
Food for thought. Feel free to close this if you disagree. I will unfortunately need to start looking at other proxy type agents as Claude is one of numerous I need to support.
Regardless, your quick response time was pretty cool, respected, and appreciated.
removed the if-check on our end based on your feedback.
Agreed - litellm shouldn't be causing this issue for your agents
Fix will be live in release later today
What happened?
A bug happened!
Using litellm as proxy, with claude3 as selected LLM.
Config.yaml entry is:
`Russells-MBP-2:litellm russ$ cat claude3-sonnet.yaml model_list:
litellm_settings: set_verbose: True `
First couple claude3 messages work fine. But at some point Claude3 returns back a response with empty content array, and liteLLM doesn't handle this.
The last request/response is in logs below.
Relevant log output
Twitter / LinkedIn details
No response