Skip to content

feat: add inference request and received time in FlowControlRequest#2475

Merged
k8s-ci-robot merged 3 commits into
kubernetes-sigs:mainfrom
loicmarchal:feature/add-req-headers-to-flowcontrolrequest
Mar 9, 2026
Merged

feat: add inference request and received time in FlowControlRequest#2475
k8s-ci-robot merged 3 commits into
kubernetes-sigs:mainfrom
loicmarchal:feature/add-req-headers-to-flowcontrolrequest

Conversation

@loicmarchal

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Extends the information available in the FlowControlRequest. These information will be useful for specific ordering policies, such as a SLO-based policy

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Mar 4, 2026
@netlify

netlify Bot commented Mar 4, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 9173f5b
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/69a9e26559a00500080e45e0
😎 Deploy Preview https://deploy-preview-2475--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 Mar 4, 2026
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @loicmarchal. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 4, 2026
@loicmarchal

Copy link
Copy Markdown
Contributor Author

@LukeAVanDrie this is the changes I mentioned to prepare for a SLO-based ordering policy.

@loicmarchal
loicmarchal marked this pull request as ready for review March 4, 2026 04:49
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 4, 2026
@k8s-ci-robot
k8s-ci-robot requested a review from kfswain March 4, 2026 04:49

@LukeAVanDrie LukeAVanDrie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM -- thanks!

Comment thread pkg/epp/requestcontrol/admission.go Outdated
fairnessID: reqCtx.FairnessID,
priority: priority,
requestByteSize: uint64(reqCtx.RequestSize),
reqHeaders: reqCtx.Request.Headers,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@LukeAVanDrie I am wondering if we should unify the request related state on LLMRequest (and its future successor InferenceRequest?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, that will also work and may be ultimately cleaner for the Flow Control layer. Do we want to do that here or in a follow-up? For example this means we can roll the priority field into LLMRequest.RequestObjectives too. I don't want to push that cleanup/simplification work onto this PR though. I can take that on as a no-op refactoring effort later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As an aside, one thing I did try to do in the Flow Control layer is ensure that any plugin author only has read-only access to request / flow / priority band state. If we embed this LLMRequest we leak a mutable pointer reference to the policies, but I also understand if you are not concerned about being overly defensive here in the pursuit of streamlining our types.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @loicmarchal !

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ahg-g @LukeAVanDrie I replaced the headers by the LLMRequest that also contain the headers. Does that work as a preliminary step to include a more generic InferenceRequest suggested in #2447 later?
I left some of the accessor functions such as ID() and TargetModelName(), although we could access those info from the request itself, to not change the contract too much. Is this ok or should it be refactored?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm okay with this for now. I am happy to do that in a follow-up to not muddy this PR with a ton of mock / test changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you @LukeAVanDrie !
If you think it should be done, I don't mind cleaning up the code and the mock / test as part of this PR. Let me know what you think is best.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 4, 2026
@loicmarchal

Copy link
Copy Markdown
Contributor Author

@ahg-g @LukeAVanDrie are we ok with these changes? Can we merge this or should we do the clean up mentioned in #2475 (comment) first?

@loicmarchal loicmarchal changed the title feat: add request headers and received time in FlowControlRequest feat: add inference request and received time in FlowControlRequest Mar 5, 2026
@nirrozenbaum

nirrozenbaum commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test
/lgtm

leaving final stamp for @ahg-g.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 5, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 5, 2026
@ahg-g

ahg-g commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, loicmarchal, LukeAVanDrie

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2026
@k8s-ci-robot
k8s-ci-robot merged commit 51f77b3 into kubernetes-sigs:main Mar 9, 2026
11 checks passed
@loicmarchal
loicmarchal deleted the feature/add-req-headers-to-flowcontrolrequest branch March 9, 2026 15:21
RyanRosario pushed a commit to RyanRosario/gateway-api-inference-extension that referenced this pull request Mar 9, 2026
…ubernetes-sigs#2475)

* feat: add request headers and received time in FlowControlRequest

* replace headers by LLMRequest from scheduling layer
zetxqx pushed a commit to zetxqx/gateway-api-inference-extension that referenced this pull request Mar 11, 2026
…ubernetes-sigs#2475)

* feat: add request headers and received time in FlowControlRequest

* replace headers by LLMRequest from scheduling layer
BizerNotNull pushed a commit to BizerNotNull/gateway-api-inference-extension that referenced this pull request Mar 15, 2026
…ubernetes-sigs#2475)

* feat: add request headers and received time in FlowControlRequest

* replace headers by LLMRequest from scheduling layer
RishabhSaini pushed a commit to RishabhSaini/gateway-api-inference-extension that referenced this pull request Apr 9, 2026
…ubernetes-sigs#2475)

* feat: add request headers and received time in FlowControlRequest

* replace headers by LLMRequest from scheduling layer
elevran pushed a commit to llm-d/llm-d-router that referenced this pull request Apr 23, 2026
…ubernetes-sigs/gateway-api-inference-extension#2475)

* feat: add request headers and received time in FlowControlRequest

* replace headers by LLMRequest from scheduling layer
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants