Skip to content
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

Monitor usage per user - Include the token count in the data stored in the DB #376

Open
NorEliYehShi opened this issue Nov 9, 2023 · 2 comments

Comments

@NorEliYehShi
Copy link

I would like to suggest a potential enhancement that could improve the monitoring of user activity.

Currently, the system saves each conversation in the Azure Cosmos DB, this is a great feature, but I believe it could be further improved by also storing the count of tokens used in each conversation.

The GPT model sends the token count with each response in the following format:

"usage": {
"prompt_tokens": 23,
"completion_tokens": 9,
"total_tokens": 32
}
By storing the total_tokens data in the Azure Cosmos DB, we could gain a better understanding of how each user is utilizing the chat. This could be particularly useful for monitoring purposes, as it would allow us to track the usage of the chat for each user more effectively.

I hope you find this suggestion useful. Thanks

@gopi-hl
Copy link

gopi-hl commented Nov 16, 2023

This one is tricky to implement for streaming chat completions, since this data is not passed back from the API. We'll need to compute it approximately using a tokenizer.

@kdcllc
Copy link

kdcllc commented Dec 20, 2023

@gopi-hl any suggestions on how to get this going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants