Fix LiteLLM_UserTable .get() error in v2/user/info serialization

The LiteLLM_UserTable model_validator(mode="before") calls values.get()
which fails when FastAPI re-validates a Pydantic instance during response
serialization. Convert to dict before passing to UserInfoV2Response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yuneng-jiang 2026-03-04 21:14:27 -08:00
parent 7fc3f1cb44
commit 47590b4fba

View file

@ -776,7 +776,7 @@ async def user_info_v2(
return UserInfoV2Response(
user_id=user_id,
user_info=user_info,
user_info=user_info.model_dump(),
)
except Exception as e:
verbose_proxy_logger.exception(