Skip to content

feat: allow excluding models from /v1/models - #2446

Open
Killusions wants to merge 1 commit into
envoyproxy:mainfrom
Killusions:feat/exclude-models-from-models-endpoint
Open

feat: allow excluding models from /v1/models#2446
Killusions wants to merge 1 commit into
envoyproxy:mainfrom
Killusions:feat/exclude-models-from-models-endpoint

Conversation

@Killusions

@Killusions Killusions commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Adds excludeFromModelsEndpoint to AIGatewayRoute rules.

Models matched by a rule with this option remain routeable and support modelNameOverride, but are excluded from the OpenAI-compatible /v1/models response. This supports backwards-compatible aliases and aliases only intended for selected clients.

Related Issues/PRs (if applicable)

Fixes #2445

Special notes for reviewers (if applicable)

Tested manually.

⚒️ with ❤️ by https://github.com/siemens

@Killusions
Killusions requested a review from a team as a code owner July 28, 2026 10:45
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 28, 2026
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from 76b8752 to 83f99bf Compare July 28, 2026 10:46
@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.92%. Comparing base (d90f339) to head (93ff4ed).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2446   +/-   ##
=======================================
  Coverage   84.92%   84.92%           
=======================================
  Files         154      154           
  Lines       22430    22434    +4     
=======================================
+ Hits        19048    19052    +4     
  Misses       2225     2225           
  Partials     1157     1157           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from 83f99bf to fbdc8c6 Compare July 28, 2026 11:51
@siddharth1036

Copy link
Copy Markdown
Contributor

@Killusions can you explain the usecase for exclusion of models?

@Killusions

Copy link
Copy Markdown
Contributor Author

@Killusions can you explain the usecase for exclusion of models?

@siddharth1036 There are many, the most common one would be backwards-compatible aliases which people and new clients should no longer use. But also generic aliases, multiple definitions (openai + anthropic schema without translation since our backend vLLM supports both), private test models, etc.

At Siemens we have all of these and currently need to use a workaround by using regex patterns instead of exact model name matches.

Comment thread internal/controller/gateway.go Outdated
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from fbdc8c6 to f124d9a Compare July 29, 2026 16:11
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 29, 2026

@nacx nacx left a comment

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.

Thank you! Just a couple minor comments

Comment thread internal/controller/gateway.go Outdated
Comment thread api/v1alpha1/ai_gateway_route.go
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from d8d8dd9 to c96488f Compare July 30, 2026 11:24
@Killusions
Killusions requested a review from nacx July 30, 2026 11:25
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch 2 times, most recently from 401b17d to 181a04c Compare July 30, 2026 13:01
@Killusions

Copy link
Copy Markdown
Contributor Author

@nacx Pretty sure it's an unrelated failure (after I fixed the precommit), re-triggered the tests by re-pushing.

Comment thread internal/controller/gateway_test.go
Comment thread internal/controller/gateway.go
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from 181a04c to 9194a00 Compare July 31, 2026 15:47
@kanurag94

Copy link
Copy Markdown
Member

Thanks, LGTM! Deferring to @envoyproxy/ai-gateway-maintainers

Signed-off-by: Linus Schlumberger <linus.schlumberger@siemens.com>
@Killusions
Killusions force-pushed the feat/exclude-models-from-models-endpoint branch from 9194a00 to 93ff4ed Compare July 31, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support hidden model aliases

5 participants