-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track usage per user #49
Conversation
Changed PR to WIP, will add Dall-E and Whisper usage tracking later today. Releasing with only chat usage tracking would lead to compatibility issues of the user JSON files between versions. |
Looking good @AlexHTW! Let me know when it's ready for review |
updated README with new features removed unecessary logging
… implementation of audio and image usage tracking
0a0ac66
to
896b09f
Compare
added total cost return finalized /stats command
Hey @n3d1117 , |
This is amazing! Thanks @AlexHTW |
Great improvement! How can I, as an admin, use it to view the statistics for each user? |
Thanks @GuillaumeMoscou! * if you're using the docker image, here are some suggestions how to have a look at files inside |
Thank you very much, this fulfills my needs. An enhancement would be to have access to it through a command, such as /stat_users (only available for the admin chat). As for the type of information, it would be the number of tokens for the past month and the last three days. Personally, I don't look at the cost, so that information wouldn't be useful to me. |
Happy to hear the log files are sufficient for now. |
Total tokens of each request are stored along with their date information in a JSON file per user.
A user can retrieve their current daily and monthly total token usage and the implied $-cost using the /stats command.
The feature can be used to split costs with the users (fairly) or just to inform each user of their usage.
Looking forward to your feedback on the idea and the implementation!
The next step would be to include a way for the admin to retrieve the daily/monthly information for any user. I think it would be enough to log it (maybe at program start?).
A further feature I am planning with this is to add the option of (daily/monthly) token usage limits per user. This would give the admin complete control of the costs, allow him to invite less trusted users and finally also sell token "credit".
Of course, for the final vision the costs of Dall-E and Whisper requests also need to be tracked.