Skip to content

Conversation

nirrozenbaum
Copy link
Contributor

Up until today, a scorer may return any float value even though the documentation specifies the valid range is [0,1].
This PR adds normalization function to validate the range is not exceeded.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 322c8a8
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6888f35efeab990008bf9285
😎 Deploy Preview https://deploy-preview-1236--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 26, 2025
@k8s-ci-robot k8s-ci-robot requested review from danehans and kfswain July 26, 2025 19:07
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 26, 2025
Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
}
}

func normalize(score float64) float64 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if we are just going to set hard limits on values, lets name this function differently. True normalization would operate differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[True normalization would operate differently.](nit: if we are just going to set hard limits on values, lets name this function differently. True normalization would operate differently.)

you're right. I didn't have a good naming idea for this purpose. any good idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to enforceScoreRange. not sure about the name selection but I have no better idea atm.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, or applyScoreLimiting something like that. Normalize was just misleading

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your name sounds better 🙂.
will update

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
@kfswain
Copy link
Collaborator

kfswain commented Jul 29, 2025

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kfswain, nirrozenbaum

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:
  • OWNERS [kfswain,nirrozenbaum]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 66cad8c into kubernetes-sigs:main Jul 29, 2025
9 checks passed
kfswain pushed a commit to kfswain/llm-instance-gateway that referenced this pull request Jul 31, 2025
…rnetes-sigs#1236)

* normalize score to make sure score is always in the range of [0,1]

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

* code review commentsx

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>

---------

Signed-off-by: Nir Rozenbaum <nirro@il.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants