-
Notifications
You must be signed in to change notification settings - Fork 188
Add prompt_cached_tokens metrics from each response. #1814
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
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/assign @liu-cong |
|
/approve |
pkg/epp/metrics/metrics.go
Outdated
|
|
||
| // RecordPromptCachedTokens records prompt cached tokens count. | ||
| func RecordPromptCachedTokens(modelName, targetModelName string, size int) { | ||
| if size > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why checking this? Isn't 0 a valid value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, added emitting zero, please take another look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kfswain, liu-cong, zetxqx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR introduces a new histogram metric, inference_objective_prompt_cached_tokens, to provide visibility into the
effectiveness of the vLLM prefix caching feature.
The key changes include:
non-streaming and streaming responses. If the field is not present in a response, no metric is recorded for that request,
ensuring data accuracy
Which issue(s) this PR fixes:
Fixes partially #1304
Does this PR introduce a user-facing change?: