fix(router.py): handle edge case where user sets 'model_group' inside… (#10191)

* fix(router.py): handle edge case where user sets 'model_group' inside 'model_info'

* fix(key_management_endpoints.py): security fix - return hashed token in 'token' field

Ensures when creating a key on UI - only hashed token shown

* test(test_key_management_endpoints.py): add unit test

* test: update test
This commit is contained in:
Krish Dholakia 2025-04-21 16:17:45 -07:00 committed by GitHub
parent 03245c732a
commit 0c3b7bb37d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 107 additions and 22 deletions

View file

@ -4983,8 +4983,12 @@ class Router:
)
if model_group_info is None:
model_group_info = ModelGroupInfo(
model_group=user_facing_model_group_name, providers=[llm_provider], **model_info # type: ignore
model_group_info = ModelGroupInfo( # type: ignore
**{
"model_group": user_facing_model_group_name,
"providers": [llm_provider],
**model_info,
}
)
else:
# if max_input_tokens > curr