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
14.11k stars 1.67k forks source link

[Docs] Update Budget Manager point to LiteLLM Proxy #2094

Open ishaan-jaff opened 9 months ago

hoang-innomize commented 7 months ago

@ishaan-jaff BudgetManager is one of feature I am looking to add to my project, however, when I deploy Proxy UI locally, I am not able to use hosted type because the API endpoint is out of date. I am looking to see whether we have any plan to change the BudgetManager to be able to work with the hosted LiteLLM Proxy

ishaan-jaff commented 7 months ago

Hi @hoang-innomize - we support end user cost tracking on the proxy server https://docs.litellm.ai/docs/proxy/users

I'd love to better understand the issue - are you free for a call this week ? If you can send your email I can send an invite

Link to my cal for your convenience: https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version?month=2023-10

My linkedin: https://www.linkedin.com/in/reffajnaahsi/

hoang-innomize commented 7 months ago

@ishaan-jaff The issue I am facing is the API endpoint to get budget is out of date

"POST /get_budget HTTP/1.1" 404 Not Found

I am running Proxy UI using docker image ghcr.io/berriai/litellm:main-latest. When I view the Swagger there is no API endpoint mentioned above. I believe we need to update https://github.com/BerriAI/litellm/blob/539393070182c59b407dc0187dfbf2a791d6f811/litellm/budget_manager.py#L54

rahulvbrahmal-sigtech commented 7 months ago

Hi,

I am experiencing the same issue as well unfortunately. I've tried running the Dockerfile (tagged at ghcr.io/berriai/litellm-database:main-latest) and using the litellm --config <file_name.yml>, but am unfortunately getting the same issue, where the get_budget endpoint DNE. I've looked through the BudgetManager class as well and seen the reference to the link.

hoang-innomize commented 6 months ago

@rahulvbrahmal-sigtech when using proxy, we basically we don't need to use BudgetManager at all, if the user limit is reached, we will get an exception. The proxy handle everything including the budget control.

However, we have a feature that we need to send alerts to users with custom code, we need to figure out a way to get the budget per user/key, right now I can see we can call GET user/info API, but not sure whether whether we have alternative ways. Much appreciated if you can share some guidances @ishaan-jaff