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.
- beamlit/__init__.py +8 -0
- beamlit/api/__init__.py +1 -0
- beamlit/api/agents/__init__.py +0 -0
- beamlit/api/agents/create_agent.py +155 -0
- beamlit/api/agents/create_agent_release.py +146 -0
- beamlit/api/agents/delete_agent.py +146 -0
- beamlit/api/agents/delete_agent_deployment.py +163 -0
- beamlit/api/agents/delete_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent.py +146 -0
- beamlit/api/agents/get_agent_deployment.py +163 -0
- beamlit/api/agents/get_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent_deployment_logs.py +164 -0
- beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
- beamlit/api/agents/get_agent_metrics.py +150 -0
- beamlit/api/agents/list_agent_deployment_history.py +164 -0
- beamlit/api/agents/list_agent_deployments.py +155 -0
- beamlit/api/agents/list_agents.py +127 -0
- beamlit/api/agents/put_agent_deployment.py +185 -0
- beamlit/api/agents/put_agent_deployment_history.py +198 -0
- beamlit/api/agents/update_agent.py +168 -0
- beamlit/api/authentication_providers/__init__.py +0 -0
- beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
- beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
- beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
- beamlit/api/configurations/__init__.py +0 -0
- beamlit/api/configurations/get_configuration.py +122 -0
- beamlit/api/environments/__init__.py +0 -0
- beamlit/api/environments/create_environment.py +167 -0
- beamlit/api/environments/delete_environment.py +154 -0
- beamlit/api/environments/get_environment.py +154 -0
- beamlit/api/environments/get_environment_metrics.py +158 -0
- beamlit/api/environments/list_environments.py +139 -0
- beamlit/api/environments/update_environment.py +180 -0
- beamlit/api/functions/__init__.py +0 -0
- beamlit/api/functions/create_function.py +155 -0
- beamlit/api/functions/create_function_release.py +150 -0
- beamlit/api/functions/delete_function.py +146 -0
- beamlit/api/functions/delete_function_deployment.py +163 -0
- beamlit/api/functions/get_function.py +146 -0
- beamlit/api/functions/get_function_deployment.py +163 -0
- beamlit/api/functions/get_function_deployment_logs.py +164 -0
- beamlit/api/functions/get_function_deployment_metrics.py +159 -0
- beamlit/api/functions/get_function_metrics.py +150 -0
- beamlit/api/functions/list_function_deployments.py +155 -0
- beamlit/api/functions/list_functions.py +131 -0
- beamlit/api/functions/put_function_deployment.py +185 -0
- beamlit/api/functions/update_function.py +168 -0
- beamlit/api/history/__init__.py +0 -0
- beamlit/api/history/get_agents_history.py +155 -0
- beamlit/api/history/list_agents_history.py +131 -0
- beamlit/api/invitations/__init__.py +0 -0
- beamlit/api/invitations/list_all_pending_invitations.py +142 -0
- beamlit/api/locations/__init__.py +0 -0
- beamlit/api/locations/list_locations.py +139 -0
- beamlit/api/metrics/__init__.py +0 -0
- beamlit/api/metrics/get_metrics.py +130 -0
- beamlit/api/model_providers/__init__.py +0 -0
- beamlit/api/model_providers/create_model_provider.py +163 -0
- beamlit/api/model_providers/delete_model_provider.py +154 -0
- beamlit/api/model_providers/get_model_provider.py +154 -0
- beamlit/api/model_providers/list_model_providers.py +139 -0
- beamlit/api/model_providers/update_model_provider.py +176 -0
- beamlit/api/models/__init__.py +0 -0
- beamlit/api/models/create_model.py +168 -0
- beamlit/api/models/delete_model.py +154 -0
- beamlit/api/models/delete_model_deployment.py +171 -0
- beamlit/api/models/get_model.py +154 -0
- beamlit/api/models/get_model_deployment.py +171 -0
- beamlit/api/models/get_model_deployment_logs.py +168 -0
- beamlit/api/models/get_model_deployment_metrics.py +163 -0
- beamlit/api/models/get_model_metrics.py +154 -0
- beamlit/api/models/list_model_deployments.py +163 -0
- beamlit/api/models/list_models.py +135 -0
- beamlit/api/models/put_model_deployment.py +193 -0
- beamlit/api/models/release_model.py +154 -0
- beamlit/api/models/update_model.py +181 -0
- beamlit/api/policies/__init__.py +0 -0
- beamlit/api/policies/create_policy.py +167 -0
- beamlit/api/policies/delete_policy.py +154 -0
- beamlit/api/policies/get_policy.py +154 -0
- beamlit/api/policies/list_policies.py +139 -0
- beamlit/api/policies/update_policy.py +180 -0
- beamlit/api/service_accounts/__init__.py +0 -0
- beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
- beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
- beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
- beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
- beamlit/api/store/__init__.py +0 -0
- beamlit/api/store/get_store_agent.py +146 -0
- beamlit/api/store/get_store_function.py +146 -0
- beamlit/api/store/list_store_agents.py +131 -0
- beamlit/api/store/list_store_functions.py +131 -0
- beamlit/api/workspaces/__init__.py +0 -0
- beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
- beamlit/api/workspaces/create_worspace.py +163 -0
- beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
- beamlit/api/workspaces/delete_workspace.py +154 -0
- beamlit/api/workspaces/get_workspace.py +154 -0
- beamlit/api/workspaces/invite_workspace_user.py +174 -0
- beamlit/api/workspaces/leave_workspace.py +161 -0
- beamlit/api/workspaces/list_workspace_users.py +139 -0
- beamlit/api/workspaces/list_workspaces.py +139 -0
- beamlit/api/workspaces/remove_workspace_user.py +101 -0
- beamlit/api/workspaces/update_workspace.py +176 -0
- beamlit/api/workspaces/update_workspace_user_role.py +187 -0
- beamlit/authentication/__init__.py +24 -0
- beamlit/authentication/apikey.py +14 -0
- beamlit/authentication/authentication.py +35 -0
- beamlit/authentication/credentials.py +165 -0
- beamlit/authentication/device_mode.py +115 -0
- beamlit/client.py +270 -0
- beamlit/errors.py +16 -0
- beamlit/models/__init__.py +189 -0
- beamlit/models/acl.py +149 -0
- beamlit/models/agent.py +151 -0
- beamlit/models/agent_chain.py +77 -0
- beamlit/models/agent_configuration.py +68 -0
- beamlit/models/agent_deployment.py +327 -0
- beamlit/models/agent_deployment_configuration.py +43 -0
- beamlit/models/agent_deployment_history.py +183 -0
- beamlit/models/agent_deployment_history_event.py +131 -0
- beamlit/models/agent_deployment_pod_template.py +43 -0
- beamlit/models/agent_release.py +68 -0
- beamlit/models/api_key.py +140 -0
- beamlit/models/authentication_provider_model.py +142 -0
- beamlit/models/authentication_provider_organization.py +86 -0
- beamlit/models/configuration.py +72 -0
- beamlit/models/continent.py +68 -0
- beamlit/models/country.py +68 -0
- beamlit/models/create_api_key_for_service_account_body.py +67 -0
- beamlit/models/create_workspace_service_account_body.py +69 -0
- beamlit/models/create_workspace_service_account_response_200.py +103 -0
- beamlit/models/delete_workspace_service_account_response_200.py +94 -0
- beamlit/models/deployment_configuration.py +68 -0
- beamlit/models/deployment_configurations.py +43 -0
- beamlit/models/deployment_serverless_config.py +129 -0
- beamlit/models/environment.py +162 -0
- beamlit/models/environment_metrics.py +75 -0
- beamlit/models/flavor.py +68 -0
- beamlit/models/function.py +151 -0
- beamlit/models/function_configuration.py +68 -0
- beamlit/models/function_deployment.py +327 -0
- beamlit/models/function_deployment_configuration.py +43 -0
- beamlit/models/function_deployment_pod_template.py +43 -0
- beamlit/models/function_kit.py +95 -0
- beamlit/models/function_provider_ref.py +68 -0
- beamlit/models/function_release.py +68 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
- beamlit/models/invite_workspace_user_body.py +58 -0
- beamlit/models/labels.py +43 -0
- beamlit/models/labels_type_0.py +43 -0
- beamlit/models/location.py +120 -0
- beamlit/models/location_response.py +111 -0
- beamlit/models/metric.py +68 -0
- beamlit/models/metrics.py +111 -0
- beamlit/models/model.py +151 -0
- beamlit/models/model_deployment.py +283 -0
- beamlit/models/model_deployment_log.py +68 -0
- beamlit/models/model_deployment_metrics.py +170 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/model_deployment_pod_template.py +43 -0
- beamlit/models/model_metrics.py +94 -0
- beamlit/models/model_provider.py +187 -0
- beamlit/models/model_provider_ref.py +68 -0
- beamlit/models/model_release.py +68 -0
- beamlit/models/model_with_deployments.py +174 -0
- beamlit/models/pending_invitation.py +122 -0
- beamlit/models/pending_invitation_accept.py +81 -0
- beamlit/models/pending_invitation_render.py +135 -0
- beamlit/models/pending_invitation_render_invited_by.py +86 -0
- beamlit/models/pending_invitation_render_workspace.py +68 -0
- beamlit/models/pending_invitation_workspace_details.py +70 -0
- beamlit/models/policy.py +216 -0
- beamlit/models/policy_location.py +68 -0
- beamlit/models/provider_config.py +101 -0
- beamlit/models/qps.py +59 -0
- beamlit/models/resource_deployment_log.py +68 -0
- beamlit/models/resource_deployment_metrics.py +172 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_metrics.py +94 -0
- beamlit/models/runtime.py +152 -0
- beamlit/models/runtime_readiness_probe.py +43 -0
- beamlit/models/runtime_resources.py +43 -0
- beamlit/models/serverless_config.py +122 -0
- beamlit/models/standard_fields_dynamo_db.py +86 -0
- beamlit/models/store_agent.py +165 -0
- beamlit/models/store_agent_configuration.py +95 -0
- beamlit/models/store_agent_labels.py +43 -0
- beamlit/models/store_configuration.py +149 -0
- beamlit/models/store_configuration_option.py +77 -0
- beamlit/models/store_function.py +207 -0
- beamlit/models/store_function_configuration.py +95 -0
- beamlit/models/store_function_kit.py +95 -0
- beamlit/models/store_function_labels.py +43 -0
- beamlit/models/store_function_parameter.py +86 -0
- beamlit/models/update_workspace_service_account_body.py +67 -0
- beamlit/models/update_workspace_service_account_response_200.py +94 -0
- beamlit/models/update_workspace_user_role_body.py +58 -0
- beamlit/models/workspace.py +126 -0
- beamlit/models/workspace_labels.py +43 -0
- beamlit/models/workspace_user.py +113 -0
- beamlit/py.typed +1 -0
- beamlit/types.py +46 -0
- beamlit-0.1.0.dist-info/METADATA +59 -0
- beamlit-0.1.0.dist-info/RECORD +211 -0
- beamlit-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,172 @@
|
|
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.qps import QPS
|
11
|
+
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
12
|
+
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
13
|
+
)
|
14
|
+
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
15
|
+
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
T = TypeVar("T", bound="ResourceDeploymentMetrics")
|
20
|
+
|
21
|
+
|
22
|
+
@_attrs_define
|
23
|
+
class ResourceDeploymentMetrics:
|
24
|
+
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
25
|
+
|
26
|
+
Attributes:
|
27
|
+
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
28
|
+
inference_per_second_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]): 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, ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode]):
|
36
|
+
RPS 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, "ResourceDeploymentMetricsInferencePerSecondPerRegion"] = 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, "ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode"] = (
|
45
|
+
UNSET
|
46
|
+
)
|
47
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
48
|
+
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
50
|
+
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
51
|
+
if not isinstance(self.inference_per_second_global, Unset):
|
52
|
+
inference_per_second_global = []
|
53
|
+
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
54
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
55
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
56
|
+
|
57
|
+
inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
58
|
+
if not isinstance(self.inference_per_second_per_region, Unset):
|
59
|
+
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
60
|
+
|
61
|
+
query_per_second_global = self.query_per_second_global
|
62
|
+
|
63
|
+
query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
|
64
|
+
if not isinstance(self.query_per_second_per_code_global, Unset):
|
65
|
+
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
66
|
+
|
67
|
+
query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
68
|
+
if not isinstance(self.query_per_second_per_region, Unset):
|
69
|
+
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
70
|
+
|
71
|
+
query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
|
72
|
+
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
73
|
+
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
74
|
+
|
75
|
+
field_dict: dict[str, Any] = {}
|
76
|
+
field_dict.update(self.additional_properties)
|
77
|
+
field_dict.update({})
|
78
|
+
if inference_per_second_global is not UNSET:
|
79
|
+
field_dict["inference_per_second_global"] = inference_per_second_global
|
80
|
+
if inference_per_second_per_region is not UNSET:
|
81
|
+
field_dict["inference_per_second_per_region"] = inference_per_second_per_region
|
82
|
+
if query_per_second_global is not UNSET:
|
83
|
+
field_dict["query_per_second_global"] = query_per_second_global
|
84
|
+
if query_per_second_per_code_global is not UNSET:
|
85
|
+
field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
|
86
|
+
if query_per_second_per_region is not UNSET:
|
87
|
+
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
88
|
+
if query_per_second_per_region_per_code is not UNSET:
|
89
|
+
field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
|
90
|
+
|
91
|
+
return field_dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
95
|
+
from ..models.metric import Metric
|
96
|
+
from ..models.qps import QPS
|
97
|
+
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
98
|
+
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
99
|
+
)
|
100
|
+
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
101
|
+
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
102
|
+
)
|
103
|
+
|
104
|
+
d = src_dict.copy()
|
105
|
+
inference_per_second_global = []
|
106
|
+
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
107
|
+
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
108
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
109
|
+
|
110
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
111
|
+
|
112
|
+
_inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
|
113
|
+
inference_per_second_per_region: Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]
|
114
|
+
if isinstance(_inference_per_second_per_region, Unset):
|
115
|
+
inference_per_second_per_region = UNSET
|
116
|
+
else:
|
117
|
+
inference_per_second_per_region = ResourceDeploymentMetricsInferencePerSecondPerRegion.from_dict(
|
118
|
+
_inference_per_second_per_region
|
119
|
+
)
|
120
|
+
|
121
|
+
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
122
|
+
|
123
|
+
_query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
|
124
|
+
query_per_second_per_code_global: Union[Unset, QPS]
|
125
|
+
if isinstance(_query_per_second_per_code_global, Unset):
|
126
|
+
query_per_second_per_code_global = UNSET
|
127
|
+
else:
|
128
|
+
query_per_second_per_code_global = QPS.from_dict(_query_per_second_per_code_global)
|
129
|
+
|
130
|
+
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
131
|
+
query_per_second_per_region: Union[Unset, QPS]
|
132
|
+
if isinstance(_query_per_second_per_region, Unset):
|
133
|
+
query_per_second_per_region = UNSET
|
134
|
+
else:
|
135
|
+
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
136
|
+
|
137
|
+
_query_per_second_per_region_per_code = d.pop("query_per_second_per_region_per_code", UNSET)
|
138
|
+
query_per_second_per_region_per_code: Union[Unset, ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode]
|
139
|
+
if isinstance(_query_per_second_per_region_per_code, Unset):
|
140
|
+
query_per_second_per_region_per_code = UNSET
|
141
|
+
else:
|
142
|
+
query_per_second_per_region_per_code = ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode.from_dict(
|
143
|
+
_query_per_second_per_region_per_code
|
144
|
+
)
|
145
|
+
|
146
|
+
resource_deployment_metrics = cls(
|
147
|
+
inference_per_second_global=inference_per_second_global,
|
148
|
+
inference_per_second_per_region=inference_per_second_per_region,
|
149
|
+
query_per_second_global=query_per_second_global,
|
150
|
+
query_per_second_per_code_global=query_per_second_per_code_global,
|
151
|
+
query_per_second_per_region=query_per_second_per_region,
|
152
|
+
query_per_second_per_region_per_code=query_per_second_per_region_per_code,
|
153
|
+
)
|
154
|
+
|
155
|
+
resource_deployment_metrics.additional_properties = d
|
156
|
+
return resource_deployment_metrics
|
157
|
+
|
158
|
+
@property
|
159
|
+
def additional_keys(self) -> list[str]:
|
160
|
+
return list(self.additional_properties.keys())
|
161
|
+
|
162
|
+
def __getitem__(self, key: str) -> Any:
|
163
|
+
return self.additional_properties[key]
|
164
|
+
|
165
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
166
|
+
self.additional_properties[key] = value
|
167
|
+
|
168
|
+
def __delitem__(self, key: str) -> None:
|
169
|
+
del self.additional_properties[key]
|
170
|
+
|
171
|
+
def __contains__(self, key: str) -> bool:
|
172
|
+
return key in self.additional_properties
|
@@ -0,0 +1,75 @@
|
|
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
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceDeploymentMetricsInferencePerSecondPerRegion")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsInferencePerSecondPerRegion:
|
17
|
+
"""Historical requests per second (RPS) per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, List['Metric']]): Array of metrics
|
21
|
+
"""
|
22
|
+
|
23
|
+
region: Union[Unset, List["Metric"]] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
region: Union[Unset, List[Dict[str, Any]]] = UNSET
|
28
|
+
if not isinstance(self.region, Unset):
|
29
|
+
region = []
|
30
|
+
for componentsschemas_array_metric_item_data in self.region:
|
31
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
32
|
+
region.append(componentsschemas_array_metric_item)
|
33
|
+
|
34
|
+
field_dict: dict[str, Any] = {}
|
35
|
+
field_dict.update(self.additional_properties)
|
36
|
+
field_dict.update({})
|
37
|
+
if region is not UNSET:
|
38
|
+
field_dict["region"] = region
|
39
|
+
|
40
|
+
return field_dict
|
41
|
+
|
42
|
+
@classmethod
|
43
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
44
|
+
from ..models.metric import Metric
|
45
|
+
|
46
|
+
d = src_dict.copy()
|
47
|
+
region = []
|
48
|
+
_region = d.pop("region", UNSET)
|
49
|
+
for componentsschemas_array_metric_item_data in _region or []:
|
50
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
51
|
+
|
52
|
+
region.append(componentsschemas_array_metric_item)
|
53
|
+
|
54
|
+
resource_deployment_metrics_inference_per_second_per_region = cls(
|
55
|
+
region=region,
|
56
|
+
)
|
57
|
+
|
58
|
+
resource_deployment_metrics_inference_per_second_per_region.additional_properties = d
|
59
|
+
return resource_deployment_metrics_inference_per_second_per_region
|
60
|
+
|
61
|
+
@property
|
62
|
+
def additional_keys(self) -> list[str]:
|
63
|
+
return list(self.additional_properties.keys())
|
64
|
+
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
66
|
+
return self.additional_properties[key]
|
67
|
+
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
69
|
+
self.additional_properties[key] = value
|
70
|
+
|
71
|
+
def __delitem__(self, key: str) -> None:
|
72
|
+
del self.additional_properties[key]
|
73
|
+
|
74
|
+
def __contains__(self, key: str) -> bool:
|
75
|
+
return key in self.additional_properties
|
@@ -0,0 +1,73 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, 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.qps import QPS
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
|
17
|
+
"""RPS value (in last 24 hours) per response status code per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200, 400) or per
|
21
|
+
location
|
22
|
+
"""
|
23
|
+
|
24
|
+
region: Union[Unset, "QPS"] = UNSET
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
|
+
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
28
|
+
region: Union[Unset, Dict[str, Any]] = UNSET
|
29
|
+
if not isinstance(self.region, Unset):
|
30
|
+
region = self.region.to_dict()
|
31
|
+
|
32
|
+
field_dict: dict[str, Any] = {}
|
33
|
+
field_dict.update(self.additional_properties)
|
34
|
+
field_dict.update({})
|
35
|
+
if region is not UNSET:
|
36
|
+
field_dict["region"] = region
|
37
|
+
|
38
|
+
return field_dict
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
42
|
+
from ..models.qps import QPS
|
43
|
+
|
44
|
+
d = src_dict.copy()
|
45
|
+
_region = d.pop("region", UNSET)
|
46
|
+
region: Union[Unset, QPS]
|
47
|
+
if isinstance(_region, Unset):
|
48
|
+
region = UNSET
|
49
|
+
else:
|
50
|
+
region = QPS.from_dict(_region)
|
51
|
+
|
52
|
+
resource_deployment_metrics_query_per_second_per_region_per_code = cls(
|
53
|
+
region=region,
|
54
|
+
)
|
55
|
+
|
56
|
+
resource_deployment_metrics_query_per_second_per_region_per_code.additional_properties = d
|
57
|
+
return resource_deployment_metrics_query_per_second_per_region_per_code
|
58
|
+
|
59
|
+
@property
|
60
|
+
def additional_keys(self) -> list[str]:
|
61
|
+
return list(self.additional_properties.keys())
|
62
|
+
|
63
|
+
def __getitem__(self, key: str) -> Any:
|
64
|
+
return self.additional_properties[key]
|
65
|
+
|
66
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
67
|
+
self.additional_properties[key] = value
|
68
|
+
|
69
|
+
def __delitem__(self, key: str) -> None:
|
70
|
+
del self.additional_properties[key]
|
71
|
+
|
72
|
+
def __contains__(self, key: str) -> bool:
|
73
|
+
return key in self.additional_properties
|
@@ -0,0 +1,94 @@
|
|
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.qps import QPS
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="ResourceMetrics")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class ResourceMetrics:
|
18
|
+
"""Metrics for a single resource (eg. model, function)
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
22
|
+
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
23
|
+
(e.g. 200, 400) or per location
|
24
|
+
"""
|
25
|
+
|
26
|
+
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
27
|
+
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
32
|
+
if not isinstance(self.inference_per_second_global, Unset):
|
33
|
+
inference_per_second_global = []
|
34
|
+
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
35
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
36
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
37
|
+
|
38
|
+
query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
39
|
+
if not isinstance(self.query_per_second_per_region, Unset):
|
40
|
+
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
41
|
+
|
42
|
+
field_dict: dict[str, Any] = {}
|
43
|
+
field_dict.update(self.additional_properties)
|
44
|
+
field_dict.update({})
|
45
|
+
if inference_per_second_global is not UNSET:
|
46
|
+
field_dict["inference_per_second_global"] = inference_per_second_global
|
47
|
+
if query_per_second_per_region is not UNSET:
|
48
|
+
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
49
|
+
|
50
|
+
return field_dict
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
54
|
+
from ..models.metric import Metric
|
55
|
+
from ..models.qps import QPS
|
56
|
+
|
57
|
+
d = src_dict.copy()
|
58
|
+
inference_per_second_global = []
|
59
|
+
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
60
|
+
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
61
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
62
|
+
|
63
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
64
|
+
|
65
|
+
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
66
|
+
query_per_second_per_region: Union[Unset, QPS]
|
67
|
+
if isinstance(_query_per_second_per_region, Unset):
|
68
|
+
query_per_second_per_region = UNSET
|
69
|
+
else:
|
70
|
+
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
71
|
+
|
72
|
+
resource_metrics = cls(
|
73
|
+
inference_per_second_global=inference_per_second_global,
|
74
|
+
query_per_second_per_region=query_per_second_per_region,
|
75
|
+
)
|
76
|
+
|
77
|
+
resource_metrics.additional_properties = d
|
78
|
+
return resource_metrics
|
79
|
+
|
80
|
+
@property
|
81
|
+
def additional_keys(self) -> list[str]:
|
82
|
+
return list(self.additional_properties.keys())
|
83
|
+
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
85
|
+
return self.additional_properties[key]
|
86
|
+
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
88
|
+
self.additional_properties[key] = value
|
89
|
+
|
90
|
+
def __delitem__(self, key: str) -> None:
|
91
|
+
del self.additional_properties[key]
|
92
|
+
|
93
|
+
def __contains__(self, key: str) -> bool:
|
94
|
+
return key in self.additional_properties
|
@@ -0,0 +1,152 @@
|
|
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.runtime_readiness_probe import RuntimeReadinessProbe
|
10
|
+
from ..models.runtime_resources import RuntimeResources
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="Runtime")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class Runtime:
|
18
|
+
"""Set of configurations for a deployment
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
args (Union[Unset, List[Any]]): The arguments to pass to the deployment runtime
|
22
|
+
command (Union[Unset, List[Any]]): The command to run the deployment
|
23
|
+
envs (Union[Unset, List[Any]]): The environment variables to set in the deployment. Should be a list of
|
24
|
+
Kubernetes EnvVar types
|
25
|
+
image (Union[Unset, str]): The Docker image for the deployment
|
26
|
+
model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
|
27
|
+
readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
|
28
|
+
resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
|
29
|
+
ResourceRequirements type
|
30
|
+
type (Union[Unset, str]): The type of origin for the deployment
|
31
|
+
"""
|
32
|
+
|
33
|
+
args: Union[Unset, List[Any]] = UNSET
|
34
|
+
command: Union[Unset, List[Any]] = UNSET
|
35
|
+
envs: Union[Unset, List[Any]] = UNSET
|
36
|
+
image: Union[Unset, str] = UNSET
|
37
|
+
model: Union[Unset, str] = UNSET
|
38
|
+
readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
|
39
|
+
resources: Union[Unset, "RuntimeResources"] = UNSET
|
40
|
+
type: Union[Unset, str] = UNSET
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
+
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
44
|
+
args: Union[Unset, List[Any]] = UNSET
|
45
|
+
if not isinstance(self.args, Unset):
|
46
|
+
args = self.args
|
47
|
+
|
48
|
+
command: Union[Unset, List[Any]] = UNSET
|
49
|
+
if not isinstance(self.command, Unset):
|
50
|
+
command = self.command
|
51
|
+
|
52
|
+
envs: Union[Unset, List[Any]] = UNSET
|
53
|
+
if not isinstance(self.envs, Unset):
|
54
|
+
envs = self.envs
|
55
|
+
|
56
|
+
image = self.image
|
57
|
+
|
58
|
+
model = self.model
|
59
|
+
|
60
|
+
readiness_probe: Union[Unset, Dict[str, Any]] = UNSET
|
61
|
+
if not isinstance(self.readiness_probe, Unset):
|
62
|
+
readiness_probe = self.readiness_probe.to_dict()
|
63
|
+
|
64
|
+
resources: Union[Unset, Dict[str, Any]] = UNSET
|
65
|
+
if not isinstance(self.resources, Unset):
|
66
|
+
resources = self.resources.to_dict()
|
67
|
+
|
68
|
+
type = self.type
|
69
|
+
|
70
|
+
field_dict: dict[str, Any] = {}
|
71
|
+
field_dict.update(self.additional_properties)
|
72
|
+
field_dict.update({})
|
73
|
+
if args is not UNSET:
|
74
|
+
field_dict["args"] = args
|
75
|
+
if command is not UNSET:
|
76
|
+
field_dict["command"] = command
|
77
|
+
if envs is not UNSET:
|
78
|
+
field_dict["envs"] = envs
|
79
|
+
if image is not UNSET:
|
80
|
+
field_dict["image"] = image
|
81
|
+
if model is not UNSET:
|
82
|
+
field_dict["model"] = model
|
83
|
+
if readiness_probe is not UNSET:
|
84
|
+
field_dict["readiness_probe"] = readiness_probe
|
85
|
+
if resources is not UNSET:
|
86
|
+
field_dict["resources"] = resources
|
87
|
+
if type is not UNSET:
|
88
|
+
field_dict["type"] = type
|
89
|
+
|
90
|
+
return field_dict
|
91
|
+
|
92
|
+
@classmethod
|
93
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
94
|
+
from ..models.runtime_readiness_probe import RuntimeReadinessProbe
|
95
|
+
from ..models.runtime_resources import RuntimeResources
|
96
|
+
|
97
|
+
d = src_dict.copy()
|
98
|
+
args = cast(List[Any], d.pop("args", UNSET))
|
99
|
+
|
100
|
+
command = cast(List[Any], d.pop("command", UNSET))
|
101
|
+
|
102
|
+
envs = cast(List[Any], d.pop("envs", UNSET))
|
103
|
+
|
104
|
+
image = d.pop("image", UNSET)
|
105
|
+
|
106
|
+
model = d.pop("model", UNSET)
|
107
|
+
|
108
|
+
_readiness_probe = d.pop("readiness_probe", UNSET)
|
109
|
+
readiness_probe: Union[Unset, RuntimeReadinessProbe]
|
110
|
+
if isinstance(_readiness_probe, Unset):
|
111
|
+
readiness_probe = UNSET
|
112
|
+
else:
|
113
|
+
readiness_probe = RuntimeReadinessProbe.from_dict(_readiness_probe)
|
114
|
+
|
115
|
+
_resources = d.pop("resources", UNSET)
|
116
|
+
resources: Union[Unset, RuntimeResources]
|
117
|
+
if isinstance(_resources, Unset):
|
118
|
+
resources = UNSET
|
119
|
+
else:
|
120
|
+
resources = RuntimeResources.from_dict(_resources)
|
121
|
+
|
122
|
+
type = d.pop("type", UNSET)
|
123
|
+
|
124
|
+
runtime = cls(
|
125
|
+
args=args,
|
126
|
+
command=command,
|
127
|
+
envs=envs,
|
128
|
+
image=image,
|
129
|
+
model=model,
|
130
|
+
readiness_probe=readiness_probe,
|
131
|
+
resources=resources,
|
132
|
+
type=type,
|
133
|
+
)
|
134
|
+
|
135
|
+
runtime.additional_properties = d
|
136
|
+
return runtime
|
137
|
+
|
138
|
+
@property
|
139
|
+
def additional_keys(self) -> list[str]:
|
140
|
+
return list(self.additional_properties.keys())
|
141
|
+
|
142
|
+
def __getitem__(self, key: str) -> Any:
|
143
|
+
return self.additional_properties[key]
|
144
|
+
|
145
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
146
|
+
self.additional_properties[key] = value
|
147
|
+
|
148
|
+
def __delitem__(self, key: str) -> None:
|
149
|
+
del self.additional_properties[key]
|
150
|
+
|
151
|
+
def __contains__(self, key: str) -> bool:
|
152
|
+
return key in self.additional_properties
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeReadinessProbe")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeReadinessProbe:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
d = src_dict.copy()
|
24
|
+
runtime_readiness_probe = cls()
|
25
|
+
|
26
|
+
runtime_readiness_probe.additional_properties = d
|
27
|
+
return runtime_readiness_probe
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeResources")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeResources:
|
11
|
+
"""The resources for the deployment. Should be a Kubernetes ResourceRequirements type"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
d = src_dict.copy()
|
24
|
+
runtime_resources = cls()
|
25
|
+
|
26
|
+
runtime_resources.additional_properties = d
|
27
|
+
return runtime_resources
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|