- Issue created by @jbuttler
This module is great, and I think that a useful feature addition would be to apply rate limits to API interactions.
AI costs can add up quickly. I believe if site builders could limit AI interactions for some users to prevent runaway costs, it may improve adoption of these features. I don't have the coding skills to make such limits, but I hope someone who has the ability likes this suggestion, and considers implementing it into the module! I would be happy to assist testing or any other way I can. I would suggest the following rate limit options to be adjustable for API Interactions:
-----------------------------------------------
- Ensure individual users do not use the API too much
- Role based - Each role could have restrictions for usage.
- User based - Individual users could also be limited if needed.
- Number of interactions / time frame - Ex: 100 interactions per day, Or maybe token based like 200k tokens per day.
- Types of Request / time frame - Ex: Limit to 5 text-to-image requests per day, Or maybe 50 tts requests per month.
- Total usage limit- A maximum usage limit per role or user.
- Combination of the above
- A pair of fields (maybe like a paragraph). One to set the limit, another to set the time frame. Add the ability to add more pairs of fields, just like paragraphs. There could be an admin page for this feature that lists the roles in the system, with an ability to apply the limits from there.
- Add unlimited rate limit options to each entity - Ex: a monthly rate limit, and a daily rate limit could be applied to roles or individual users. Or multiple rate work together to limit the same role or user. This structure would work for many different use cases
- Ex for anonymous: Limit to 100k tokens per day, and 2 images per day.
- Ex for authenticated users: Apply a 200k tokens per hour limit, and 100 images per month total limit.
- Ex for different roles as needed: A different user role of "Blog Writer" could have a limit of 500k tokens per hour, 5 mil tokens per month, and 10 images per day.
Active
1.0
AI Core module