BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
13.8k stars 1.63k forks source link

[Bug]: Update Key DB Call failed to execute - can only concatenate str (not "int") to str #6641

Open xingyaoww opened 5 days ago

xingyaoww commented 5 days ago

What happened?

I was running litellm-proxy ghcr.io/berriai/litellm:main-v1.52.0.dev20, and got the following errors

Relevant log output

litellm-7c566b99f6-lnxmz litellm Traceback (most recent call last):
litellm-7c566b99f6-lnxmz litellm   File "/usr/local/lib/python3.11/site-packages/litellm/proxy/proxy_server.py", line 1015, in _update_team_db
litellm-7c566b99f6-lnxmz litellm     raise e
litellm-7c566b99f6-lnxmz litellm   File "/usr/local/lib/python3.11/site-packages/litellm/proxy/proxy_server.py", line 995, in _update_team_db
litellm-7c566b99f6-lnxmz litellm     response_cost
litellm-7c566b99f6-lnxmz litellm TypeError: can only concatenate str (not "float") to str
litellm-7c566b99f6-lnxmz litellm Task exception was never retrieved
litellm-7c566b99f6-lnxmz litellm future: <Task finished name='Task-562891' coro=<update_cache() done, defined at /usr/local/lib/python3.11/site-packages/litellm/proxy/proxy_server.py:1060> exception=TypeError("unsupported operand type(s) for +: 'float' and 'str'")>
litellm-7c566b99f6-lnxmz litellm Traceback (most recent call last):
litellm-7c566b99f6-lnxmz litellm   File "/usr/local/lib/python3.11/site-packages/litellm/proxy/proxy_server.py", line 1290, in update_cache
litellm-7c566b99f6-lnxmz litellm     await _update_key_cache(token=token, response_cost=response_cost)
litellm-7c566b99f6-lnxmz litellm   File "/usr/local/lib/python3.11/site-packages/litellm/proxy/proxy_server.py", line 1096, in _update_key_cache
litellm-7c566b99f6-lnxmz litellm     new_spend = existing_spend + response_cost
litellm-7c566b99f6-lnxmz litellm                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
litellm-7c566b99f6-lnxmz litellm TypeError: unsupported operand type(s) for +: 'float' and 'str'
litellm-7c566b99f6-lnxmz litellm INFO:     10.5.0.3:35606 - "POST /chat/completions HTTP/1.1" 200 OK
litellm-7c566b99f6-klhwt litellm INFO:     10.5.0.3:48558 - "POST /chat/completions HTTP/1.1" 200 OK
litellm-7c566b99f6-lnxmz litellm 16:47:51 - LiteLLM Proxy:ERROR: proxy_server.py:951 - Update Key DB Call failed to execute - can only concatenate str (not "int") to str

Twitter / LinkedIn details

No response

ishaan-jaff commented 5 days ago

Can you share the curl request you sent ?