Skip to content

remove Model field from LLMRequest #782

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nirrozenbaum
Copy link
Contributor

@nirrozenbaum nirrozenbaum commented May 5, 2025

This PR removes the Model field from Scheduling.LLMRequest struct.
from the scheduler point of view, it doesn't care about the original requested model name, only about the resolved model after traffic splitting that was done in a higher level.
we can see that Model field was used in unit-tests only and that it's always set to be identical to ResolvedTargetModel. Scheduler doesn't use this field.

In addition to removing Model field from LLMRequest struct, this PR renames ResolvedTargetModel to TargetModel in LLMRequest from the same reasons. scheduler plugins don't care about traffic splitting and "resolved" model, only about what is target model.

unit-tests and other usage places were updated accordingly.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 5, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nirrozenbaum
Once this PR has been reviewed and has the lgtm label, please assign ahg-g for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from ahg-g and robscott May 5, 2025 06:06
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 5, 2025
@nirrozenbaum
Copy link
Contributor Author

cc @kfswain

Copy link

netlify bot commented May 5, 2025

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

Name Link
🔨 Latest commit 4313476
🔍 Latest deploy log https://app.netlify.com/sites/gateway-api-inference-extension/deploys/6818557264dd2500086f8779
😎 Deploy Preview https://deploy-preview-782--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 site configuration.

@LukeAVanDrie
Copy link

LukeAVanDrie commented May 5, 2025

I am working on the Flow Controller POC. We currently enforce the dispatch policy (for fairness) by model, not resolved target model. I will either need to use a different type when enqueuing a request than LLMRequest or will need model to remain as a field on this struct.

The Flow Controller is not tightly coupled to the Scheduler, so either approach is fine.

@nirrozenbaum
Copy link
Contributor Author

I am working on the Flow Controller POC. We currently enforce the dispatch policy (for fairness) by model, not resolved target model. I will either need to use a different type when enqueuing a request than LLMRequest or will need model to remain as a field on this struct.

The Flow Controller is not tightly coupled to the Scheduler, so either approach is fine.

@LukeAVanDrie thanks for bringing this up.
can you elaborate on what other fields you have in Flow Controller? (do you have a link to your git branch?)
I mean, do you have a subset of the fields that are used in both? do you have additional fields that are not used in Scheduler and you need in Flow Control?

Ideally, each layer should get the data it needs for its mission, and only that.
if there is a complete match (with the exception of Model field) then sure, let's leave it as is.
but I suspect you might need only parts of the fields or additional fields

@kfswain
Copy link
Collaborator

kfswain commented May 5, 2025

but I suspect you might need only parts of the fields or additional fields

To my understanding, @LukeAVanDrie needs the Model name, as that is the unique identifier we currently use to separate one 'use case' from another.

Ideally, each layer should get the data it needs for its mission, and only that.
Completely agreed here. That is the endstate


reqCtx.Model = llmReq.Model
reqCtx.ResolvedTargetModel = llmReq.ResolvedTargetModel
reqCtx.Model = model
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to hold off on any changes to this file until: #781 merges, I do quite a bit of this same refactoring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/hold until #781 is merged

@LukeAVanDrie
Copy link

@LukeAVanDrie thanks for bringing this up. can you elaborate on what other fields you have in Flow Controller? (do you have a link to your git branch?) I mean, do you have a subset of the fields that are used in both? do you have additional fields that are not used in Scheduler and you need in Flow Control?

A subset (model, criticality) and some new fields: a reference to the request prompt size in bytes and a reference to the request context.

Ideally, each layer should get the data it needs for its mission, and only that. if there is a complete match (with the exception of Model field) then sure, let's leave it as is. but I suspect you might need only parts of the fields or additional fields

This is a good point. I have removed my dependency on scheduling.LLMRequest and am defining my own type for the FlowController input. My POC's fate is no longer tied to this PR.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

4 participants