feat: Implement USD limits per time period per user
Feature Request: Per-User Monthly Spending Limits
Description:
I appreciate the global request limits added in Issue #20. However, I need the ability to set customizable monthly spending limits per user.
Use Case:
I want to give my family and friends access to LLMs through Open WebUI, but I need to control costs by limiting how much each user can spend per month in USD.
Potential Solutions and Considerations:
-
Per-User Spending Limits:
- Allow setting individual monthly spending caps for each user.
-
Cost Estimation:
- Since determining the exact cost per model usage can be challenging, consider using heuristics such as:
- Estimating costs based on token usage or number of requests.
- Assigning a fixed cost per action or session.
- Since determining the exact cost per model usage can be challenging, consider using heuristics such as:
-
Alternative Approaches:
- Implement per-user limits on usage metrics like tokens or requests, which correlate with costs.
Benefits:
- Helps manage and predict overall spending.
- Enables sharing access with others without unexpected expenses.
Thank you for considering this feature request.
can we just create a pipeline for this (not a filter, but a pipe), one that will add delays instead of raising an exception when the limit is exceeded.
@FarisHijazi I don't think delaying is reasonable on the timescale of months suggested by @NightMachinery. What you describe sounds more like (the usual) rate limiting, which in my opinion is a separate issue.
Has the rate-limiting feature been implemented?