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

Return tokens count/cost for checks #656

Open
ssaha1567 opened this issue Mar 20, 2024 · 1 comment
Open

Return tokens count/cost for checks #656

ssaha1567 opened this issue Mar 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ssaha1567
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

As a user of the API, I often need to keep track of the number of tokens consumed with each API call to perform a certain check(e.g, RESPONSE_COMPLETENESS). Currently, there is no straightforward way to obtain this information from the API response. Therefore, I propose adding a feature to include the number of tokens used in the API response payload.

Describe the solution you'd like
A clear and concise description of what you want to happen.

It might be useful to return the number of tokens consumed while performing a certain check. For example when the check for RESPONSE_COMPLETENESS is performed, include a field to indicate what was token consumption:

{
      "score_response_completeness": ...,
      "explanation_response_completeness": "...",
      # new field to add
      "tokens_used_response_completeness": ".."
      "cost_response_completeness": ".."
 }

The thing is, in the end, I'm interested in knowing the cost of evaluation. If you can do the cost computation internally and just return that, then I won't need the token consumption information. If not, return the token consumption in that case, so that we can calculate the cost on our end. It is not very clear how many LLM calls are made for performing a certain check. So the tokens count returned should actually reflect the total number of tokens used combining all the calls that the backend makes for performing a certain check.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Thank you for your feature request - We love adding them

@ssaha1567 ssaha1567 added the enhancement New feature or request label Mar 20, 2024
@ashish-1600
Copy link
Collaborator

Thanks @ssaha1567 for raising this issue. We will take this as a part of our next release. We will keep you posted on this.

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

No branches or pull requests

2 participants