beamlit 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. beamlit/__init__.py +8 -0
  2. beamlit/api/__init__.py +1 -0
  3. beamlit/api/agents/__init__.py +0 -0
  4. beamlit/api/agents/create_agent.py +155 -0
  5. beamlit/api/agents/create_agent_release.py +146 -0
  6. beamlit/api/agents/delete_agent.py +146 -0
  7. beamlit/api/agents/delete_agent_deployment.py +163 -0
  8. beamlit/api/agents/delete_agent_deployment_history.py +172 -0
  9. beamlit/api/agents/get_agent.py +146 -0
  10. beamlit/api/agents/get_agent_deployment.py +163 -0
  11. beamlit/api/agents/get_agent_deployment_history.py +172 -0
  12. beamlit/api/agents/get_agent_deployment_logs.py +164 -0
  13. beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
  14. beamlit/api/agents/get_agent_metrics.py +150 -0
  15. beamlit/api/agents/list_agent_deployment_history.py +164 -0
  16. beamlit/api/agents/list_agent_deployments.py +155 -0
  17. beamlit/api/agents/list_agents.py +127 -0
  18. beamlit/api/agents/put_agent_deployment.py +185 -0
  19. beamlit/api/agents/put_agent_deployment_history.py +198 -0
  20. beamlit/api/agents/update_agent.py +168 -0
  21. beamlit/api/authentication_providers/__init__.py +0 -0
  22. beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
  23. beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
  24. beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
  25. beamlit/api/configurations/__init__.py +0 -0
  26. beamlit/api/configurations/get_configuration.py +122 -0
  27. beamlit/api/environments/__init__.py +0 -0
  28. beamlit/api/environments/create_environment.py +167 -0
  29. beamlit/api/environments/delete_environment.py +154 -0
  30. beamlit/api/environments/get_environment.py +154 -0
  31. beamlit/api/environments/get_environment_metrics.py +158 -0
  32. beamlit/api/environments/list_environments.py +139 -0
  33. beamlit/api/environments/update_environment.py +180 -0
  34. beamlit/api/functions/__init__.py +0 -0
  35. beamlit/api/functions/create_function.py +155 -0
  36. beamlit/api/functions/create_function_release.py +150 -0
  37. beamlit/api/functions/delete_function.py +146 -0
  38. beamlit/api/functions/delete_function_deployment.py +163 -0
  39. beamlit/api/functions/get_function.py +146 -0
  40. beamlit/api/functions/get_function_deployment.py +163 -0
  41. beamlit/api/functions/get_function_deployment_logs.py +164 -0
  42. beamlit/api/functions/get_function_deployment_metrics.py +159 -0
  43. beamlit/api/functions/get_function_metrics.py +150 -0
  44. beamlit/api/functions/list_function_deployments.py +155 -0
  45. beamlit/api/functions/list_functions.py +131 -0
  46. beamlit/api/functions/put_function_deployment.py +185 -0
  47. beamlit/api/functions/update_function.py +168 -0
  48. beamlit/api/history/__init__.py +0 -0
  49. beamlit/api/history/get_agents_history.py +155 -0
  50. beamlit/api/history/list_agents_history.py +131 -0
  51. beamlit/api/invitations/__init__.py +0 -0
  52. beamlit/api/invitations/list_all_pending_invitations.py +142 -0
  53. beamlit/api/locations/__init__.py +0 -0
  54. beamlit/api/locations/list_locations.py +139 -0
  55. beamlit/api/metrics/__init__.py +0 -0
  56. beamlit/api/metrics/get_metrics.py +130 -0
  57. beamlit/api/model_providers/__init__.py +0 -0
  58. beamlit/api/model_providers/create_model_provider.py +163 -0
  59. beamlit/api/model_providers/delete_model_provider.py +154 -0
  60. beamlit/api/model_providers/get_model_provider.py +154 -0
  61. beamlit/api/model_providers/list_model_providers.py +139 -0
  62. beamlit/api/model_providers/update_model_provider.py +176 -0
  63. beamlit/api/models/__init__.py +0 -0
  64. beamlit/api/models/create_model.py +168 -0
  65. beamlit/api/models/delete_model.py +154 -0
  66. beamlit/api/models/delete_model_deployment.py +171 -0
  67. beamlit/api/models/get_model.py +154 -0
  68. beamlit/api/models/get_model_deployment.py +171 -0
  69. beamlit/api/models/get_model_deployment_logs.py +168 -0
  70. beamlit/api/models/get_model_deployment_metrics.py +163 -0
  71. beamlit/api/models/get_model_metrics.py +154 -0
  72. beamlit/api/models/list_model_deployments.py +163 -0
  73. beamlit/api/models/list_models.py +135 -0
  74. beamlit/api/models/put_model_deployment.py +193 -0
  75. beamlit/api/models/release_model.py +154 -0
  76. beamlit/api/models/update_model.py +181 -0
  77. beamlit/api/policies/__init__.py +0 -0
  78. beamlit/api/policies/create_policy.py +167 -0
  79. beamlit/api/policies/delete_policy.py +154 -0
  80. beamlit/api/policies/get_policy.py +154 -0
  81. beamlit/api/policies/list_policies.py +139 -0
  82. beamlit/api/policies/update_policy.py +180 -0
  83. beamlit/api/service_accounts/__init__.py +0 -0
  84. beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
  85. beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
  86. beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  87. beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
  88. beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
  89. beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  90. beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
  91. beamlit/api/store/__init__.py +0 -0
  92. beamlit/api/store/get_store_agent.py +146 -0
  93. beamlit/api/store/get_store_function.py +146 -0
  94. beamlit/api/store/list_store_agents.py +131 -0
  95. beamlit/api/store/list_store_functions.py +131 -0
  96. beamlit/api/workspaces/__init__.py +0 -0
  97. beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
  98. beamlit/api/workspaces/create_worspace.py +163 -0
  99. beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
  100. beamlit/api/workspaces/delete_workspace.py +154 -0
  101. beamlit/api/workspaces/get_workspace.py +154 -0
  102. beamlit/api/workspaces/invite_workspace_user.py +174 -0
  103. beamlit/api/workspaces/leave_workspace.py +161 -0
  104. beamlit/api/workspaces/list_workspace_users.py +139 -0
  105. beamlit/api/workspaces/list_workspaces.py +139 -0
  106. beamlit/api/workspaces/remove_workspace_user.py +101 -0
  107. beamlit/api/workspaces/update_workspace.py +176 -0
  108. beamlit/api/workspaces/update_workspace_user_role.py +187 -0
  109. beamlit/authentication/__init__.py +24 -0
  110. beamlit/authentication/apikey.py +14 -0
  111. beamlit/authentication/authentication.py +35 -0
  112. beamlit/authentication/credentials.py +165 -0
  113. beamlit/authentication/device_mode.py +115 -0
  114. beamlit/client.py +270 -0
  115. beamlit/errors.py +16 -0
  116. beamlit/models/__init__.py +189 -0
  117. beamlit/models/acl.py +149 -0
  118. beamlit/models/agent.py +151 -0
  119. beamlit/models/agent_chain.py +77 -0
  120. beamlit/models/agent_configuration.py +68 -0
  121. beamlit/models/agent_deployment.py +327 -0
  122. beamlit/models/agent_deployment_configuration.py +43 -0
  123. beamlit/models/agent_deployment_history.py +183 -0
  124. beamlit/models/agent_deployment_history_event.py +131 -0
  125. beamlit/models/agent_deployment_pod_template.py +43 -0
  126. beamlit/models/agent_release.py +68 -0
  127. beamlit/models/api_key.py +140 -0
  128. beamlit/models/authentication_provider_model.py +142 -0
  129. beamlit/models/authentication_provider_organization.py +86 -0
  130. beamlit/models/configuration.py +72 -0
  131. beamlit/models/continent.py +68 -0
  132. beamlit/models/country.py +68 -0
  133. beamlit/models/create_api_key_for_service_account_body.py +67 -0
  134. beamlit/models/create_workspace_service_account_body.py +69 -0
  135. beamlit/models/create_workspace_service_account_response_200.py +103 -0
  136. beamlit/models/delete_workspace_service_account_response_200.py +94 -0
  137. beamlit/models/deployment_configuration.py +68 -0
  138. beamlit/models/deployment_configurations.py +43 -0
  139. beamlit/models/deployment_serverless_config.py +129 -0
  140. beamlit/models/environment.py +162 -0
  141. beamlit/models/environment_metrics.py +75 -0
  142. beamlit/models/flavor.py +68 -0
  143. beamlit/models/function.py +151 -0
  144. beamlit/models/function_configuration.py +68 -0
  145. beamlit/models/function_deployment.py +327 -0
  146. beamlit/models/function_deployment_configuration.py +43 -0
  147. beamlit/models/function_deployment_pod_template.py +43 -0
  148. beamlit/models/function_kit.py +95 -0
  149. beamlit/models/function_provider_ref.py +68 -0
  150. beamlit/models/function_release.py +68 -0
  151. beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
  152. beamlit/models/invite_workspace_user_body.py +58 -0
  153. beamlit/models/labels.py +43 -0
  154. beamlit/models/labels_type_0.py +43 -0
  155. beamlit/models/location.py +120 -0
  156. beamlit/models/location_response.py +111 -0
  157. beamlit/models/metric.py +68 -0
  158. beamlit/models/metrics.py +111 -0
  159. beamlit/models/model.py +151 -0
  160. beamlit/models/model_deployment.py +283 -0
  161. beamlit/models/model_deployment_log.py +68 -0
  162. beamlit/models/model_deployment_metrics.py +170 -0
  163. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
  164. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  165. beamlit/models/model_deployment_pod_template.py +43 -0
  166. beamlit/models/model_metrics.py +94 -0
  167. beamlit/models/model_provider.py +187 -0
  168. beamlit/models/model_provider_ref.py +68 -0
  169. beamlit/models/model_release.py +68 -0
  170. beamlit/models/model_with_deployments.py +174 -0
  171. beamlit/models/pending_invitation.py +122 -0
  172. beamlit/models/pending_invitation_accept.py +81 -0
  173. beamlit/models/pending_invitation_render.py +135 -0
  174. beamlit/models/pending_invitation_render_invited_by.py +86 -0
  175. beamlit/models/pending_invitation_render_workspace.py +68 -0
  176. beamlit/models/pending_invitation_workspace_details.py +70 -0
  177. beamlit/models/policy.py +216 -0
  178. beamlit/models/policy_location.py +68 -0
  179. beamlit/models/provider_config.py +101 -0
  180. beamlit/models/qps.py +59 -0
  181. beamlit/models/resource_deployment_log.py +68 -0
  182. beamlit/models/resource_deployment_metrics.py +172 -0
  183. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
  184. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
  185. beamlit/models/resource_metrics.py +94 -0
  186. beamlit/models/runtime.py +152 -0
  187. beamlit/models/runtime_readiness_probe.py +43 -0
  188. beamlit/models/runtime_resources.py +43 -0
  189. beamlit/models/serverless_config.py +122 -0
  190. beamlit/models/standard_fields_dynamo_db.py +86 -0
  191. beamlit/models/store_agent.py +165 -0
  192. beamlit/models/store_agent_configuration.py +95 -0
  193. beamlit/models/store_agent_labels.py +43 -0
  194. beamlit/models/store_configuration.py +149 -0
  195. beamlit/models/store_configuration_option.py +77 -0
  196. beamlit/models/store_function.py +207 -0
  197. beamlit/models/store_function_configuration.py +95 -0
  198. beamlit/models/store_function_kit.py +95 -0
  199. beamlit/models/store_function_labels.py +43 -0
  200. beamlit/models/store_function_parameter.py +86 -0
  201. beamlit/models/update_workspace_service_account_body.py +67 -0
  202. beamlit/models/update_workspace_service_account_response_200.py +94 -0
  203. beamlit/models/update_workspace_user_role_body.py +58 -0
  204. beamlit/models/workspace.py +126 -0
  205. beamlit/models/workspace_labels.py +43 -0
  206. beamlit/models/workspace_user.py +113 -0
  207. beamlit/py.typed +1 -0
  208. beamlit/types.py +46 -0
  209. beamlit-0.1.0.dist-info/METADATA +59 -0
  210. beamlit-0.1.0.dist-info/RECORD +211 -0
  211. beamlit-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,151 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union, cast
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.labels_type_0 import LabelsType0
10
+
11
+
12
+ T = TypeVar("T", bound="Model")
13
+
14
+
15
+ @_attrs_define
16
+ class Model:
17
+ """Logical object representing a model, that can be instantiated in multiple environments as model deployments
18
+
19
+ Attributes:
20
+ created_at (Union[Unset, str]): The date and time when the resource was created
21
+ created_by (Union[Unset, str]): The user or service account who created the resource
22
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
23
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
24
+ display_name (Union[Unset, str]): Model display name
25
+ labels (Union['LabelsType0', None, Unset]): Labels
26
+ name (Union[Unset, str]): Model name
27
+ workspace (Union[Unset, str]): The workspace the model belongs to
28
+ """
29
+
30
+ created_at: Union[Unset, str] = UNSET
31
+ created_by: Union[Unset, str] = UNSET
32
+ updated_at: Union[Unset, str] = UNSET
33
+ updated_by: Union[Unset, str] = UNSET
34
+ display_name: Union[Unset, str] = UNSET
35
+ labels: Union["LabelsType0", None, Unset] = UNSET
36
+ name: Union[Unset, str] = UNSET
37
+ workspace: Union[Unset, str] = UNSET
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ from ..models.labels_type_0 import LabelsType0
42
+
43
+ created_at = self.created_at
44
+
45
+ created_by = self.created_by
46
+
47
+ updated_at = self.updated_at
48
+
49
+ updated_by = self.updated_by
50
+
51
+ display_name = self.display_name
52
+
53
+ labels: Union[Dict[str, Any], None, Unset]
54
+ if isinstance(self.labels, Unset):
55
+ labels = UNSET
56
+ elif isinstance(self.labels, LabelsType0):
57
+ labels = self.labels.to_dict()
58
+ else:
59
+ labels = self.labels
60
+
61
+ name = self.name
62
+
63
+ workspace = self.workspace
64
+
65
+ field_dict: dict[str, Any] = {}
66
+ field_dict.update(self.additional_properties)
67
+ field_dict.update({})
68
+ if created_at is not UNSET:
69
+ field_dict["created_at"] = created_at
70
+ if created_by is not UNSET:
71
+ field_dict["created_by"] = created_by
72
+ if updated_at is not UNSET:
73
+ field_dict["updated_at"] = updated_at
74
+ if updated_by is not UNSET:
75
+ field_dict["updated_by"] = updated_by
76
+ if display_name is not UNSET:
77
+ field_dict["display_name"] = display_name
78
+ if labels is not UNSET:
79
+ field_dict["labels"] = labels
80
+ if name is not UNSET:
81
+ field_dict["name"] = name
82
+ if workspace is not UNSET:
83
+ field_dict["workspace"] = workspace
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
89
+ from ..models.labels_type_0 import LabelsType0
90
+
91
+ d = src_dict.copy()
92
+ created_at = d.pop("created_at", UNSET)
93
+
94
+ created_by = d.pop("created_by", UNSET)
95
+
96
+ updated_at = d.pop("updated_at", UNSET)
97
+
98
+ updated_by = d.pop("updated_by", UNSET)
99
+
100
+ display_name = d.pop("display_name", UNSET)
101
+
102
+ def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
103
+ if data is None:
104
+ return data
105
+ if isinstance(data, Unset):
106
+ return data
107
+ try:
108
+ if not isinstance(data, dict):
109
+ raise TypeError()
110
+ componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
111
+
112
+ return componentsschemas_labels_type_0
113
+ except: # noqa: E722
114
+ pass
115
+ return cast(Union["LabelsType0", None, Unset], data)
116
+
117
+ labels = _parse_labels(d.pop("labels", UNSET))
118
+
119
+ name = d.pop("name", UNSET)
120
+
121
+ workspace = d.pop("workspace", UNSET)
122
+
123
+ model = cls(
124
+ created_at=created_at,
125
+ created_by=created_by,
126
+ updated_at=updated_at,
127
+ updated_by=updated_by,
128
+ display_name=display_name,
129
+ labels=labels,
130
+ name=name,
131
+ workspace=workspace,
132
+ )
133
+
134
+ model.additional_properties = d
135
+ return model
136
+
137
+ @property
138
+ def additional_keys(self) -> list[str]:
139
+ return list(self.additional_properties.keys())
140
+
141
+ def __getitem__(self, key: str) -> Any:
142
+ return self.additional_properties[key]
143
+
144
+ def __setitem__(self, key: str, value: Any) -> None:
145
+ self.additional_properties[key] = value
146
+
147
+ def __delitem__(self, key: str) -> None:
148
+ del self.additional_properties[key]
149
+
150
+ def __contains__(self, key: str) -> bool:
151
+ return key in self.additional_properties
@@ -0,0 +1,283 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.deployment_serverless_config import DeploymentServerlessConfig
10
+ from ..models.flavor import Flavor
11
+ from ..models.labels_type_0 import LabelsType0
12
+ from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
13
+ from ..models.model_provider_ref import ModelProviderRef
14
+ from ..models.runtime import Runtime
15
+
16
+
17
+ T = TypeVar("T", bound="ModelDeployment")
18
+
19
+
20
+ @_attrs_define
21
+ class ModelDeployment:
22
+ """An instance of a model, deployed in a specific environment
23
+
24
+ Attributes:
25
+ created_at (Union[Unset, str]): The date and time when the resource was created
26
+ created_by (Union[Unset, str]): The user or service account who created the resource
27
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
28
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
29
+ enabled (Union[Unset, bool]): If false, the model deployment will not be active nor serve requests
30
+ environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
31
+ flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
32
+ labels (Union['LabelsType0', None, Unset]): Labels
33
+ metric_port (Union[Unset, int]): The port to serve the metrics on
34
+ model (Union[Unset, str]): The name of the parent model
35
+ model_provider_ref (Union[Unset, ModelProviderRef]): Reference to a model provider
36
+ pod_template (Union[Unset, ModelDeploymentPodTemplate]): The pod template for the deployment. Should be a
37
+ Kubernetes PodTemplateSpec
38
+ policies (Union[Unset, List[str]]):
39
+ runtime (Union[Unset, Runtime]): Set of configurations for a deployment
40
+ serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
41
+ serving_port (Union[Unset, int]): The port to serve the model on
42
+ workspace (Union[Unset, str]): The workspace the model deployment belongs to
43
+ """
44
+
45
+ created_at: Union[Unset, str] = UNSET
46
+ created_by: Union[Unset, str] = UNSET
47
+ updated_at: Union[Unset, str] = UNSET
48
+ updated_by: Union[Unset, str] = UNSET
49
+ enabled: Union[Unset, bool] = UNSET
50
+ environment: Union[Unset, str] = UNSET
51
+ flavors: Union[Unset, List["Flavor"]] = UNSET
52
+ labels: Union["LabelsType0", None, Unset] = UNSET
53
+ metric_port: Union[Unset, int] = UNSET
54
+ model: Union[Unset, str] = UNSET
55
+ model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
56
+ pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
57
+ policies: Union[Unset, List[str]] = UNSET
58
+ runtime: Union[Unset, "Runtime"] = UNSET
59
+ serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
60
+ serving_port: Union[Unset, int] = UNSET
61
+ workspace: Union[Unset, str] = UNSET
62
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
63
+
64
+ def to_dict(self) -> dict[str, Any]:
65
+ from ..models.labels_type_0 import LabelsType0
66
+
67
+ created_at = self.created_at
68
+
69
+ created_by = self.created_by
70
+
71
+ updated_at = self.updated_at
72
+
73
+ updated_by = self.updated_by
74
+
75
+ enabled = self.enabled
76
+
77
+ environment = self.environment
78
+
79
+ flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
80
+ if not isinstance(self.flavors, Unset):
81
+ flavors = []
82
+ for componentsschemas_flavors_item_data in self.flavors:
83
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
84
+ flavors.append(componentsschemas_flavors_item)
85
+
86
+ labels: Union[Dict[str, Any], None, Unset]
87
+ if isinstance(self.labels, Unset):
88
+ labels = UNSET
89
+ elif isinstance(self.labels, LabelsType0):
90
+ labels = self.labels.to_dict()
91
+ else:
92
+ labels = self.labels
93
+
94
+ metric_port = self.metric_port
95
+
96
+ model = self.model
97
+
98
+ model_provider_ref: Union[Unset, Dict[str, Any]] = UNSET
99
+ if not isinstance(self.model_provider_ref, Unset):
100
+ model_provider_ref = self.model_provider_ref.to_dict()
101
+
102
+ pod_template: Union[Unset, Dict[str, Any]] = UNSET
103
+ if not isinstance(self.pod_template, Unset):
104
+ pod_template = self.pod_template.to_dict()
105
+
106
+ policies: Union[Unset, List[str]] = UNSET
107
+ if not isinstance(self.policies, Unset):
108
+ policies = self.policies
109
+
110
+ runtime: Union[Unset, Dict[str, Any]] = UNSET
111
+ if not isinstance(self.runtime, Unset):
112
+ runtime = self.runtime.to_dict()
113
+
114
+ serverless_config: Union[Unset, Dict[str, Any]] = UNSET
115
+ if not isinstance(self.serverless_config, Unset):
116
+ serverless_config = self.serverless_config.to_dict()
117
+
118
+ serving_port = self.serving_port
119
+
120
+ workspace = self.workspace
121
+
122
+ field_dict: dict[str, Any] = {}
123
+ field_dict.update(self.additional_properties)
124
+ field_dict.update({})
125
+ if created_at is not UNSET:
126
+ field_dict["created_at"] = created_at
127
+ if created_by is not UNSET:
128
+ field_dict["created_by"] = created_by
129
+ if updated_at is not UNSET:
130
+ field_dict["updated_at"] = updated_at
131
+ if updated_by is not UNSET:
132
+ field_dict["updated_by"] = updated_by
133
+ if enabled is not UNSET:
134
+ field_dict["enabled"] = enabled
135
+ if environment is not UNSET:
136
+ field_dict["environment"] = environment
137
+ if flavors is not UNSET:
138
+ field_dict["flavors"] = flavors
139
+ if labels is not UNSET:
140
+ field_dict["labels"] = labels
141
+ if metric_port is not UNSET:
142
+ field_dict["metric_port"] = metric_port
143
+ if model is not UNSET:
144
+ field_dict["model"] = model
145
+ if model_provider_ref is not UNSET:
146
+ field_dict["model_provider_ref"] = model_provider_ref
147
+ if pod_template is not UNSET:
148
+ field_dict["pod_template"] = pod_template
149
+ if policies is not UNSET:
150
+ field_dict["policies"] = policies
151
+ if runtime is not UNSET:
152
+ field_dict["runtime"] = runtime
153
+ if serverless_config is not UNSET:
154
+ field_dict["serverless_config"] = serverless_config
155
+ if serving_port is not UNSET:
156
+ field_dict["serving_port"] = serving_port
157
+ if workspace is not UNSET:
158
+ field_dict["workspace"] = workspace
159
+
160
+ return field_dict
161
+
162
+ @classmethod
163
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
164
+ from ..models.deployment_serverless_config import DeploymentServerlessConfig
165
+ from ..models.flavor import Flavor
166
+ from ..models.labels_type_0 import LabelsType0
167
+ from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
168
+ from ..models.model_provider_ref import ModelProviderRef
169
+ from ..models.runtime import Runtime
170
+
171
+ d = src_dict.copy()
172
+ created_at = d.pop("created_at", UNSET)
173
+
174
+ created_by = d.pop("created_by", UNSET)
175
+
176
+ updated_at = d.pop("updated_at", UNSET)
177
+
178
+ updated_by = d.pop("updated_by", UNSET)
179
+
180
+ enabled = d.pop("enabled", UNSET)
181
+
182
+ environment = d.pop("environment", UNSET)
183
+
184
+ flavors = []
185
+ _flavors = d.pop("flavors", UNSET)
186
+ for componentsschemas_flavors_item_data in _flavors or []:
187
+ componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
188
+
189
+ flavors.append(componentsschemas_flavors_item)
190
+
191
+ def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
192
+ if data is None:
193
+ return data
194
+ if isinstance(data, Unset):
195
+ return data
196
+ try:
197
+ if not isinstance(data, dict):
198
+ raise TypeError()
199
+ componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
200
+
201
+ return componentsschemas_labels_type_0
202
+ except: # noqa: E722
203
+ pass
204
+ return cast(Union["LabelsType0", None, Unset], data)
205
+
206
+ labels = _parse_labels(d.pop("labels", UNSET))
207
+
208
+ metric_port = d.pop("metric_port", UNSET)
209
+
210
+ model = d.pop("model", UNSET)
211
+
212
+ _model_provider_ref = d.pop("model_provider_ref", UNSET)
213
+ model_provider_ref: Union[Unset, ModelProviderRef]
214
+ if isinstance(_model_provider_ref, Unset):
215
+ model_provider_ref = UNSET
216
+ else:
217
+ model_provider_ref = ModelProviderRef.from_dict(_model_provider_ref)
218
+
219
+ _pod_template = d.pop("pod_template", UNSET)
220
+ pod_template: Union[Unset, ModelDeploymentPodTemplate]
221
+ if isinstance(_pod_template, Unset):
222
+ pod_template = UNSET
223
+ else:
224
+ pod_template = ModelDeploymentPodTemplate.from_dict(_pod_template)
225
+
226
+ policies = cast(List[str], d.pop("policies", UNSET))
227
+
228
+ _runtime = d.pop("runtime", UNSET)
229
+ runtime: Union[Unset, Runtime]
230
+ if isinstance(_runtime, Unset):
231
+ runtime = UNSET
232
+ else:
233
+ runtime = Runtime.from_dict(_runtime)
234
+
235
+ _serverless_config = d.pop("serverless_config", UNSET)
236
+ serverless_config: Union[Unset, DeploymentServerlessConfig]
237
+ if isinstance(_serverless_config, Unset):
238
+ serverless_config = UNSET
239
+ else:
240
+ serverless_config = DeploymentServerlessConfig.from_dict(_serverless_config)
241
+
242
+ serving_port = d.pop("serving_port", UNSET)
243
+
244
+ workspace = d.pop("workspace", UNSET)
245
+
246
+ model_deployment = cls(
247
+ created_at=created_at,
248
+ created_by=created_by,
249
+ updated_at=updated_at,
250
+ updated_by=updated_by,
251
+ enabled=enabled,
252
+ environment=environment,
253
+ flavors=flavors,
254
+ labels=labels,
255
+ metric_port=metric_port,
256
+ model=model,
257
+ model_provider_ref=model_provider_ref,
258
+ pod_template=pod_template,
259
+ policies=policies,
260
+ runtime=runtime,
261
+ serverless_config=serverless_config,
262
+ serving_port=serving_port,
263
+ workspace=workspace,
264
+ )
265
+
266
+ model_deployment.additional_properties = d
267
+ return model_deployment
268
+
269
+ @property
270
+ def additional_keys(self) -> list[str]:
271
+ return list(self.additional_properties.keys())
272
+
273
+ def __getitem__(self, key: str) -> Any:
274
+ return self.additional_properties[key]
275
+
276
+ def __setitem__(self, key: str, value: Any) -> None:
277
+ self.additional_properties[key] = value
278
+
279
+ def __delitem__(self, key: str) -> None:
280
+ del self.additional_properties[key]
281
+
282
+ def __contains__(self, key: str) -> bool:
283
+ return key in self.additional_properties
@@ -0,0 +1,68 @@
1
+ from typing import Any, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="ModelDeploymentLog")
9
+
10
+
11
+ @_attrs_define
12
+ class ModelDeploymentLog:
13
+ """Log for a model deployment
14
+
15
+ Attributes:
16
+ message (Union[Unset, str]): Content of the log
17
+ timestamp (Union[Unset, str]): The timestamp of the log
18
+ """
19
+
20
+ message: Union[Unset, str] = UNSET
21
+ timestamp: Union[Unset, str] = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ message = self.message
26
+
27
+ timestamp = self.timestamp
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update({})
32
+ if message is not UNSET:
33
+ field_dict["message"] = message
34
+ if timestamp is not UNSET:
35
+ field_dict["timestamp"] = timestamp
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ d = src_dict.copy()
42
+ message = d.pop("message", UNSET)
43
+
44
+ timestamp = d.pop("timestamp", UNSET)
45
+
46
+ model_deployment_log = cls(
47
+ message=message,
48
+ timestamp=timestamp,
49
+ )
50
+
51
+ model_deployment_log.additional_properties = d
52
+ return model_deployment_log
53
+
54
+ @property
55
+ def additional_keys(self) -> list[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> Any:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: Any) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -0,0 +1,170 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.metric import Metric
10
+ from ..models.model_deployment_metrics_inference_per_second_per_region import (
11
+ ModelDeploymentMetricsInferencePerSecondPerRegion,
12
+ )
13
+ from ..models.model_deployment_metrics_query_per_second_per_region_per_code import (
14
+ ModelDeploymentMetricsQueryPerSecondPerRegionPerCode,
15
+ )
16
+ from ..models.qps import QPS
17
+
18
+
19
+ T = TypeVar("T", bound="ModelDeploymentMetrics")
20
+
21
+
22
+ @_attrs_define
23
+ class ModelDeploymentMetrics:
24
+ """Metrics for a single model deployment
25
+
26
+ Attributes:
27
+ inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
28
+ inference_per_second_per_region (Union[Unset, ModelDeploymentMetricsInferencePerSecondPerRegion]): Historical
29
+ requests per second (RPS) per location, for the model deployment
30
+ query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
31
+ query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
32
+ code (e.g. 200, 400) or per location
33
+ query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
34
+ (e.g. 200, 400) or per location
35
+ query_per_second_per_region_per_code (Union[Unset, ModelDeploymentMetricsQueryPerSecondPerRegionPerCode]): RPS
36
+ value (in last 24 hours) per response status code per location, for the model deployment
37
+ """
38
+
39
+ inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
40
+ inference_per_second_per_region: Union[Unset, "ModelDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
41
+ query_per_second_global: Union[Unset, float] = UNSET
42
+ query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
43
+ query_per_second_per_region: Union[Unset, "QPS"] = UNSET
44
+ query_per_second_per_region_per_code: Union[Unset, "ModelDeploymentMetricsQueryPerSecondPerRegionPerCode"] = UNSET
45
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
+
47
+ def to_dict(self) -> dict[str, Any]:
48
+ inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
49
+ if not isinstance(self.inference_per_second_global, Unset):
50
+ inference_per_second_global = []
51
+ for componentsschemas_array_metric_item_data in self.inference_per_second_global:
52
+ componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
53
+ inference_per_second_global.append(componentsschemas_array_metric_item)
54
+
55
+ inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
56
+ if not isinstance(self.inference_per_second_per_region, Unset):
57
+ inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
58
+
59
+ query_per_second_global = self.query_per_second_global
60
+
61
+ query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
62
+ if not isinstance(self.query_per_second_per_code_global, Unset):
63
+ query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
64
+
65
+ query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
66
+ if not isinstance(self.query_per_second_per_region, Unset):
67
+ query_per_second_per_region = self.query_per_second_per_region.to_dict()
68
+
69
+ query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
70
+ if not isinstance(self.query_per_second_per_region_per_code, Unset):
71
+ query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
72
+
73
+ field_dict: dict[str, Any] = {}
74
+ field_dict.update(self.additional_properties)
75
+ field_dict.update({})
76
+ if inference_per_second_global is not UNSET:
77
+ field_dict["inference_per_second_global"] = inference_per_second_global
78
+ if inference_per_second_per_region is not UNSET:
79
+ field_dict["inference_per_second_per_region"] = inference_per_second_per_region
80
+ if query_per_second_global is not UNSET:
81
+ field_dict["query_per_second_global"] = query_per_second_global
82
+ if query_per_second_per_code_global is not UNSET:
83
+ field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
84
+ if query_per_second_per_region is not UNSET:
85
+ field_dict["query_per_second_per_region"] = query_per_second_per_region
86
+ if query_per_second_per_region_per_code is not UNSET:
87
+ field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
88
+
89
+ return field_dict
90
+
91
+ @classmethod
92
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
93
+ from ..models.metric import Metric
94
+ from ..models.model_deployment_metrics_inference_per_second_per_region import (
95
+ ModelDeploymentMetricsInferencePerSecondPerRegion,
96
+ )
97
+ from ..models.model_deployment_metrics_query_per_second_per_region_per_code import (
98
+ ModelDeploymentMetricsQueryPerSecondPerRegionPerCode,
99
+ )
100
+ from ..models.qps import QPS
101
+
102
+ d = src_dict.copy()
103
+ inference_per_second_global = []
104
+ _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
105
+ for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
106
+ componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
107
+
108
+ inference_per_second_global.append(componentsschemas_array_metric_item)
109
+
110
+ _inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
111
+ inference_per_second_per_region: Union[Unset, ModelDeploymentMetricsInferencePerSecondPerRegion]
112
+ if isinstance(_inference_per_second_per_region, Unset):
113
+ inference_per_second_per_region = UNSET
114
+ else:
115
+ inference_per_second_per_region = ModelDeploymentMetricsInferencePerSecondPerRegion.from_dict(
116
+ _inference_per_second_per_region
117
+ )
118
+
119
+ query_per_second_global = d.pop("query_per_second_global", UNSET)
120
+
121
+ _query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
122
+ query_per_second_per_code_global: Union[Unset, QPS]
123
+ if isinstance(_query_per_second_per_code_global, Unset):
124
+ query_per_second_per_code_global = UNSET
125
+ else:
126
+ query_per_second_per_code_global = QPS.from_dict(_query_per_second_per_code_global)
127
+
128
+ _query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
129
+ query_per_second_per_region: Union[Unset, QPS]
130
+ if isinstance(_query_per_second_per_region, Unset):
131
+ query_per_second_per_region = UNSET
132
+ else:
133
+ query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
134
+
135
+ _query_per_second_per_region_per_code = d.pop("query_per_second_per_region_per_code", UNSET)
136
+ query_per_second_per_region_per_code: Union[Unset, ModelDeploymentMetricsQueryPerSecondPerRegionPerCode]
137
+ if isinstance(_query_per_second_per_region_per_code, Unset):
138
+ query_per_second_per_region_per_code = UNSET
139
+ else:
140
+ query_per_second_per_region_per_code = ModelDeploymentMetricsQueryPerSecondPerRegionPerCode.from_dict(
141
+ _query_per_second_per_region_per_code
142
+ )
143
+
144
+ model_deployment_metrics = cls(
145
+ inference_per_second_global=inference_per_second_global,
146
+ inference_per_second_per_region=inference_per_second_per_region,
147
+ query_per_second_global=query_per_second_global,
148
+ query_per_second_per_code_global=query_per_second_per_code_global,
149
+ query_per_second_per_region=query_per_second_per_region,
150
+ query_per_second_per_region_per_code=query_per_second_per_region_per_code,
151
+ )
152
+
153
+ model_deployment_metrics.additional_properties = d
154
+ return model_deployment_metrics
155
+
156
+ @property
157
+ def additional_keys(self) -> list[str]:
158
+ return list(self.additional_properties.keys())
159
+
160
+ def __getitem__(self, key: str) -> Any:
161
+ return self.additional_properties[key]
162
+
163
+ def __setitem__(self, key: str, value: Any) -> None:
164
+ self.additional_properties[key] = value
165
+
166
+ def __delitem__(self, key: str) -> None:
167
+ del self.additional_properties[key]
168
+
169
+ def __contains__(self, key: str) -> bool:
170
+ return key in self.additional_properties