Skip to content

extproc: initial implementation#50

Merged
mathetake merged 8 commits intomainfrom
initialexptorcimpl
Dec 27, 2024
Merged

extproc: initial implementation#50
mathetake merged 8 commits intomainfrom
initialexptorcimpl

Conversation

@mathetake
Copy link
Copy Markdown
Member

@mathetake mathetake commented Dec 25, 2024

This scaffolds and implements the initial logic based on the
current API. Notably, I intentionally organized the extproc code
in a way that it is decoupled from EG concepts as well as the
AI Gateway API level constructs. The rationale is that it not only
allows us to test the extproc without relying on not only EG/AIG
and even without kubernetes at all, but also some users are asking
for the use of outside the ai-gateway projects.

As for the implementation, there's nothing special going on, and
it is simply mostly migrated from the MVP with the decoupling in mind.

I will follow up with the end-to-end test in subsequent PRs.

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake
Copy link
Copy Markdown
Member Author

the left is routing code, but almost there!

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake mathetake requested a review from a team December 25, 2024 07:09
@mathetake mathetake marked this pull request as ready for review December 25, 2024 07:09
@mathetake
Copy link
Copy Markdown
Member Author

nothing special going on as I described in the PR description, so I need a rubber stamping i guess 😉

@mathetake
Copy link
Copy Markdown
Member Author

FYI @nacx

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

prefer to move this out of internal.

BackendRoutingHeaderKey string `yaml:"backendRoutingHeaderKey"`
// Rules is the routing rules to be used by the external processor to make the routing decision.
// Inside the routing rules, the header ModelNameHeaderKey may be used to make the routing decision.
Rules []RouteRule `yaml:"rules"`
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.

Why the rules are configured in the extproc configmap ?

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.

these rules are expect to be updated quite frequently as users add or remove models endpoints, or we are translating the LLMroute to the config for extproc ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

or we are translating the LLMroute to the config for extproc ?

yes, this is because of the requirement about not restarting the extproc on the LLMRoute/etc updates

Backends []Backend `yaml:"backends"`
}

// Backend corresponds to LLMRouteRuleBackendRef in api/v1alpha1/api.go
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.

If I understand correctly the goal here for the config is not intended to be tied with AI concepts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

well, I think not exactly - I assume this will have a semantics-caching, prompt guard etc happening in extproc

Copy link
Copy Markdown
Contributor

@yuzisun yuzisun left a comment

Choose a reason for hiding this comment

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

left some comments but good to merge to iterate based on this initial implementation

@mathetake mathetake merged commit a77bfc2 into main Dec 27, 2024
@mathetake mathetake deleted the initialexptorcimpl branch December 27, 2024 01:28
This was referenced Dec 27, 2024
mathetake added a commit that referenced this pull request Dec 27, 2024
Follow up on
#50 (comment)

Signed-off-by: Takeshi Yoneda <[email protected]>
mathetake added a commit to mathetake/ai-gateway that referenced this pull request Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants