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

Bedrock token usage #3884

Closed
2 tasks
themrzmaster opened this issue Oct 2, 2023 · 5 comments
Closed
2 tasks

Bedrock token usage #3884

themrzmaster opened this issue Oct 2, 2023 · 5 comments
Labels
feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged.

Comments

@themrzmaster
Copy link

themrzmaster commented Oct 2, 2023

Describe the feature

I can not find a way of getting the token usage for a given request using Claude.

The token count is an important metric to monitor and log for LLM usage.

Use Case

Calculating cost of a request, limit usage, etc.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

boto3-1.28.57 botocore-1.31.57

Environment details (OS name and version, etc.)

linux

@themrzmaster themrzmaster added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2023
@github-actions
Copy link

github-actions bot commented Oct 2, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@mrtj
Copy link

mrtj commented Nov 6, 2023

@themrzmaster could you tell us how is this feature implemented/completed?

@themrzmaster
Copy link
Author

@isunli
Copy link

isunli commented Apr 25, 2024

Should reopen this issue since Bedrock supports other foundation models, we need an aws api to get accurate token usage.

@krrishdholakia
Copy link

@isunli the response headers return the usage - just get it from there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants