litellm/tests/test_litellm/proxy/proxy_server
Sameer Kankute 6068bb7781
fix(proxy): align /v1/model/info with router deployments (#30025)
* fix(proxy): align /v1/model/info with router deployments

Return router model_list entries (including team-scoped models) with team
access metadata instead of wildcard-expanded names from get_complete_model_list.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(proxy): gate v1 team filter and honor key allowlists

Only apply get_all_team_and_direct_access_models for admin or user-bound
keys, then intersect with key/team model restrictions to avoid empty lists
for service tokens and metadata leaks for restricted keys.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(proxy): skip v1 team filter when user row is missing

Require a DB-backed user before applying team-access filtering on
/v1/model/info, and skip the trailing filter in get_all_team_and_direct_access_models
when user context cannot be resolved.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Revert "fix(proxy): skip v1 team filter when user row is missing"

This reverts commit 74e1fbd77a981103cd9a4ed1cbdd662f5cbcf209.

* fix(proxy): restore legacy v1 model access filtering

Keep /v1/model/info on key/team allowlists instead of DB team-membership
filtering, while still listing router deployments for team-scoped models.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(proxy): drop A2A agent entries from public /v1/model/info list

* fix(proxy): scope team BYOK rows on /v1/model/info to caller's teams

Listing the full router model_list let any authenticated key without
explicit model restrictions enumerate other teams' BYOK deployments
(public name, team_id, api_base) via /v1/model/info. Reuse the existing
_get_caller_byok_team_scope check so non-admin callers only see global
deployments plus their own team's BYOK rows; admins keep the full view.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-06-10 19:38:21 -07:00
..
__init__.py
_coverage_check.py
_pin_check.py
.coverage_baseline
conftest.py
test_background_health.py
test_exception_handlers.py
test_harness_smoke.py
test_lifecycle.py
test_openapi_customization.py
test_proxy_config.py fix(callbacks): forward callback_settings to callback initializers and guard consumers against non-dict values (#30161) 2026-06-10 15:22:00 -07:00
test_routes_anthropic_beta.py
test_routes_assistants.py
test_routes_audio.py fix(proxy): extend response headers hook to streaming, TTS, image gen, and pass-through (#24232) 2026-06-09 22:10:23 +02:00
test_routes_chat_completions.py
test_routes_completions.py
test_routes_config.py
test_routes_embeddings.py
test_routes_invitation.py
test_routes_login_sso.py
test_routes_misc.py
test_routes_model_cost_map.py
test_routes_model_info.py feat(proxy): publish /v2/model/info in Swagger OpenAPI spec (#29900) 2026-06-08 09:33:35 -07:00
test_routes_model_metrics.py
test_routes_models.py
test_routes_moderations.py
test_routes_onboarding.py
test_routes_queue.py
test_routes_threads.py
test_routes_utils.py
test_spend_counters.py fix(register_model): preserve built-in cache pricing when registering custom overrides under unmapped keys (#30044) 2026-06-10 12:11:03 -07:00
test_streaming_helpers.py
test_team_model_name_translation.py fix(proxy): align /v1/model/info with router deployments (#30025) 2026-06-10 19:38:21 -07:00