Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supress Pydantic warnings #3340

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions litellm/proxy/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ class LiteLLM_ModelTable(LiteLLMBase):
created_by: str
updated_by: str

class Config:
protected_namespaces = ()


class NewUserRequest(GenerateKeyRequest):
max_budget: Optional[float] = None
Expand Down Expand Up @@ -485,6 +488,9 @@ class TeamBase(LiteLLMBase):
class NewTeamRequest(TeamBase):
model_aliases: Optional[dict] = None

class Config:
protected_namespaces = ()


class GlobalEndUsersSpend(LiteLLMBase):
api_key: Optional[str] = None
Expand Down Expand Up @@ -534,6 +540,9 @@ class LiteLLM_TeamTable(TeamBase):
budget_reset_at: Optional[datetime] = None
model_id: Optional[int] = None

class Config:
protected_namespaces = ()

@root_validator(pre=True)
def set_model_info(cls, values):
dict_fields = [
Expand Down Expand Up @@ -570,6 +579,9 @@ class LiteLLM_BudgetTable(LiteLLMBase):
model_max_budget: Optional[dict] = None
budget_duration: Optional[str] = None

class Config:
protected_namespaces = ()


class NewOrganizationRequest(LiteLLM_BudgetTable):
organization_id: Optional[str] = None
Expand Down
3 changes: 3 additions & 0 deletions litellm/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class DBModel(BaseModel):
model_info: dict
litellm_params: dict

class Config:
protected_namespaces = ()


@pytest.mark.asyncio
async def test_delete_deployment():
Expand Down
6 changes: 6 additions & 0 deletions litellm/types/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,18 @@ class updateDeployment(BaseModel):
litellm_params: Optional[updateLiteLLMParams] = None
model_info: Optional[ModelInfo] = None

class Config:
protected_namespaces = ()


class Deployment(BaseModel):
model_name: str
litellm_params: LiteLLM_Params
model_info: ModelInfo

class Config:
protected_namespaces = ()

def __init__(
self,
model_name: str,
Expand Down