mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[GH-ISSUE #21] feat: track the cost associated with each user #7
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @changchiyou on GitHub (Apr 10, 2024).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/21
Is your feature request related to a problem? Please describe.
Currently, it's challenging to track the cost associated with each user.
Describe the solution you'd like
<litellm>/key/generateAPI.LiteLLMmodels using their unique API keys.Describe alternatives you've considered
open-webui(hosted web) account for user and retrieves<litellm>/key/generateapi using the email addressAdditional context
Reference:
@tjbck commented on GitHub (Apr 10, 2024):
Related: open-webui/pipelines#20, we should try to add this feature to the rest of our proxy servers as well.
@max00346 commented on GitHub (May 15, 2024):
This would also solve my Feature-Request: open-webui/open-webui#1320
@ghost commented on GitHub (May 28, 2024):
@changchiyou do you want to create a key per user?
LiteLLM also allows for tracking by the 'user' param in
/chat/completions-https://docs.litellm.ai/docs/proxy/users
@changchiyou commented on GitHub (May 28, 2024):
@krrishdholakia Does the method you provide, which uses
userinstead of an API key to track users, require additional manual adjustments/settings on the Open WebUI? I observed that Open WebUI does not send out the user parameter by default:github.com/open-webui/open-webui@d43ee0fc5b/src/routes/(app)/%2Bpage.svelte#L602-L666and the logs in LiteLLM show that the
useris alwaysdefault_user_id:@juancarlosm commented on GitHub (May 30, 2024):
same problem here! We are unable to track costs per user:
@juancarlosm commented on GitHub (May 30, 2024):
If it helps, a dirty hack in backend/apps/[openai|litellm]/main.py at proxy function:
_tmp = json.loads(body)
_tmp['user'] = user.email
body = json.dumps(_tmp)
And now I can see the right user at langfuse:
@juancarlosm commented on GitHub (Jun 28, 2024):
https://github.com/open-webui/open-webui/discussions/3494