Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /BerriAI_litellm /litellm /models /model.py
| """ | |
| Proxy model table model. | |
| Canonical definition for ``litellm_proxymodeltable``. Re-exported from | |
| ``litellm.proxy._types`` for backwards compatibility. | |
| """ | |
| import json | |
| from datetime import datetime | |
| from pydantic import ConfigDict, model_validator | |
| from litellm.types.llms.base import LiteLLMPydanticObjectBase | |
| class LiteLLM_ProxyModelTable(LiteLLMPydanticObjectBase): | |
| model_id: str | |
| model_name: str | |
| litellm_params: dict | |
| model_info: dict | None = None | |
| blocked: bool = False | |
| created_at: datetime | None = None | |
| created_by: str | None = None | |
| updated_at: datetime | None = None | |
| updated_by: str | None = None | |
| model_config = ConfigDict(protected_namespaces=()) | |
| def check_potential_json_str(cls, values): | |
| if not isinstance(values, dict): | |
| return values | |
| if isinstance(values.get("litellm_params"), str): | |
| try: | |
| values["litellm_params"] = json.loads(values["litellm_params"]) | |
| except json.JSONDecodeError: | |
| pass | |
| if isinstance(values.get("model_info"), str): | |
| try: | |
| values["model_info"] = json.loads(values["model_info"]) | |
| except json.JSONDecodeError: | |
| pass | |
| return values | |
| def is_blocked(self) -> bool: | |
| return self.blocked | |
| def team_id(self) -> str | None: | |
| if self.model_info: | |
| return self.model_info.get("team_id") | |
| return None | |
| def team_public_model_name(self) -> str | None: | |
| if self.model_info: | |
| return self.model_info.get("team_public_model_name") | |
| return None | |
Xet Storage Details
- Size:
- 1.72 kB
- Xet hash:
- 70577cfae47bd611c5bfcbfa053e3d0349b263941adccd4112af3945e50b3f30
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.