mem0 icon indicating copy to clipboard operation
mem0 copied to clipboard

Retrieve token usage from LLMs requests

Open fabioferreira3 opened this issue 2 years ago • 2 comments

🚀 The feature

Retrieve the token usage from LLMs requests like prompt, completion, and total number of tokens. Currently embedchain only returns the raw message from LLMs.

Motivation, pitch

Since many paid LLMs charge by token usage, it is hard to predict and calculate the costs of using embedchain with a LLM like OpenAI. We might need to calculate costs per customer, for example, and better control the usage of product.

fabioferreira3 avatar Oct 26 '23 10:10 fabioferreira3

Up

jrobertogram avatar Jan 01 '24 16:01 jrobertogram

hey @jrobertogram thanks for highlighting this. We will get back shortly here.

taranjeet avatar Jan 01 '24 16:01 taranjeet