Skip to content

feat(plugins): add authenticated model catalog filter - #4766

Draft
linonetwo wants to merge 3 commits into
router-for-me:devfrom
linonetwo:feature/plugin-model-catalog-filter
Draft

feat(plugins): add authenticated model catalog filter#4766
linonetwo wants to merge 3 commits into
router-for-me:devfrom
linonetwo:feature/plugin-model-catalog-filter

Conversation

@linonetwo

Copy link
Copy Markdown

Why

Frontend auth plugins can allow or deny GET /v1/models, but cannot make the returned catalog match the authenticated caller's provider/model ACL. Returning the global registry leaks unavailable model names and breaks client model discovery; denying the endpoint prevents normal OpenAI-compatible clients from discovering their allowed models.

Our concrete deployment uses CPA native api-keys as the single identity source and a frontend-auth plugin for per-key provider/model grants. It needs model discovery to return exactly the granted model subset without introducing a second gateway or key system.

What

Adds an optional, backwards-compatible ModelCatalogFilter plugin capability and RPC method model.catalog_filter. Filters run after frontend authentication, receive request/access metadata plus the current model list, and chain in plugin priority order. Filter errors fail the model endpoint closed with 503 rather than falling back to the unfiltered global catalog.

Both OpenAI model handlers use the hook. Existing plugins and configurations are unchanged.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

This pull request targeted main.

The base branch has been automatically changed to dev.

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.

1 participant