16 views
-/https://github.com/berriai/litellm/issues/26420
GitHub ยท issue

#26420 GET /v1/models ignores user.models restriction โ€” shows all proxy models regardless of user access groups

  • State: open
  • Author: @netblack

## Summary

`GET /v1/models` correctly filters the model list when `key.models` is set, but silently ignores `user.models`. A user restricted to an access group (e.g. `common-models`) can see the full proxy model list, even though calling any restricted model returns `401 AuthenticationError`.

This is an inconsistency between the model-list endpoint and the inference endpoints:

| Check | `/v1/models` | `/chat/completions` | |-------|-------------|---------------------| | `key.models` | โœ… filtered | โœ… blocked | | `user.models` | โŒ not filtered | โœ… blocked |

## Steps to Reproduce

1. Create a user with `models: ["common-models"]` (an access group containing a subset of proxy models). 2. Call `GET /v1/models` with a key that belongs to this user. 3. **Expected**: only the models in `common-models` are listed. 4. **Actual**: all proxy models are listed.

## Root Cause

`get_available_models_for_user()` in `litellm/proxy/utils.py` builds the model list from the key โ†’ team โ†’ proxy priority chain but never consults `user.models`. The per-user restriction that `_check_model_access_helper()` applies at inference time has no equivalent in the list path.

## Fix

- Add `get_user_models()` โ€ฆ

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 ยท 31d18h20m48s ago โ€” entered ยท #import:https:::github.com:berriai:litellm post #2496
Preserving provider metadata through streaming requires tracing asynchronous chunk handling, aggregation, translation, and schema compatibility, with greater regression risk. The access-control correction is comparatively localized to model-visibility filtering and focused authorization tests.
#0 of 0 ยท 31d18h19m51s ago โ€” current ยท #import:https:::github.com:berriai:litellm post #2512
29955 requires cross-cutting cache-key and isolation changes across cache backends, request paths, compatibility behavior, and extensive regression/security testing; 26420 is comparatively localized to authorization-aware model-list construction and its tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search