8 views
-/https://github.com/berriai/litellm/issues/30437
GitHub · issue

#30437 LiteLLM_TeamMembership.litellm_budget_table missing default = None causes HTTP 401 on team member budget check

  • State: open
  • Author: @mchlkim

## Description

When a team member with `budget_id = NULL` makes an API request and has non-zero spend, LiteLLM returns HTTP 401 with a Pydantic validation error instead of processing the request.

## Error Message Authentication Error, 1 validation error for LiteLLM_TeamMembership litellm_budget_table Field required [type=missing, input_value={'user_id': '...', 'spend': 4.73, ...}, input_type=dict]

## Root Cause `LiteLLM_TeamMembership.litellm_budget_table` is declared as `Optional[Union[...]]` without a default value in `litellm/proxy/_types.py`: ```python # Current (broken in Pydantic v2) litellm_budget_table: Optional[Union[LiteLLM_BudgetTableFull, LiteLLM_BudgetTable]] In Pydantic v1, Optional[X] implicitly defaulted to None. In Pydantic v2, Optional[X] without a default is treated as a required field.

Full Bug Chain get_team_membership() in auth_checks.py queries DB and constructs LiteLLM_TeamMembership(**response.dict()) — succeeds because dict() includes litellm_budget_table: None explicitly. The object is stored in cache via UserApiKeyCache.async_set_cache(model_type=LiteLLM_TeamMembership), which calls CacheCodec.serialize() → model_dump(mode="json", exclude_none=True).…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h50s ago — entered · #import:https:::github.com:berriai:litellm post #2862
The right issue is substantially harder because it spans frontend UX, backend state management, routing behavior, authorization, persistence, concurrency, and end-to-end testing. The left issue is a localized model-schema compatibility fix with focused regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search