lightning-sdk 2025.7.10__py3-none-any.whl → 2025.7.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lightning_sdk/__init__.py +3 -2
- lightning_sdk/api/cloud_account_api.py +154 -0
- lightning_sdk/api/deployment_api.py +11 -0
- lightning_sdk/api/job_api.py +9 -0
- lightning_sdk/api/llm_api.py +11 -6
- lightning_sdk/api/mmt_api.py +9 -0
- lightning_sdk/api/pipeline_api.py +4 -3
- lightning_sdk/api/studio_api.py +19 -5
- lightning_sdk/cli/clusters_menu.py +3 -3
- lightning_sdk/cli/create.py +22 -10
- lightning_sdk/cli/deploy/_auth.py +19 -3
- lightning_sdk/cli/deploy/serve.py +18 -4
- lightning_sdk/cli/entrypoint.py +1 -1
- lightning_sdk/cli/start.py +37 -7
- lightning_sdk/deployment/deployment.py +8 -0
- lightning_sdk/job/base.py +37 -5
- lightning_sdk/job/job.py +28 -4
- lightning_sdk/job/v1.py +10 -1
- lightning_sdk/job/v2.py +15 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +15 -1
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +335 -0
- lightning_sdk/lightning_cloud/openapi/api/billing_service_api.py +214 -0
- lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +5 -1
- lightning_sdk/lightning_cloud/openapi/api/user_service_api.py +11 -11
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +15 -1
- lightning_sdk/lightning_cloud/openapi/models/assistant_id_conversations_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/blogposts_id_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_new_features_for_user_response.py → conversations_id_body1.py} +23 -23
- lightning_sdk/lightning_cloud/openapi/models/messages_id_body.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_schedules_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/project_id_storage_body.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/protobuf_null_value.py +102 -0
- lightning_sdk/lightning_cloud/openapi/models/schedules_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/storage_complete_body.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/uploads_upload_id_body1.py +3 -55
- lightning_sdk/lightning_cloud/openapi/models/user_id_upgradetrigger_body.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_ai_pod_v1.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_artifact.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant_session_daily_aggregated.py +357 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_blog_post.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_provider.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_complete_upload.py +3 -55
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_billing_upgrade_trigger_record_response.py +97 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_create_blog_post_request.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_checkout_session_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_subscription_checkout_session_request.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_external_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_function_tool.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_artifacts_page_response.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_get_assistant_session_daily_aggregated_response.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_direct_v1.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_instance_artifact.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_like_status.py +104 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_notification_dialogs_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_list_published_managed_endpoint_models_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_message.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_presigned_url.py +1 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_project.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_quote_subscription_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_schedule.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_tool.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_conversation_like_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_update_conversation_message_like_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +105 -261
- lightning_sdk/lightning_cloud/openapi/models/v1_volume.py +27 -1
- lightning_sdk/llm/llm.py +32 -5
- lightning_sdk/llm/public_assistants.json +3 -1
- lightning_sdk/machine.py +24 -1
- lightning_sdk/mmt/base.py +20 -2
- lightning_sdk/mmt/mmt.py +25 -3
- lightning_sdk/mmt/v1.py +7 -1
- lightning_sdk/mmt/v2.py +21 -2
- lightning_sdk/organization.py +4 -0
- lightning_sdk/pipeline/pipeline.py +16 -5
- lightning_sdk/pipeline/printer.py +5 -3
- lightning_sdk/pipeline/schedule.py +844 -1
- lightning_sdk/pipeline/steps.py +19 -4
- lightning_sdk/sandbox.py +4 -1
- lightning_sdk/serve.py +2 -0
- lightning_sdk/studio.py +79 -39
- lightning_sdk/teamspace.py +14 -8
- lightning_sdk/utils/resolve.py +29 -2
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/RECORD +92 -78
- lightning_sdk/api/cluster_api.py +0 -119
- /lightning_sdk/cli/{inspect.py → inspection.py} +0 -0
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.7.10.dist-info → lightning_sdk-2025.7.22.dist-info}/top_level.txt +0 -0
lightning_sdk/api/cluster_api.py
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
from typing import Dict, List, Optional
|
|
2
|
-
|
|
3
|
-
from lightning_sdk.lightning_cloud.openapi import (
|
|
4
|
-
Externalv1Cluster,
|
|
5
|
-
V1CloudProvider,
|
|
6
|
-
V1ClusterType,
|
|
7
|
-
V1ExternalCluster,
|
|
8
|
-
V1ListClusterAcceleratorsResponse,
|
|
9
|
-
)
|
|
10
|
-
from lightning_sdk.lightning_cloud.rest_client import LightningClient
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class ClusterApi:
|
|
14
|
-
"""Internal API client for API requests to cluster endpoints."""
|
|
15
|
-
|
|
16
|
-
def __init__(self) -> None:
|
|
17
|
-
self._client = LightningClient(max_tries=7)
|
|
18
|
-
|
|
19
|
-
def get_cluster(self, cluster_id: str, project_id: str, org_id: str) -> Externalv1Cluster:
|
|
20
|
-
"""Gets the cluster from given params cluster_id, project_id and owner.
|
|
21
|
-
|
|
22
|
-
:param cluster_id: cluster ID test
|
|
23
|
-
:param project_id: the project the cluster is supposed to be associated with
|
|
24
|
-
:param org_id: The owning org of this cluster
|
|
25
|
-
:return:
|
|
26
|
-
"""
|
|
27
|
-
res = self._client.cluster_service_get_cluster(id=cluster_id, org_id=org_id, project_id=project_id)
|
|
28
|
-
if not res:
|
|
29
|
-
raise ValueError(f"Cluster {cluster_id} does not exist")
|
|
30
|
-
return res
|
|
31
|
-
|
|
32
|
-
def list_clusters(self, project_id: str) -> List[V1ExternalCluster]:
|
|
33
|
-
"""Lists the clusters for a given project.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
project_id: The project to list clusters for
|
|
37
|
-
|
|
38
|
-
Returns:
|
|
39
|
-
A list of clusters
|
|
40
|
-
"""
|
|
41
|
-
res = self._client.cluster_service_list_project_clusters(
|
|
42
|
-
project_id=project_id,
|
|
43
|
-
)
|
|
44
|
-
return res.clusters
|
|
45
|
-
|
|
46
|
-
def list_cluster_accelerators(self, cluster_id: str, org_id: str) -> V1ListClusterAcceleratorsResponse:
|
|
47
|
-
"""Lists the accelerators for a given cluster.
|
|
48
|
-
|
|
49
|
-
:param cluster_id: cluster ID test
|
|
50
|
-
:param project_id: the project the cluster is supposed to be associated with
|
|
51
|
-
:param org_id: The owning org of this cluster
|
|
52
|
-
"""
|
|
53
|
-
res = self._client.cluster_service_list_cluster_accelerators(
|
|
54
|
-
id=cluster_id,
|
|
55
|
-
org_id=org_id,
|
|
56
|
-
)
|
|
57
|
-
if not res:
|
|
58
|
-
raise ValueError(f"Cluster {cluster_id} does not exist")
|
|
59
|
-
return res
|
|
60
|
-
|
|
61
|
-
def list_global_clusters(self, project_id: str, org_id: str) -> List[Externalv1Cluster]:
|
|
62
|
-
"""Lists the accelerators for a given project.
|
|
63
|
-
|
|
64
|
-
:param project_id: project ID test
|
|
65
|
-
:param org_id: The owning org of this project
|
|
66
|
-
"""
|
|
67
|
-
res = self._client.cluster_service_list_clusters(
|
|
68
|
-
project_id=project_id,
|
|
69
|
-
org_id=org_id,
|
|
70
|
-
)
|
|
71
|
-
if not res:
|
|
72
|
-
raise ValueError(f"Project {project_id} does not exist")
|
|
73
|
-
filtered_clusters = filter(lambda x: x.spec.cluster_type == V1ClusterType.GLOBAL, res.clusters)
|
|
74
|
-
return list(filtered_clusters)
|
|
75
|
-
|
|
76
|
-
def get_cluster_provider_mapping(self, project_id: str, org_id: str) -> Dict[V1CloudProvider, str]:
|
|
77
|
-
"""Gets the cluster provider mapping."""
|
|
78
|
-
res = self.list_global_clusters(
|
|
79
|
-
project_id=project_id,
|
|
80
|
-
org_id=org_id,
|
|
81
|
-
)
|
|
82
|
-
return {self._get_cluster_provider(cluster): cluster.id for cluster in res}
|
|
83
|
-
|
|
84
|
-
def _get_cluster_provider(self, cluster: Optional[Externalv1Cluster]) -> V1CloudProvider:
|
|
85
|
-
"""Determines the cloud provider based on the cluster configuration.
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
cluster: An optional Externalv1Cluster object containing cluster specifications
|
|
89
|
-
|
|
90
|
-
Returns:
|
|
91
|
-
V1CloudProvider: The determined cloud provider, defaults to AWS if no match is found
|
|
92
|
-
"""
|
|
93
|
-
if not cluster:
|
|
94
|
-
return V1CloudProvider.AWS
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
cluster.spec
|
|
98
|
-
and cluster.spec.driver
|
|
99
|
-
and cluster.spec.driver in [V1CloudProvider.LIGHTNING, V1CloudProvider.DGX]
|
|
100
|
-
):
|
|
101
|
-
return cluster.spec.driver
|
|
102
|
-
|
|
103
|
-
if cluster.spec:
|
|
104
|
-
if cluster.spec.aws_v1:
|
|
105
|
-
return V1CloudProvider.AWS
|
|
106
|
-
if cluster.spec.google_cloud_v1:
|
|
107
|
-
return V1CloudProvider.GCP
|
|
108
|
-
if cluster.spec.lambda_labs_v1:
|
|
109
|
-
return V1CloudProvider.LAMBDA_LABS
|
|
110
|
-
if cluster.spec.vultr_v1:
|
|
111
|
-
return V1CloudProvider.VULTR
|
|
112
|
-
if cluster.spec.slurm_v1:
|
|
113
|
-
return V1CloudProvider.SLURM
|
|
114
|
-
if cluster.spec.voltage_park_v1:
|
|
115
|
-
return V1CloudProvider.VOLTAGE_PARK
|
|
116
|
-
if cluster.spec.nebius_v1:
|
|
117
|
-
return V1CloudProvider.NEBIUS
|
|
118
|
-
|
|
119
|
-
return V1CloudProvider.AWS
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|