-
Notifications
You must be signed in to change notification settings - Fork 180
Add LLMResponse object and RequestId to LLMRequest #799
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
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shmuelk The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @shmuelk. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
} | ||
|
||
func NewSchedulingContext(ctx context.Context, req *LLMRequest, pods []Pod) *SchedulingContext { | ||
func NewSchedulingContext(ctx context.Context, req *LLMRequest, resp *LLMResponse, pods []Pod) *SchedulingContext { |
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.
This param is nil in all the places it's called. It's also a exported field, perhaps the New
func should just initialize the LLMResponse
struct? And any consumer can populate or replace the field as needed.
(Completely out of scope of this PR, but I would like to move away from LLM
naming, a lot of this code can be generalized to Inference
, LLMs are just the current focus)
// LLMResponse contains information from the response received to be passed to plugins | ||
type LLMResponse struct { | ||
// RequestId is the Envoy generated Id for the request being processed | ||
RequestId string |
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.
I'm on the fence if there should be a dedicated field for this, we could put this in the Headers
map, or check to see if it's already there, and then populate.
This PR adds a LLMResponse struct, similar in idea to the LLMRequest struct for use in response handling. It will be used in a future PR that adds PostResponse plugin support.
The LLMResponse struct contains the request Id, the received response headers, the body received, a flag indicating whether or not the model is streaming results, and a flag indicating whether or not all of the response body has been received. These latter three fields will be used in the future when there is PostResponse processing of the response body.
In a future PR:
The new Scheduler OnResponse API receives a LLMResponse struct in a way similar to the way scheduler Schedule gets a LLMRequest object.
This PR is laying foundations for the future PR that adds the PostResponse support.
In addition this PR adds a RequestId to the LLMRequest struct to allow plugins to cache internally information specific to a particular request.
This is the first PR in a series to add support for PostResponse