beamlit 0.0.20rc5__py3-none-any.whl → 0.0.20rc7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/delete_agent_history.py +6 -2
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +6 -2
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +6 -2
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/list_integration_connections.py +11 -11
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +26 -10
- beamlit/authentication/apikey.py +4 -4
- beamlit/authentication/authentication.py +36 -5
- beamlit/authentication/clientcredentials.py +18 -20
- beamlit/authentication/credentials.py +18 -11
- beamlit/authentication/device_mode.py +15 -12
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +31 -19
- beamlit/common/logger.py +9 -12
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +78 -30
- beamlit/common/utils.py +4 -2
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/models/acl.py +2 -2
- beamlit/models/agent.py +3 -3
- beamlit/models/agent_chain.py +2 -2
- beamlit/models/agent_configuration.py +2 -2
- beamlit/models/agent_deployment.py +25 -25
- beamlit/models/agent_deployment_configuration.py +2 -2
- beamlit/models/agent_deployment_history.py +5 -5
- beamlit/models/agent_deployment_history_event.py +9 -9
- beamlit/models/agent_deployment_pod_template.py +2 -2
- beamlit/models/agent_release.py +2 -2
- beamlit/models/agent_spec.py +15 -5
- beamlit/models/agent_with_deployments.py +6 -6
- beamlit/models/api_key.py +2 -2
- beamlit/models/authentication_provider_model.py +6 -6
- beamlit/models/authentication_provider_organization.py +2 -2
- beamlit/models/configuration.py +10 -10
- beamlit/models/continent.py +2 -2
- beamlit/models/core_spec.py +9 -3
- beamlit/models/country.py +2 -2
- beamlit/models/create_api_key_for_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_response_200.py +2 -2
- beamlit/models/delete_workspace_service_account_response_200.py +2 -2
- beamlit/models/deployment_configuration.py +2 -2
- beamlit/models/deployment_configurations.py +2 -2
- beamlit/models/deployment_serverless_config.py +2 -2
- beamlit/models/deployment_serverless_config_type_0.py +3 -1
- beamlit/models/environment.py +7 -7
- beamlit/models/environment_metrics.py +8 -8
- beamlit/models/flavor.py +9 -9
- beamlit/models/function.py +3 -3
- beamlit/models/function_configuration.py +2 -2
- beamlit/models/function_deployment.py +24 -24
- beamlit/models/function_deployment_configuration.py +2 -2
- beamlit/models/function_deployment_pod_template.py +2 -2
- beamlit/models/function_kit.py +5 -5
- beamlit/models/function_provider_ref.py +2 -2
- beamlit/models/function_release.py +2 -2
- beamlit/models/function_spec.py +9 -3
- beamlit/models/function_with_deployments.py +6 -6
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
- beamlit/models/increase_and_rate_metric.py +5 -5
- beamlit/models/integration.py +12 -12
- beamlit/models/integration_config.py +2 -2
- beamlit/models/integration_connection.py +5 -5
- beamlit/models/integration_connection_config.py +2 -2
- beamlit/models/integration_connection_secret.py +2 -2
- beamlit/models/integration_model.py +6 -6
- beamlit/models/integration_secret.py +2 -2
- beamlit/models/invite_workspace_user_body.py +2 -2
- beamlit/models/labels_type_0.py +2 -2
- beamlit/models/location.py +5 -5
- beamlit/models/location_response.py +5 -5
- beamlit/models/metric.py +2 -2
- beamlit/models/metrics.py +8 -8
- beamlit/models/model.py +3 -3
- beamlit/models/model_deployment.py +18 -18
- beamlit/models/model_deployment_log.py +2 -2
- beamlit/models/model_deployment_metrics.py +9 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/model_deployment_pod_template.py +2 -2
- beamlit/models/model_metrics.py +6 -6
- beamlit/models/model_provider.py +11 -11
- beamlit/models/model_provider_ref.py +2 -2
- beamlit/models/model_release.py +2 -2
- beamlit/models/model_spec.py +9 -3
- beamlit/models/model_with_deployments.py +6 -6
- beamlit/models/pending_invitation.py +2 -2
- beamlit/models/pending_invitation_accept.py +3 -3
- beamlit/models/pending_invitation_render.py +5 -5
- beamlit/models/pending_invitation_render_invited_by.py +2 -2
- beamlit/models/pending_invitation_render_workspace.py +2 -2
- beamlit/models/pending_invitation_workspace_details.py +6 -6
- beamlit/models/policy.py +20 -20
- beamlit/models/policy_location.py +9 -9
- beamlit/models/policy_spec.py +9 -3
- beamlit/models/provider_config.py +7 -7
- beamlit/models/qps.py +2 -2
- beamlit/models/resource_deployment_log.py +2 -2
- beamlit/models/resource_deployment_metrics.py +16 -16
- beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/resource_environment_metrics.py +62 -24
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
- beamlit/models/resource_metrics.py +10 -10
- beamlit/models/runtime.py +23 -23
- beamlit/models/runtime_readiness_probe.py +2 -2
- beamlit/models/runtime_resources.py +2 -2
- beamlit/models/serverless_config.py +2 -2
- beamlit/models/standard_fields_dynamo_db.py +2 -2
- beamlit/models/store_agent.py +6 -6
- beamlit/models/store_agent_configuration.py +2 -2
- beamlit/models/store_agent_labels.py +2 -2
- beamlit/models/store_configuration.py +16 -16
- beamlit/models/store_configuration_option.py +2 -2
- beamlit/models/store_function.py +12 -12
- beamlit/models/store_function_configuration.py +2 -2
- beamlit/models/store_function_kit.py +5 -5
- beamlit/models/store_function_labels.py +2 -2
- beamlit/models/store_function_parameter.py +9 -9
- beamlit/models/update_workspace_service_account_body.py +2 -2
- beamlit/models/update_workspace_service_account_response_200.py +2 -2
- beamlit/models/update_workspace_user_role_body.py +2 -2
- beamlit/models/workspace.py +3 -3
- beamlit/models/workspace_labels.py +2 -2
- beamlit/models/workspace_user.py +2 -2
- beamlit/run.py +6 -6
- beamlit/serve/app.py +73 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/METADATA +7 -1
- beamlit-0.0.20rc7.dist-info/RECORD +293 -0
- beamlit-0.0.20rc5.dist-info/RECORD +0 -282
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/WHEEL +0 -0
beamlit/models/location.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class Location:
|
|
19
19
|
Attributes:
|
20
20
|
continent (Union[Unset, str]): Location continent
|
21
21
|
country (Union[Unset, str]): Location country
|
22
|
-
flavors (Union[Unset,
|
22
|
+
flavors (Union[Unset, list['Flavor']]): Location flavors
|
23
23
|
location (Union[Unset, str]): Location name
|
24
24
|
name (Union[Unset, str]): Location name
|
25
25
|
status (Union[Unset, str]): Location status
|
@@ -27,7 +27,7 @@ class Location:
|
|
27
27
|
|
28
28
|
continent: Union[Unset, str] = UNSET
|
29
29
|
country: Union[Unset, str] = UNSET
|
30
|
-
flavors: Union[Unset,
|
30
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
31
31
|
location: Union[Unset, str] = UNSET
|
32
32
|
name: Union[Unset, str] = UNSET
|
33
33
|
status: Union[Unset, str] = UNSET
|
@@ -38,7 +38,7 @@ class Location:
|
|
38
38
|
|
39
39
|
country = self.country
|
40
40
|
|
41
|
-
flavors: Union[Unset,
|
41
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
42
42
|
if not isinstance(self.flavors, Unset):
|
43
43
|
flavors = []
|
44
44
|
for flavors_item_data in self.flavors:
|
@@ -70,7 +70,7 @@ class Location:
|
|
70
70
|
return field_dict
|
71
71
|
|
72
72
|
@classmethod
|
73
|
-
def from_dict(cls:
|
73
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
74
74
|
from ..models.flavor import Flavor
|
75
75
|
|
76
76
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,14 +19,14 @@ class LocationResponse:
|
|
19
19
|
Attributes:
|
20
20
|
continent (Union[Unset, str]): Continent of the location
|
21
21
|
country (Union[Unset, str]): Country of the location
|
22
|
-
flavors (Union[Unset,
|
22
|
+
flavors (Union[Unset, list['Flavor']]): Hardware flavors available in the location
|
23
23
|
location (Union[Unset, str]): Name of the location
|
24
24
|
status (Union[Unset, str]): Status of the location
|
25
25
|
"""
|
26
26
|
|
27
27
|
continent: Union[Unset, str] = UNSET
|
28
28
|
country: Union[Unset, str] = UNSET
|
29
|
-
flavors: Union[Unset,
|
29
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
30
30
|
location: Union[Unset, str] = UNSET
|
31
31
|
status: Union[Unset, str] = UNSET
|
32
32
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -36,7 +36,7 @@ class LocationResponse:
|
|
36
36
|
|
37
37
|
country = self.country
|
38
38
|
|
39
|
-
flavors: Union[Unset,
|
39
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
40
40
|
if not isinstance(self.flavors, Unset):
|
41
41
|
flavors = []
|
42
42
|
for flavors_item_data in self.flavors:
|
@@ -64,7 +64,7 @@ class LocationResponse:
|
|
64
64
|
return field_dict
|
65
65
|
|
66
66
|
@classmethod
|
67
|
-
def from_dict(cls:
|
67
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
68
68
|
from ..models.flavor import Flavor
|
69
69
|
|
70
70
|
if not src_dict:
|
beamlit/models/metric.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,7 @@ class Metric:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
beamlit/models/metrics.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class Metrics:
|
|
19
19
|
|
20
20
|
Attributes:
|
21
21
|
inference_global (Union[Unset, Any]): Historical requests for all resources globally
|
22
|
-
inference_per_second_global (Union[Unset,
|
22
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
23
23
|
query (Union[Unset, Any]): Number of requests for all resources globally
|
24
24
|
query_per_second (Union[Unset, float]): RPS value (in last 24 hours) per location, for all resources globally
|
25
25
|
agents (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
|
@@ -28,7 +28,7 @@ class Metrics:
|
|
28
28
|
"""
|
29
29
|
|
30
30
|
inference_global: Union[Unset, Any] = UNSET
|
31
|
-
inference_per_second_global: Union[Unset,
|
31
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
32
32
|
query: Union[Unset, Any] = UNSET
|
33
33
|
query_per_second: Union[Unset, float] = UNSET
|
34
34
|
agents: Union[Unset, "IncreaseAndRateMetric"] = UNSET
|
@@ -39,7 +39,7 @@ class Metrics:
|
|
39
39
|
def to_dict(self) -> dict[str, Any]:
|
40
40
|
inference_global = self.inference_global
|
41
41
|
|
42
|
-
inference_per_second_global: Union[Unset,
|
42
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
43
43
|
if not isinstance(self.inference_per_second_global, Unset):
|
44
44
|
inference_per_second_global = []
|
45
45
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
@@ -50,15 +50,15 @@ class Metrics:
|
|
50
50
|
|
51
51
|
query_per_second = self.query_per_second
|
52
52
|
|
53
|
-
agents: Union[Unset,
|
53
|
+
agents: Union[Unset, dict[str, Any]] = UNSET
|
54
54
|
if not isinstance(self.agents, Unset):
|
55
55
|
agents = self.agents.to_dict()
|
56
56
|
|
57
|
-
functions: Union[Unset,
|
57
|
+
functions: Union[Unset, dict[str, Any]] = UNSET
|
58
58
|
if not isinstance(self.functions, Unset):
|
59
59
|
functions = self.functions.to_dict()
|
60
60
|
|
61
|
-
models: Union[Unset,
|
61
|
+
models: Union[Unset, dict[str, Any]] = UNSET
|
62
62
|
if not isinstance(self.models, Unset):
|
63
63
|
models = self.models.to_dict()
|
64
64
|
|
@@ -83,7 +83,7 @@ class Metrics:
|
|
83
83
|
return field_dict
|
84
84
|
|
85
85
|
@classmethod
|
86
|
-
def from_dict(cls:
|
86
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
87
87
|
from ..models.increase_and_rate_metric import IncreaseAndRateMetric
|
88
88
|
from ..models.metric import Metric
|
89
89
|
|
beamlit/models/model.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -50,7 +50,7 @@ class Model:
|
|
50
50
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
|
-
labels: Union[
|
53
|
+
labels: Union[None, Unset, dict[str, Any]]
|
54
54
|
if isinstance(self.labels, Unset):
|
55
55
|
labels = UNSET
|
56
56
|
elif isinstance(self.labels, LabelsType0):
|
@@ -85,7 +85,7 @@ class Model:
|
|
85
85
|
return field_dict
|
86
86
|
|
87
87
|
@classmethod
|
88
|
-
def from_dict(cls:
|
88
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
89
|
from ..models.labels_type_0 import LabelsType0
|
90
90
|
|
91
91
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -28,15 +28,15 @@ class ModelDeployment:
|
|
28
28
|
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
29
29
|
enabled (Union[Unset, bool]): If false, the model deployment will not be active nor serve requests
|
30
30
|
environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
|
31
|
-
flavors (Union[Unset,
|
32
|
-
integration_connections (Union[Unset,
|
31
|
+
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
32
|
+
integration_connections (Union[Unset, list[str]]):
|
33
33
|
labels (Union['LabelsType0', None, Unset]): Labels
|
34
34
|
metric_port (Union[Unset, int]): The port to serve the metrics on
|
35
35
|
model (Union[Unset, str]): The name of the parent model
|
36
36
|
model_provider_ref (Union[Unset, ModelProviderRef]): Reference to a model provider
|
37
37
|
pod_template (Union[Unset, ModelDeploymentPodTemplate]): The pod template for the deployment. Should be a
|
38
38
|
Kubernetes PodTemplateSpec
|
39
|
-
policies (Union[Unset,
|
39
|
+
policies (Union[Unset, list[str]]):
|
40
40
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
41
41
|
serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
|
42
42
|
serving_port (Union[Unset, int]): The port to serve the model on
|
@@ -49,14 +49,14 @@ class ModelDeployment:
|
|
49
49
|
updated_by: Union[Unset, str] = UNSET
|
50
50
|
enabled: Union[Unset, bool] = UNSET
|
51
51
|
environment: Union[Unset, str] = UNSET
|
52
|
-
flavors: Union[Unset,
|
53
|
-
integration_connections: Union[Unset,
|
52
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
53
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
54
54
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
55
55
|
metric_port: Union[Unset, int] = UNSET
|
56
56
|
model: Union[Unset, str] = UNSET
|
57
57
|
model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
|
58
58
|
pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
|
59
|
-
policies: Union[Unset,
|
59
|
+
policies: Union[Unset, list[str]] = UNSET
|
60
60
|
runtime: Union[Unset, "Runtime"] = UNSET
|
61
61
|
serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
|
62
62
|
serving_port: Union[Unset, int] = UNSET
|
@@ -78,18 +78,18 @@ class ModelDeployment:
|
|
78
78
|
|
79
79
|
environment = self.environment
|
80
80
|
|
81
|
-
flavors: Union[Unset,
|
81
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
82
82
|
if not isinstance(self.flavors, Unset):
|
83
83
|
flavors = []
|
84
84
|
for componentsschemas_flavors_item_data in self.flavors:
|
85
85
|
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
86
86
|
flavors.append(componentsschemas_flavors_item)
|
87
87
|
|
88
|
-
integration_connections: Union[Unset,
|
88
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
89
89
|
if not isinstance(self.integration_connections, Unset):
|
90
90
|
integration_connections = self.integration_connections
|
91
91
|
|
92
|
-
labels: Union[
|
92
|
+
labels: Union[None, Unset, dict[str, Any]]
|
93
93
|
if isinstance(self.labels, Unset):
|
94
94
|
labels = UNSET
|
95
95
|
elif isinstance(self.labels, LabelsType0):
|
@@ -101,23 +101,23 @@ class ModelDeployment:
|
|
101
101
|
|
102
102
|
model = self.model
|
103
103
|
|
104
|
-
model_provider_ref: Union[Unset,
|
104
|
+
model_provider_ref: Union[Unset, dict[str, Any]] = UNSET
|
105
105
|
if not isinstance(self.model_provider_ref, Unset):
|
106
106
|
model_provider_ref = self.model_provider_ref.to_dict()
|
107
107
|
|
108
|
-
pod_template: Union[Unset,
|
108
|
+
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
109
109
|
if not isinstance(self.pod_template, Unset):
|
110
110
|
pod_template = self.pod_template.to_dict()
|
111
111
|
|
112
|
-
policies: Union[Unset,
|
112
|
+
policies: Union[Unset, list[str]] = UNSET
|
113
113
|
if not isinstance(self.policies, Unset):
|
114
114
|
policies = self.policies
|
115
115
|
|
116
|
-
runtime: Union[Unset,
|
116
|
+
runtime: Union[Unset, dict[str, Any]] = UNSET
|
117
117
|
if not isinstance(self.runtime, Unset):
|
118
118
|
runtime = self.runtime.to_dict()
|
119
119
|
|
120
|
-
serverless_config: Union[Unset,
|
120
|
+
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
121
121
|
if not isinstance(self.serverless_config, Unset):
|
122
122
|
serverless_config = self.serverless_config.to_dict()
|
123
123
|
|
@@ -168,7 +168,7 @@ class ModelDeployment:
|
|
168
168
|
return field_dict
|
169
169
|
|
170
170
|
@classmethod
|
171
|
-
def from_dict(cls:
|
171
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
172
172
|
from ..models.deployment_serverless_config import DeploymentServerlessConfig
|
173
173
|
from ..models.flavor import Flavor
|
174
174
|
from ..models.labels_type_0 import LabelsType0
|
@@ -198,7 +198,7 @@ class ModelDeployment:
|
|
198
198
|
|
199
199
|
flavors.append(componentsschemas_flavors_item)
|
200
200
|
|
201
|
-
integration_connections = cast(
|
201
|
+
integration_connections = cast(list[str], d.pop("integration_connections", UNSET))
|
202
202
|
|
203
203
|
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
204
204
|
if data is None:
|
@@ -235,7 +235,7 @@ class ModelDeployment:
|
|
235
235
|
else:
|
236
236
|
pod_template = ModelDeploymentPodTemplate.from_dict(_pod_template)
|
237
237
|
|
238
|
-
policies = cast(
|
238
|
+
policies = cast(list[str], d.pop("policies", UNSET))
|
239
239
|
|
240
240
|
_runtime = d.pop("runtime", UNSET)
|
241
241
|
runtime: Union[Unset, Runtime]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,7 @@ class ModelDeploymentLog:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -24,7 +24,7 @@ class ModelDeploymentMetrics:
|
|
24
24
|
"""Metrics for a single model deployment
|
25
25
|
|
26
26
|
Attributes:
|
27
|
-
inference_per_second_global (Union[Unset,
|
27
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
28
28
|
inference_per_second_per_region (Union[Unset, ModelDeploymentMetricsInferencePerSecondPerRegion]): Historical
|
29
29
|
requests per second (RPS) per location, for the model deployment
|
30
30
|
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
@@ -36,7 +36,7 @@ class ModelDeploymentMetrics:
|
|
36
36
|
value (in last 24 hours) per response status code per location, for the model deployment
|
37
37
|
"""
|
38
38
|
|
39
|
-
inference_per_second_global: Union[Unset,
|
39
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
40
40
|
inference_per_second_per_region: Union[Unset, "ModelDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
|
41
41
|
query_per_second_global: Union[Unset, float] = UNSET
|
42
42
|
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
@@ -45,28 +45,28 @@ class ModelDeploymentMetrics:
|
|
45
45
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
46
|
|
47
47
|
def to_dict(self) -> dict[str, Any]:
|
48
|
-
inference_per_second_global: Union[Unset,
|
48
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
49
49
|
if not isinstance(self.inference_per_second_global, Unset):
|
50
50
|
inference_per_second_global = []
|
51
51
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
52
52
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
53
53
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
54
54
|
|
55
|
-
inference_per_second_per_region: Union[Unset,
|
55
|
+
inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
56
56
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
57
57
|
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
58
58
|
|
59
59
|
query_per_second_global = self.query_per_second_global
|
60
60
|
|
61
|
-
query_per_second_per_code_global: Union[Unset,
|
61
|
+
query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
62
62
|
if not isinstance(self.query_per_second_per_code_global, Unset):
|
63
63
|
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
64
64
|
|
65
|
-
query_per_second_per_region: Union[Unset,
|
65
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
66
66
|
if not isinstance(self.query_per_second_per_region, Unset):
|
67
67
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
68
68
|
|
69
|
-
query_per_second_per_region_per_code: Union[Unset,
|
69
|
+
query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
70
70
|
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
71
71
|
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
72
72
|
|
@@ -89,7 +89,7 @@ class ModelDeploymentMetrics:
|
|
89
89
|
return field_dict
|
90
90
|
|
91
91
|
@classmethod
|
92
|
-
def from_dict(cls:
|
92
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
93
93
|
from ..models.metric import Metric
|
94
94
|
from ..models.model_deployment_metrics_inference_per_second_per_region import (
|
95
95
|
ModelDeploymentMetricsInferencePerSecondPerRegion,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -17,14 +17,14 @@ class ModelDeploymentMetricsInferencePerSecondPerRegion:
|
|
17
17
|
"""Historical requests per second (RPS) per location, for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
region (Union[Unset,
|
20
|
+
region (Union[Unset, list['Metric']]): Array of metrics
|
21
21
|
"""
|
22
22
|
|
23
|
-
region: Union[Unset,
|
23
|
+
region: Union[Unset, list["Metric"]] = UNSET
|
24
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
25
|
|
26
26
|
def to_dict(self) -> dict[str, Any]:
|
27
|
-
region: Union[Unset,
|
27
|
+
region: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
@@ -40,7 +40,7 @@ class ModelDeploymentMetricsInferencePerSecondPerRegion:
|
|
40
40
|
return field_dict
|
41
41
|
|
42
42
|
@classmethod
|
43
|
-
def from_dict(cls:
|
43
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
44
44
|
from ..models.metric import Metric
|
45
45
|
|
46
46
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -25,7 +25,7 @@ class ModelDeploymentMetricsQueryPerSecondPerRegionPerCode:
|
|
25
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
26
|
|
27
27
|
def to_dict(self) -> dict[str, Any]:
|
28
|
-
region: Union[Unset,
|
28
|
+
region: Union[Unset, dict[str, Any]] = UNSET
|
29
29
|
if not isinstance(self.region, Unset):
|
30
30
|
region = self.region.to_dict()
|
31
31
|
|
@@ -38,7 +38,7 @@ class ModelDeploymentMetricsQueryPerSecondPerRegionPerCode:
|
|
38
38
|
return field_dict
|
39
39
|
|
40
40
|
@classmethod
|
41
|
-
def from_dict(cls:
|
41
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
42
42
|
from ..models.qps import QPS
|
43
43
|
|
44
44
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class ModelDeploymentPodTemplate:
|
|
19
19
|
return field_dict
|
20
20
|
|
21
21
|
@classmethod
|
22
|
-
def from_dict(cls:
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
beamlit/models/model_metrics.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -18,24 +18,24 @@ class ModelMetrics:
|
|
18
18
|
"""Metrics for a single model
|
19
19
|
|
20
20
|
Attributes:
|
21
|
-
inference_per_second_global (Union[Unset,
|
21
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
22
22
|
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
23
23
|
(e.g. 200, 400) or per location
|
24
24
|
"""
|
25
25
|
|
26
|
-
inference_per_second_global: Union[Unset,
|
26
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
27
27
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
28
28
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
29
|
|
30
30
|
def to_dict(self) -> dict[str, Any]:
|
31
|
-
inference_per_second_global: Union[Unset,
|
31
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
32
32
|
if not isinstance(self.inference_per_second_global, Unset):
|
33
33
|
inference_per_second_global = []
|
34
34
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
35
35
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
36
36
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
37
37
|
|
38
|
-
query_per_second_per_region: Union[Unset,
|
38
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
39
39
|
if not isinstance(self.query_per_second_per_region, Unset):
|
40
40
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
41
41
|
|
@@ -50,7 +50,7 @@ class ModelMetrics:
|
|
50
50
|
return field_dict
|
51
51
|
|
52
52
|
@classmethod
|
53
|
-
def from_dict(cls:
|
53
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
54
54
|
from ..models.metric import Metric
|
55
55
|
from ..models.qps import QPS
|
56
56
|
|
beamlit/models/model_provider.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -27,7 +27,7 @@ class ModelProvider:
|
|
27
27
|
display_name (Union[Unset, str]): Model provider display name
|
28
28
|
labels (Union['LabelsType0', None, Unset]): Labels
|
29
29
|
name (Union[Unset, str]): Model provider name
|
30
|
-
|
30
|
+
type_ (Union[Unset, str]): Model provider type
|
31
31
|
workspace (Union[Unset, str]): Workspace name
|
32
32
|
"""
|
33
33
|
|
@@ -40,7 +40,7 @@ class ModelProvider:
|
|
40
40
|
display_name: Union[Unset, str] = UNSET
|
41
41
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
42
42
|
name: Union[Unset, str] = UNSET
|
43
|
-
|
43
|
+
type_: Union[Unset, str] = UNSET
|
44
44
|
workspace: Union[Unset, str] = UNSET
|
45
45
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
46
|
|
@@ -57,13 +57,13 @@ class ModelProvider:
|
|
57
57
|
|
58
58
|
comment = self.comment
|
59
59
|
|
60
|
-
config: Union[Unset,
|
60
|
+
config: Union[Unset, dict[str, Any]] = UNSET
|
61
61
|
if not isinstance(self.config, Unset):
|
62
62
|
config = self.config.to_dict()
|
63
63
|
|
64
64
|
display_name = self.display_name
|
65
65
|
|
66
|
-
labels: Union[
|
66
|
+
labels: Union[None, Unset, dict[str, Any]]
|
67
67
|
if isinstance(self.labels, Unset):
|
68
68
|
labels = UNSET
|
69
69
|
elif isinstance(self.labels, LabelsType0):
|
@@ -73,7 +73,7 @@ class ModelProvider:
|
|
73
73
|
|
74
74
|
name = self.name
|
75
75
|
|
76
|
-
|
76
|
+
type_ = self.type_
|
77
77
|
|
78
78
|
workspace = self.workspace
|
79
79
|
|
@@ -98,15 +98,15 @@ class ModelProvider:
|
|
98
98
|
field_dict["labels"] = labels
|
99
99
|
if name is not UNSET:
|
100
100
|
field_dict["name"] = name
|
101
|
-
if
|
102
|
-
field_dict["type"] =
|
101
|
+
if type_ is not UNSET:
|
102
|
+
field_dict["type"] = type_
|
103
103
|
if workspace is not UNSET:
|
104
104
|
field_dict["workspace"] = workspace
|
105
105
|
|
106
106
|
return field_dict
|
107
107
|
|
108
108
|
@classmethod
|
109
|
-
def from_dict(cls:
|
109
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
110
110
|
from ..models.labels_type_0 import LabelsType0
|
111
111
|
from ..models.provider_config import ProviderConfig
|
112
112
|
|
@@ -151,7 +151,7 @@ class ModelProvider:
|
|
151
151
|
|
152
152
|
name = d.pop("name", UNSET)
|
153
153
|
|
154
|
-
|
154
|
+
type_ = d.pop("type", UNSET)
|
155
155
|
|
156
156
|
workspace = d.pop("workspace", UNSET)
|
157
157
|
|
@@ -165,7 +165,7 @@ class ModelProvider:
|
|
165
165
|
display_name=display_name,
|
166
166
|
labels=labels,
|
167
167
|
name=name,
|
168
|
-
|
168
|
+
type_=type_,
|
169
169
|
workspace=workspace,
|
170
170
|
)
|
171
171
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,7 @@ class ModelProviderRef:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
beamlit/models/model_release.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,7 @@ class ModelRelease:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
beamlit/models/model_spec.py
CHANGED
@@ -55,7 +55,9 @@ class ModelSpec:
|
|
55
55
|
if not isinstance(self.flavors, Unset):
|
56
56
|
flavors = []
|
57
57
|
for componentsschemas_flavors_item_data in self.flavors:
|
58
|
-
componentsschemas_flavors_item =
|
58
|
+
componentsschemas_flavors_item = (
|
59
|
+
componentsschemas_flavors_item_data.to_dict()
|
60
|
+
)
|
59
61
|
flavors.append(componentsschemas_flavors_item)
|
60
62
|
|
61
63
|
integration_connections: Union[Unset, List[str]] = UNSET
|
@@ -125,11 +127,15 @@ class ModelSpec:
|
|
125
127
|
flavors = []
|
126
128
|
_flavors = d.pop("flavors", UNSET)
|
127
129
|
for componentsschemas_flavors_item_data in _flavors or []:
|
128
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
130
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
131
|
+
componentsschemas_flavors_item_data
|
132
|
+
)
|
129
133
|
|
130
134
|
flavors.append(componentsschemas_flavors_item)
|
131
135
|
|
132
|
-
integration_connections = cast(
|
136
|
+
integration_connections = cast(
|
137
|
+
List[str], d.pop("integrationConnections", UNSET)
|
138
|
+
)
|
133
139
|
|
134
140
|
_pod_template = d.pop("podTemplate", UNSET)
|
135
141
|
pod_template: Union[Unset, PodTemplateSpec]
|