-
Notifications
You must be signed in to change notification settings - Fork 121
feat: make prefix of endpoints configurable #1514
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
base: main
Are you sure you want to change the base?
feat: make prefix of endpoints configurable #1514
Conversation
Signed-off-by: ayush <ayush.sawant@nutanix.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1514 +/- ##
==========================================
+ Coverage 83.92% 83.98% +0.05%
==========================================
Files 144 144
Lines 12668 12705 +37
==========================================
+ Hits 10632 10670 +38
+ Misses 1421 1419 -2
- Partials 615 616 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: ayush <ayush.sawant@nutanix.com>
Signed-off-by: ayush <ayush.sawant@nutanix.com>
Signed-off-by: ayush <ayush.sawant@nutanix.com>
Signed-off-by: ayush <ayush.sawant@nutanix.com>
|
@AyushSawant18588 can you check if e2e tests are required with custom prefixes? |
| # Comma-separated key-value pairs for endpoint prefixes. | ||
| # Format: "openaiPrefix:/prefix1,anthropicPrefix:/prefix2" | ||
| # Example: "openaiPrefix:/,coherePrefix:/cohere,anthropicPrefix:/anthropic" | ||
| endpointPrefixes: "" |
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 would rather have an explicit exhaustive list here to avoid manual validation at runtime
| # Comma-separated key-value pairs for endpoint prefixes. | |
| # Format: "openaiPrefix:/prefix1,anthropicPrefix:/prefix2" | |
| # Example: "openaiPrefix:/,coherePrefix:/cohere,anthropicPrefix:/anthropic" | |
| endpointPrefixes: "" | |
| openai: "" | |
| anthropic: "/anthropic" | |
| cohere: "/cohere" |
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.
also could you add detailed comments here by showing exact paths examples. At least one for each provider
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.
The idea behind using key-value pairs for endpoint prefixes was to make the design more scalable. As we add support for more providers in the future, maintaining an explicit list would require updating multiple files (helm values, controller deployment, controller, extproc, gateway_mutator, internalapi, etc.) each time. With the current approach, any new provider addition would only require changes within the EndpointPrefixes struct and related functions in the internalapi package.
What are your thoughts on this trade-off?
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 would prefer my suggestion for now, not trying to solve non existing problem
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.
btw you can concatenate strings in helm functions so your concern on multiple changes doesn't apply here i believe
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.
my suggestion is "let's not expose the error prone string format to users". I am not saying we shouldn't use the concatenated ones in arguments in extproc/controller, it should be totally fine
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.
Oh thanks, got your point so expose explicit prefixes via values but concatenate and pass it as a string in endpointPrefixes arg to controller. So this structure is fine for string after concatenation right?
--endpointPrefixes='endpointConfig.endpointPrefixes=openaiPrefix:/,coherePrefix:/cohere,anthropicPrefix:/anthropic'
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.
yes
|
For e2e you can reuse the existing e2e-namespaced for non default config https://github.com/envoyproxy/ai-gateway/tree/main/tests/e2e-namespaced @AyushSawant18588 |
Signed-off-by: ayush <ayush.sawant@nutanix.com>
can you tell what e2e test are you suggesting to add? |
|
i would say pass your new helm value with non-default prefix for openai in the e2e setup, and then access the gateway |
Signed-off-by: ayush <ayush.sawant@nutanix.com>
Description
Introduces configurable provider endpoint prefixes via global configurations.
Compatibility
Non-breaking: defaults preserve current behavior for OpenAI (/), Cohere (/cohere), Anthropic (/anthropic) if not set.
Related Issues/PRs (if applicable)
#1457