open-webui
open-webui copied to clipboard
enh: open webui built-in usage tracking/limit
Is your feature request related to a problem? Please describe.
I’m requesting a feature to implement usage quotas for OpenAI tokens on a per-user basis, allowing administrators to set a token limit for each user over a customizable period (e.g., 10,000 tokens every 30 days). This would enable fair and efficient usage of OpenAI resources, similar to how platforms like Nextcloud allow administrators to set and manage usage quotas.
Describe the solution you’d like
The feature would allow administrators to configure token usage limits for individual users over a specified timeframe (e.g., per 30 days), with the flexibility to adjust the token limit and the period based on user needs. Key aspects would include:
-
Configurable Token Limit per User Over a Period:
- Admins could set a customizable token usage limit (e.g., 10,000 tokens every 30 days).
-
Usage Tracking and Notification:
- Real-time tracking of token usage, accessible via a dashboard, with notifications for users approaching or exceeding their limit.
-
Admin Dashboard for Monitoring Usage:
- An admin overview of each user’s token consumption, with options to set, modify, or reset limits as needed.
-
Quota Refresh System:
- Automatic reset of quotas at the end of each defined period (configurable in days).
Describe alternatives you’ve considered
An alternative might involve hard-coded usage limits, but these lack the flexibility of adjustable quotas. The Nextcloud model, which offers configurable per-user usage limits, serves as a practical example of how this could work efficiently.
Additional context
Implementing this feature would enhance OpenAI's usability for teams and educational or testing environments by promoting fair usage without overextending resources.
Nextcloud Usage Limit
That is a great idea, but can be more complex than it seems.
For example, we are piping in multiple providers like Anthropic and Google. Just counting tokens is then not enough, because what we really want to control is cost. Every model has different pricing so tokens map very differently to dollars. We also want to make sure that the total cost doesn't exceed a certain limit, not just per model.
Finally, we want to assign credit to each user based on groups, where the total credit would be sum of all their groups' allowances.
To deal with all this, we are working on a tracking toolkit that we intend to make available as a separate library. Feel free to check it out, if you need some more advanced controls. It's still very early in development and not actually functional, yet:
https://github.com/dartmouth/openwebui-token-tracking
This might be useful: https://docs.litellm.ai/docs/proxy/cost_tracking
any plan for this?
Finally here we report all tracing with litellm and Langfuse , they have good integration with open webui What is missing is the conversion in the terms of energy cost
Le mar. 11 févr. 2025, 11:16, Daniele Scasciafratte < @.***> a écrit :
any plan for this?
— Reply to this email directly, view it on GitHub https://github.com/open-webui/open-webui/issues/6692#issuecomment-2650362086, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKZRFG7HBD5AOQWJZFFCQD2PHEZVAVCNFSM6AAAAABRD65ICCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJQGM3DEMBYGY . You are receiving this because you commented.Message ID: @.***>
Token usage limit is not enough, we need credit limit, thanks!
+1
Finally here we report all tracing with litellm and Langfuse , they have good integration with open webui What is missing is the conversion in the terms of energy cost
Le mar. 11 févr. 2025, 11:16, Daniele Scasciafratte < @.***> a écrit : …
Agree, except API usage it not logged, just the web call.
So for up-to-date pricing info check out: https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json Which litellm themselves download from https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json when you include their library.
Also be aware that the semantics of what is "input" vs "cached" is somewhat different between openai and anthropic when using "usage_metadata"
I wish we had a clean library for just cost calculation across vendors, but I'm not seeing one.
Any updates on this topic? It's an excellent idea.
That's song good but If I do understand, you are going to re implement inference tracking limit inside open webui even if it is already well done in LiteLLM which is already fully compatible with Openwebui. To my point of view there is another tracking limit which seems more relevant to open webui the one on disk usage for knowledge base and note. RAG feature is really well implemented in Open Webui, thanks to Openwebui team for that! It is a key differenciator. I have tried to put some idea here. Feature Request: Admin-Defined Quotas for Knowledge Bases and Notes with Usage Insights and Cleanup Tools #15674 . It is just an idea to extend tracking usage in both directions inference and disk usage. And to be more disruptive, open Webui could be the first one to enable energy/carbon tracking by weighting token inference with model size and GPU with ecologist library.