lightning-sdk 2025.7.22__py3-none-any.whl → 2025.7.31__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 +1 -1
- lightning_sdk/api/cloud_account_api.py +58 -8
- lightning_sdk/api/job_api.py +74 -11
- lightning_sdk/api/llm_api.py +1 -1
- lightning_sdk/api/mmt_api.py +35 -5
- lightning_sdk/api/studio_api.py +32 -3
- lightning_sdk/api/utils.py +6 -2
- lightning_sdk/cli/create.py +3 -1
- lightning_sdk/cli/deploy/serve.py +3 -1
- lightning_sdk/cli/download.py +25 -1
- lightning_sdk/cli/entrypoint.py +3 -1
- lightning_sdk/cli/list.py +5 -1
- lightning_sdk/cli/run.py +3 -1
- lightning_sdk/cli/start.py +3 -1
- lightning_sdk/cli/switch.py +3 -1
- lightning_sdk/job/v2.py +7 -1
- lightning_sdk/job/work.py +5 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +6 -1
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +106 -13
- lightning_sdk/lightning_cloud/openapi/api/cloudy_service_api.py +295 -0
- lightning_sdk/lightning_cloud/openapi/api/cluster_service_api.py +93 -0
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +6 -1
- lightning_sdk/lightning_cloud/openapi/models/agentmanagedendpoints_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/metricsstream_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/project_id_schedules_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/schedules_id_body.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/user_id_upgradetrigger_body.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/user_user_id_body.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_billing_subscription.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloudy_settings.py +227 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_conversation_response_chunk.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_subscription_checkout_session_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_function_call.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_cluster_health_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_job_spec.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_direct_v1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/{v1_list_published_managed_endpoint_models_response.py → v1_list_published_managed_endpoints_response.py} +23 -23
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_endpoint.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_managed_model.py +95 -17
- lightning_sdk/lightning_cloud/openapi/models/v1_resource_visibility.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_response_choice.py +29 -3
- lightning_sdk/lightning_cloud/openapi/models/v1_schedule.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_service_health.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_slurm_v1.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_slurm_v1_status.py +79 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_tool_call.py +175 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_volume_state.py +1 -0
- lightning_sdk/llm/llm.py +41 -7
- lightning_sdk/llm/public_assistants.json +32 -8
- lightning_sdk/machine.py +139 -43
- lightning_sdk/mmt/v2.py +6 -1
- lightning_sdk/models.py +1 -1
- lightning_sdk/studio.py +12 -5
- lightning_sdk/teamspace.py +5 -2
- lightning_sdk/utils/resolve.py +8 -0
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/METADATA +7 -5
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/RECORD +64 -59
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.7.22.dist-info → lightning_sdk-2025.7.31.dist-info}/top_level.txt +0 -0
|
@@ -42,21 +42,36 @@ class V1SlurmV1Status(object):
|
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
44
|
'nodes': 'list[V1SlurmNode]',
|
|
45
|
+
'ssh_host': 'str',
|
|
46
|
+
'ssh_port': 'int',
|
|
47
|
+
'ssh_username': 'str',
|
|
45
48
|
'version': 'str'
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
attribute_map = {
|
|
49
52
|
'nodes': 'nodes',
|
|
53
|
+
'ssh_host': 'sshHost',
|
|
54
|
+
'ssh_port': 'sshPort',
|
|
55
|
+
'ssh_username': 'sshUsername',
|
|
50
56
|
'version': 'version'
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
def __init__(self, nodes: 'list[V1SlurmNode]' =None, version: 'str' =None): # noqa: E501
|
|
59
|
+
def __init__(self, nodes: 'list[V1SlurmNode]' =None, ssh_host: 'str' =None, ssh_port: 'int' =None, ssh_username: 'str' =None, version: 'str' =None): # noqa: E501
|
|
54
60
|
"""V1SlurmV1Status - a model defined in Swagger""" # noqa: E501
|
|
55
61
|
self._nodes = None
|
|
62
|
+
self._ssh_host = None
|
|
63
|
+
self._ssh_port = None
|
|
64
|
+
self._ssh_username = None
|
|
56
65
|
self._version = None
|
|
57
66
|
self.discriminator = None
|
|
58
67
|
if nodes is not None:
|
|
59
68
|
self.nodes = nodes
|
|
69
|
+
if ssh_host is not None:
|
|
70
|
+
self.ssh_host = ssh_host
|
|
71
|
+
if ssh_port is not None:
|
|
72
|
+
self.ssh_port = ssh_port
|
|
73
|
+
if ssh_username is not None:
|
|
74
|
+
self.ssh_username = ssh_username
|
|
60
75
|
if version is not None:
|
|
61
76
|
self.version = version
|
|
62
77
|
|
|
@@ -81,6 +96,69 @@ class V1SlurmV1Status(object):
|
|
|
81
96
|
|
|
82
97
|
self._nodes = nodes
|
|
83
98
|
|
|
99
|
+
@property
|
|
100
|
+
def ssh_host(self) -> 'str':
|
|
101
|
+
"""Gets the ssh_host of this V1SlurmV1Status. # noqa: E501
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
:return: The ssh_host of this V1SlurmV1Status. # noqa: E501
|
|
105
|
+
:rtype: str
|
|
106
|
+
"""
|
|
107
|
+
return self._ssh_host
|
|
108
|
+
|
|
109
|
+
@ssh_host.setter
|
|
110
|
+
def ssh_host(self, ssh_host: 'str'):
|
|
111
|
+
"""Sets the ssh_host of this V1SlurmV1Status.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
:param ssh_host: The ssh_host of this V1SlurmV1Status. # noqa: E501
|
|
115
|
+
:type: str
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
self._ssh_host = ssh_host
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def ssh_port(self) -> 'int':
|
|
122
|
+
"""Gets the ssh_port of this V1SlurmV1Status. # noqa: E501
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
:return: The ssh_port of this V1SlurmV1Status. # noqa: E501
|
|
126
|
+
:rtype: int
|
|
127
|
+
"""
|
|
128
|
+
return self._ssh_port
|
|
129
|
+
|
|
130
|
+
@ssh_port.setter
|
|
131
|
+
def ssh_port(self, ssh_port: 'int'):
|
|
132
|
+
"""Sets the ssh_port of this V1SlurmV1Status.
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
:param ssh_port: The ssh_port of this V1SlurmV1Status. # noqa: E501
|
|
136
|
+
:type: int
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
self._ssh_port = ssh_port
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
def ssh_username(self) -> 'str':
|
|
143
|
+
"""Gets the ssh_username of this V1SlurmV1Status. # noqa: E501
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
:return: The ssh_username of this V1SlurmV1Status. # noqa: E501
|
|
147
|
+
:rtype: str
|
|
148
|
+
"""
|
|
149
|
+
return self._ssh_username
|
|
150
|
+
|
|
151
|
+
@ssh_username.setter
|
|
152
|
+
def ssh_username(self, ssh_username: 'str'):
|
|
153
|
+
"""Sets the ssh_username of this V1SlurmV1Status.
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
:param ssh_username: The ssh_username of this V1SlurmV1Status. # noqa: E501
|
|
157
|
+
:type: str
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
self._ssh_username = ssh_username
|
|
161
|
+
|
|
84
162
|
@property
|
|
85
163
|
def version(self) -> 'str':
|
|
86
164
|
"""Gets the version of this V1SlurmV1Status. # noqa: E501
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
external/v1/auth_service.proto
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: version not set
|
|
9
|
+
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
|
|
12
|
+
NOTE
|
|
13
|
+
----
|
|
14
|
+
standard swagger-codegen-cli for this python client has been modified
|
|
15
|
+
by custom templates. The purpose of these templates is to include
|
|
16
|
+
typing information in the API and Model code. Please refer to the
|
|
17
|
+
main grid repository for more info
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import pprint
|
|
21
|
+
import re # noqa: F401
|
|
22
|
+
|
|
23
|
+
from typing import TYPE_CHECKING
|
|
24
|
+
|
|
25
|
+
import six
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
from datetime import datetime
|
|
29
|
+
from lightning_sdk.lightning_cloud.openapi.models import *
|
|
30
|
+
|
|
31
|
+
class V1ToolCall(object):
|
|
32
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
33
|
+
|
|
34
|
+
Do not edit the class manually.
|
|
35
|
+
"""
|
|
36
|
+
"""
|
|
37
|
+
Attributes:
|
|
38
|
+
swagger_types (dict): The key is attribute name
|
|
39
|
+
and the value is attribute type.
|
|
40
|
+
attribute_map (dict): The key is attribute name
|
|
41
|
+
and the value is json key in definition.
|
|
42
|
+
"""
|
|
43
|
+
swagger_types = {
|
|
44
|
+
'function': 'V1FunctionCall',
|
|
45
|
+
'id': 'str',
|
|
46
|
+
'type': 'str'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
attribute_map = {
|
|
50
|
+
'function': 'function',
|
|
51
|
+
'id': 'id',
|
|
52
|
+
'type': 'type'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
def __init__(self, function: 'V1FunctionCall' =None, id: 'str' =None, type: 'str' =None): # noqa: E501
|
|
56
|
+
"""V1ToolCall - a model defined in Swagger""" # noqa: E501
|
|
57
|
+
self._function = None
|
|
58
|
+
self._id = None
|
|
59
|
+
self._type = None
|
|
60
|
+
self.discriminator = None
|
|
61
|
+
if function is not None:
|
|
62
|
+
self.function = function
|
|
63
|
+
if id is not None:
|
|
64
|
+
self.id = id
|
|
65
|
+
if type is not None:
|
|
66
|
+
self.type = type
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def function(self) -> 'V1FunctionCall':
|
|
70
|
+
"""Gets the function of this V1ToolCall. # noqa: E501
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
:return: The function of this V1ToolCall. # noqa: E501
|
|
74
|
+
:rtype: V1FunctionCall
|
|
75
|
+
"""
|
|
76
|
+
return self._function
|
|
77
|
+
|
|
78
|
+
@function.setter
|
|
79
|
+
def function(self, function: 'V1FunctionCall'):
|
|
80
|
+
"""Sets the function of this V1ToolCall.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
:param function: The function of this V1ToolCall. # noqa: E501
|
|
84
|
+
:type: V1FunctionCall
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
self._function = function
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def id(self) -> 'str':
|
|
91
|
+
"""Gets the id of this V1ToolCall. # noqa: E501
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
:return: The id of this V1ToolCall. # noqa: E501
|
|
95
|
+
:rtype: str
|
|
96
|
+
"""
|
|
97
|
+
return self._id
|
|
98
|
+
|
|
99
|
+
@id.setter
|
|
100
|
+
def id(self, id: 'str'):
|
|
101
|
+
"""Sets the id of this V1ToolCall.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
:param id: The id of this V1ToolCall. # noqa: E501
|
|
105
|
+
:type: str
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
self._id = id
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def type(self) -> 'str':
|
|
112
|
+
"""Gets the type of this V1ToolCall. # noqa: E501
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
:return: The type of this V1ToolCall. # noqa: E501
|
|
116
|
+
:rtype: str
|
|
117
|
+
"""
|
|
118
|
+
return self._type
|
|
119
|
+
|
|
120
|
+
@type.setter
|
|
121
|
+
def type(self, type: 'str'):
|
|
122
|
+
"""Sets the type of this V1ToolCall.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
:param type: The type of this V1ToolCall. # noqa: E501
|
|
126
|
+
:type: str
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
self._type = type
|
|
130
|
+
|
|
131
|
+
def to_dict(self) -> dict:
|
|
132
|
+
"""Returns the model properties as a dict"""
|
|
133
|
+
result = {}
|
|
134
|
+
|
|
135
|
+
for attr, _ in six.iteritems(self.swagger_types):
|
|
136
|
+
value = getattr(self, attr)
|
|
137
|
+
if isinstance(value, list):
|
|
138
|
+
result[attr] = list(map(
|
|
139
|
+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
|
140
|
+
value
|
|
141
|
+
))
|
|
142
|
+
elif hasattr(value, "to_dict"):
|
|
143
|
+
result[attr] = value.to_dict()
|
|
144
|
+
elif isinstance(value, dict):
|
|
145
|
+
result[attr] = dict(map(
|
|
146
|
+
lambda item: (item[0], item[1].to_dict())
|
|
147
|
+
if hasattr(item[1], "to_dict") else item,
|
|
148
|
+
value.items()
|
|
149
|
+
))
|
|
150
|
+
else:
|
|
151
|
+
result[attr] = value
|
|
152
|
+
if issubclass(V1ToolCall, dict):
|
|
153
|
+
for key, value in self.items():
|
|
154
|
+
result[key] = value
|
|
155
|
+
|
|
156
|
+
return result
|
|
157
|
+
|
|
158
|
+
def to_str(self) -> str:
|
|
159
|
+
"""Returns the string representation of the model"""
|
|
160
|
+
return pprint.pformat(self.to_dict())
|
|
161
|
+
|
|
162
|
+
def __repr__(self) -> str:
|
|
163
|
+
"""For `print` and `pprint`"""
|
|
164
|
+
return self.to_str()
|
|
165
|
+
|
|
166
|
+
def __eq__(self, other: 'V1ToolCall') -> bool:
|
|
167
|
+
"""Returns true if both objects are equal"""
|
|
168
|
+
if not isinstance(other, V1ToolCall):
|
|
169
|
+
return False
|
|
170
|
+
|
|
171
|
+
return self.__dict__ == other.__dict__
|
|
172
|
+
|
|
173
|
+
def __ne__(self, other: 'V1ToolCall') -> bool:
|
|
174
|
+
"""Returns true if both objects are not equal"""
|
|
175
|
+
return not self == other
|
|
@@ -56,19 +56,20 @@ class V1UserFeatures(object):
|
|
|
56
56
|
'capacity_reservation_dry_run': 'bool',
|
|
57
57
|
'chat_models': 'bool',
|
|
58
58
|
'cloudspace_schedules': 'bool',
|
|
59
|
-
'cloudy_vibe_code': 'bool',
|
|
60
59
|
'code_tab': 'bool',
|
|
61
60
|
'collab_screen_sharing': 'bool',
|
|
62
61
|
'control_center_monitoring': 'bool',
|
|
63
62
|
'cost_attribution_settings': 'bool',
|
|
64
63
|
'custom_app_domain': 'bool',
|
|
65
|
-
'data_connection_flushing_v2': 'bool',
|
|
66
64
|
'datasets': 'bool',
|
|
67
65
|
'default_one_cluster': 'bool',
|
|
68
66
|
'deployment_persistent_disk': 'bool',
|
|
69
67
|
'drive_v2': 'bool',
|
|
70
68
|
'enterprise_compute_admin': 'bool',
|
|
71
69
|
'f236': 'bool',
|
|
70
|
+
'f237': 'bool',
|
|
71
|
+
'f238': 'bool',
|
|
72
|
+
'f239': 'bool',
|
|
72
73
|
'fair_share': 'bool',
|
|
73
74
|
'featured_studios_admin': 'bool',
|
|
74
75
|
'gcp_overprovisioning': 'bool',
|
|
@@ -143,19 +144,20 @@ class V1UserFeatures(object):
|
|
|
143
144
|
'capacity_reservation_dry_run': 'capacityReservationDryRun',
|
|
144
145
|
'chat_models': 'chatModels',
|
|
145
146
|
'cloudspace_schedules': 'cloudspaceSchedules',
|
|
146
|
-
'cloudy_vibe_code': 'cloudyVibeCode',
|
|
147
147
|
'code_tab': 'codeTab',
|
|
148
148
|
'collab_screen_sharing': 'collabScreenSharing',
|
|
149
149
|
'control_center_monitoring': 'controlCenterMonitoring',
|
|
150
150
|
'cost_attribution_settings': 'costAttributionSettings',
|
|
151
151
|
'custom_app_domain': 'customAppDomain',
|
|
152
|
-
'data_connection_flushing_v2': 'dataConnectionFlushingV2',
|
|
153
152
|
'datasets': 'datasets',
|
|
154
153
|
'default_one_cluster': 'defaultOneCluster',
|
|
155
154
|
'deployment_persistent_disk': 'deploymentPersistentDisk',
|
|
156
155
|
'drive_v2': 'driveV2',
|
|
157
156
|
'enterprise_compute_admin': 'enterpriseComputeAdmin',
|
|
158
157
|
'f236': 'f236',
|
|
158
|
+
'f237': 'f237',
|
|
159
|
+
'f238': 'f238',
|
|
160
|
+
'f239': 'f239',
|
|
159
161
|
'fair_share': 'fairShare',
|
|
160
162
|
'featured_studios_admin': 'featuredStudiosAdmin',
|
|
161
163
|
'gcp_overprovisioning': 'gcpOverprovisioning',
|
|
@@ -214,7 +216,7 @@ class V1UserFeatures(object):
|
|
|
214
216
|
'writable_s3_connections': 'writableS3Connections'
|
|
215
217
|
}
|
|
216
218
|
|
|
217
|
-
def __init__(self, academic_tier: 'bool' =None, add_data_v2: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, byo_machine_type: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, chat_models: 'bool' =None, cloudspace_schedules: 'bool' =None,
|
|
219
|
+
def __init__(self, academic_tier: 'bool' =None, add_data_v2: 'bool' =None, affiliate_links: 'bool' =None, agents_v2: 'bool' =None, ai_hub_monetization: 'bool' =None, auto_fast_load: 'bool' =None, auto_join_orgs: 'bool' =None, b2c_experience: 'bool' =None, byo_machine_type: 'bool' =None, cap_add: 'list[str]' =None, cap_drop: 'list[str]' =None, capacity_reservation_byoc: 'bool' =None, capacity_reservation_dry_run: 'bool' =None, chat_models: 'bool' =None, cloudspace_schedules: 'bool' =None, code_tab: 'bool' =None, collab_screen_sharing: 'bool' =None, control_center_monitoring: 'bool' =None, cost_attribution_settings: 'bool' =None, custom_app_domain: 'bool' =None, datasets: 'bool' =None, default_one_cluster: 'bool' =None, deployment_persistent_disk: 'bool' =None, drive_v2: 'bool' =None, enterprise_compute_admin: 'bool' =None, f236: 'bool' =None, f237: 'bool' =None, f238: 'bool' =None, f239: 'bool' =None, fair_share: 'bool' =None, featured_studios_admin: 'bool' =None, gcp_overprovisioning: 'bool' =None, gcs_connections_optimized: 'bool' =None, gcs_folders: 'bool' =None, gcs_fuse: 'bool' =None, instant_capacity_reservation: 'bool' =None, job_artifacts_v2: 'bool' =None, kubernetes_cluster_ui: 'bool' =None, kubernetes_clusters: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, marketplace: 'bool' =None, mmt_fault_tolerance: 'bool' =None, mmt_strategy_selector: 'bool' =None, model_api_dashboard: 'bool' =None, model_api_dashboard_clickhouse: 'bool' =None, multicloud_folders: 'bool' =None, multiple_studio_versions: 'bool' =None, nerf_fs_nonpaying: 'bool' =None, onboarding_v2: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, persistent_disk: 'bool' =None, plugin_distributed: 'bool' =None, plugin_inference: 'bool' =None, plugin_label_studio: 'bool' =None, plugin_langflow: 'bool' =None, plugin_python_profiler: 'bool' =None, plugin_service: 'bool' =None, plugin_sweeps: 'bool' =None, pricing_updates: 'bool' =None, product_generator: 'bool' =None, product_license: 'bool' =None, project_selector: 'bool' =None, publish_pipelines: 'bool' =None, r2_data_connections: 'bool' =None, r2_uploads: 'bool' =None, reserved_machines_tab: 'bool' =None, restartable_jobs: 'bool' =None, runnable_public_studio_page: 'bool' =None, security_docs: 'bool' =None, show_dev_admin: 'bool' =None, single_wallet: 'bool' =None, slurm: 'bool' =None, specialised_studios: 'bool' =None, storage_overuse_deletion: 'bool' =None, studio_config: 'bool' =None, studio_sharing_v2: 'bool' =None, studio_version_visibility: 'bool' =None, trainium2: 'bool' =None, use_internal_data_connection_mounts: 'bool' =None, use_rclone_mounts_only: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None, writable_s3_connections: 'bool' =None): # noqa: E501
|
|
218
220
|
"""V1UserFeatures - a model defined in Swagger""" # noqa: E501
|
|
219
221
|
self._academic_tier = None
|
|
220
222
|
self._add_data_v2 = None
|
|
@@ -231,19 +233,20 @@ class V1UserFeatures(object):
|
|
|
231
233
|
self._capacity_reservation_dry_run = None
|
|
232
234
|
self._chat_models = None
|
|
233
235
|
self._cloudspace_schedules = None
|
|
234
|
-
self._cloudy_vibe_code = None
|
|
235
236
|
self._code_tab = None
|
|
236
237
|
self._collab_screen_sharing = None
|
|
237
238
|
self._control_center_monitoring = None
|
|
238
239
|
self._cost_attribution_settings = None
|
|
239
240
|
self._custom_app_domain = None
|
|
240
|
-
self._data_connection_flushing_v2 = None
|
|
241
241
|
self._datasets = None
|
|
242
242
|
self._default_one_cluster = None
|
|
243
243
|
self._deployment_persistent_disk = None
|
|
244
244
|
self._drive_v2 = None
|
|
245
245
|
self._enterprise_compute_admin = None
|
|
246
246
|
self._f236 = None
|
|
247
|
+
self._f237 = None
|
|
248
|
+
self._f238 = None
|
|
249
|
+
self._f239 = None
|
|
247
250
|
self._fair_share = None
|
|
248
251
|
self._featured_studios_admin = None
|
|
249
252
|
self._gcp_overprovisioning = None
|
|
@@ -331,8 +334,6 @@ class V1UserFeatures(object):
|
|
|
331
334
|
self.chat_models = chat_models
|
|
332
335
|
if cloudspace_schedules is not None:
|
|
333
336
|
self.cloudspace_schedules = cloudspace_schedules
|
|
334
|
-
if cloudy_vibe_code is not None:
|
|
335
|
-
self.cloudy_vibe_code = cloudy_vibe_code
|
|
336
337
|
if code_tab is not None:
|
|
337
338
|
self.code_tab = code_tab
|
|
338
339
|
if collab_screen_sharing is not None:
|
|
@@ -343,8 +344,6 @@ class V1UserFeatures(object):
|
|
|
343
344
|
self.cost_attribution_settings = cost_attribution_settings
|
|
344
345
|
if custom_app_domain is not None:
|
|
345
346
|
self.custom_app_domain = custom_app_domain
|
|
346
|
-
if data_connection_flushing_v2 is not None:
|
|
347
|
-
self.data_connection_flushing_v2 = data_connection_flushing_v2
|
|
348
347
|
if datasets is not None:
|
|
349
348
|
self.datasets = datasets
|
|
350
349
|
if default_one_cluster is not None:
|
|
@@ -357,6 +356,12 @@ class V1UserFeatures(object):
|
|
|
357
356
|
self.enterprise_compute_admin = enterprise_compute_admin
|
|
358
357
|
if f236 is not None:
|
|
359
358
|
self.f236 = f236
|
|
359
|
+
if f237 is not None:
|
|
360
|
+
self.f237 = f237
|
|
361
|
+
if f238 is not None:
|
|
362
|
+
self.f238 = f238
|
|
363
|
+
if f239 is not None:
|
|
364
|
+
self.f239 = f239
|
|
360
365
|
if fair_share is not None:
|
|
361
366
|
self.fair_share = fair_share
|
|
362
367
|
if featured_studios_admin is not None:
|
|
@@ -785,27 +790,6 @@ class V1UserFeatures(object):
|
|
|
785
790
|
|
|
786
791
|
self._cloudspace_schedules = cloudspace_schedules
|
|
787
792
|
|
|
788
|
-
@property
|
|
789
|
-
def cloudy_vibe_code(self) -> 'bool':
|
|
790
|
-
"""Gets the cloudy_vibe_code of this V1UserFeatures. # noqa: E501
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
:return: The cloudy_vibe_code of this V1UserFeatures. # noqa: E501
|
|
794
|
-
:rtype: bool
|
|
795
|
-
"""
|
|
796
|
-
return self._cloudy_vibe_code
|
|
797
|
-
|
|
798
|
-
@cloudy_vibe_code.setter
|
|
799
|
-
def cloudy_vibe_code(self, cloudy_vibe_code: 'bool'):
|
|
800
|
-
"""Sets the cloudy_vibe_code of this V1UserFeatures.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
:param cloudy_vibe_code: The cloudy_vibe_code of this V1UserFeatures. # noqa: E501
|
|
804
|
-
:type: bool
|
|
805
|
-
"""
|
|
806
|
-
|
|
807
|
-
self._cloudy_vibe_code = cloudy_vibe_code
|
|
808
|
-
|
|
809
793
|
@property
|
|
810
794
|
def code_tab(self) -> 'bool':
|
|
811
795
|
"""Gets the code_tab of this V1UserFeatures. # noqa: E501
|
|
@@ -911,27 +895,6 @@ class V1UserFeatures(object):
|
|
|
911
895
|
|
|
912
896
|
self._custom_app_domain = custom_app_domain
|
|
913
897
|
|
|
914
|
-
@property
|
|
915
|
-
def data_connection_flushing_v2(self) -> 'bool':
|
|
916
|
-
"""Gets the data_connection_flushing_v2 of this V1UserFeatures. # noqa: E501
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
:return: The data_connection_flushing_v2 of this V1UserFeatures. # noqa: E501
|
|
920
|
-
:rtype: bool
|
|
921
|
-
"""
|
|
922
|
-
return self._data_connection_flushing_v2
|
|
923
|
-
|
|
924
|
-
@data_connection_flushing_v2.setter
|
|
925
|
-
def data_connection_flushing_v2(self, data_connection_flushing_v2: 'bool'):
|
|
926
|
-
"""Sets the data_connection_flushing_v2 of this V1UserFeatures.
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
:param data_connection_flushing_v2: The data_connection_flushing_v2 of this V1UserFeatures. # noqa: E501
|
|
930
|
-
:type: bool
|
|
931
|
-
"""
|
|
932
|
-
|
|
933
|
-
self._data_connection_flushing_v2 = data_connection_flushing_v2
|
|
934
|
-
|
|
935
898
|
@property
|
|
936
899
|
def datasets(self) -> 'bool':
|
|
937
900
|
"""Gets the datasets of this V1UserFeatures. # noqa: E501
|
|
@@ -1058,6 +1021,69 @@ class V1UserFeatures(object):
|
|
|
1058
1021
|
|
|
1059
1022
|
self._f236 = f236
|
|
1060
1023
|
|
|
1024
|
+
@property
|
|
1025
|
+
def f237(self) -> 'bool':
|
|
1026
|
+
"""Gets the f237 of this V1UserFeatures. # noqa: E501
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
:return: The f237 of this V1UserFeatures. # noqa: E501
|
|
1030
|
+
:rtype: bool
|
|
1031
|
+
"""
|
|
1032
|
+
return self._f237
|
|
1033
|
+
|
|
1034
|
+
@f237.setter
|
|
1035
|
+
def f237(self, f237: 'bool'):
|
|
1036
|
+
"""Sets the f237 of this V1UserFeatures.
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
:param f237: The f237 of this V1UserFeatures. # noqa: E501
|
|
1040
|
+
:type: bool
|
|
1041
|
+
"""
|
|
1042
|
+
|
|
1043
|
+
self._f237 = f237
|
|
1044
|
+
|
|
1045
|
+
@property
|
|
1046
|
+
def f238(self) -> 'bool':
|
|
1047
|
+
"""Gets the f238 of this V1UserFeatures. # noqa: E501
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
:return: The f238 of this V1UserFeatures. # noqa: E501
|
|
1051
|
+
:rtype: bool
|
|
1052
|
+
"""
|
|
1053
|
+
return self._f238
|
|
1054
|
+
|
|
1055
|
+
@f238.setter
|
|
1056
|
+
def f238(self, f238: 'bool'):
|
|
1057
|
+
"""Sets the f238 of this V1UserFeatures.
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
:param f238: The f238 of this V1UserFeatures. # noqa: E501
|
|
1061
|
+
:type: bool
|
|
1062
|
+
"""
|
|
1063
|
+
|
|
1064
|
+
self._f238 = f238
|
|
1065
|
+
|
|
1066
|
+
@property
|
|
1067
|
+
def f239(self) -> 'bool':
|
|
1068
|
+
"""Gets the f239 of this V1UserFeatures. # noqa: E501
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
:return: The f239 of this V1UserFeatures. # noqa: E501
|
|
1072
|
+
:rtype: bool
|
|
1073
|
+
"""
|
|
1074
|
+
return self._f239
|
|
1075
|
+
|
|
1076
|
+
@f239.setter
|
|
1077
|
+
def f239(self, f239: 'bool'):
|
|
1078
|
+
"""Sets the f239 of this V1UserFeatures.
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
:param f239: The f239 of this V1UserFeatures. # noqa: E501
|
|
1082
|
+
:type: bool
|
|
1083
|
+
"""
|
|
1084
|
+
|
|
1085
|
+
self._f239 = f239
|
|
1086
|
+
|
|
1061
1087
|
@property
|
|
1062
1088
|
def fair_share(self) -> 'bool':
|
|
1063
1089
|
"""Gets the fair_share of this V1UserFeatures. # noqa: E501
|
|
@@ -40,6 +40,7 @@ class V1VolumeState(object):
|
|
|
40
40
|
UNSPECIFIED = "VOLUME_STATE_UNSPECIFIED"
|
|
41
41
|
ATTACHED = "VOLUME_STATE_ATTACHED"
|
|
42
42
|
DETACHED = "VOLUME_STATE_DETACHED"
|
|
43
|
+
OVERPROVISIONED = "VOLUME_STATE_OVERPROVISIONED"
|
|
43
44
|
"""
|
|
44
45
|
Attributes:
|
|
45
46
|
swagger_types (dict): The key is attribute name
|
lightning_sdk/llm/llm.py
CHANGED
|
@@ -2,6 +2,7 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
from typing import Any, AsyncGenerator, ClassVar, Dict, Generator, List, Optional, Tuple, Union
|
|
4
4
|
|
|
5
|
+
from lightning_sdk.api import TeamspaceApi, UserApi
|
|
5
6
|
from lightning_sdk.api.llm_api import LLMApi
|
|
6
7
|
from lightning_sdk.lightning_cloud.openapi.models.v1_conversation_response_chunk import V1ConversationResponseChunk
|
|
7
8
|
|
|
@@ -13,7 +14,7 @@ PUBLIC_MODEL_PROVIDERS: Dict[str, str] = {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
def _load_public_assistants() -> Dict[str, str]:
|
|
17
|
+
def _load_public_assistants() -> Dict[str, Dict[str, Any]]:
|
|
17
18
|
"""Load public assistants from a JSON file."""
|
|
18
19
|
try:
|
|
19
20
|
json_path = os.path.join(os.path.dirname(__file__), "public_assistants.json")
|
|
@@ -28,7 +29,7 @@ class LLM:
|
|
|
28
29
|
_auth_info_cached: ClassVar[bool] = False
|
|
29
30
|
_cached_auth_info: ClassVar[Dict[str, Optional[str]]] = {}
|
|
30
31
|
_llm_api_cache: ClassVar[Dict[Optional[str], LLMApi]] = {}
|
|
31
|
-
_public_assistants: ClassVar[Optional[Dict[str, str]]] = None
|
|
32
|
+
_public_assistants: ClassVar[Optional[Dict[str, Dict[str, Any]]]] = None
|
|
32
33
|
|
|
33
34
|
def __new__(cls, name: str, teamspace: Optional[str] = None, enable_async: Optional[bool] = False) -> "LLM":
|
|
34
35
|
return super().__new__(cls)
|
|
@@ -76,6 +77,7 @@ class LLM:
|
|
|
76
77
|
LLM._llm_api_cache[teamspace] = LLMApi()
|
|
77
78
|
self._llm_api = LLM._llm_api_cache[teamspace]
|
|
78
79
|
|
|
80
|
+
self._context_length = None
|
|
79
81
|
self._model_id = self._get_model_id()
|
|
80
82
|
self._conversations = {}
|
|
81
83
|
|
|
@@ -87,16 +89,45 @@ class LLM:
|
|
|
87
89
|
def provider(self) -> str:
|
|
88
90
|
return self._model_provider
|
|
89
91
|
|
|
92
|
+
def context_length(self, model: Optional[str] = None) -> Optional[int]:
|
|
93
|
+
if model is None:
|
|
94
|
+
return self._context_length
|
|
95
|
+
|
|
96
|
+
context_info = self._public_assistants.get(model)
|
|
97
|
+
if context_info is None or "context_length" not in context_info:
|
|
98
|
+
raise ValueError(f"Cannot access context length of model '{model}'.")
|
|
99
|
+
|
|
100
|
+
return int(context_info["context_length"])
|
|
101
|
+
|
|
90
102
|
def _get_auth_info(self, teamspace_name: Optional[str] = None) -> None:
|
|
91
103
|
# TODO: Validate user input teamspace name
|
|
92
104
|
if not LLM._auth_info_cached:
|
|
93
105
|
if teamspace_name is None:
|
|
106
|
+
# studio users
|
|
94
107
|
teamspace_name = os.environ.get("LIGHTNING_TEAMSPACE", None)
|
|
108
|
+
|
|
95
109
|
if teamspace_name is None:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
# local users with no given teamspace
|
|
111
|
+
try:
|
|
112
|
+
teamspace_api = TeamspaceApi()
|
|
113
|
+
user_api = UserApi()
|
|
114
|
+
authed_user = user_api._client.auth_service_get_user()
|
|
115
|
+
default_teamspace = teamspace_api.list_teamspaces(owner_id=authed_user.id)[0]
|
|
116
|
+
teamspace_name = default_teamspace.name
|
|
117
|
+
teamspace_id = default_teamspace.id
|
|
118
|
+
os.environ["LIGHTNING_CLOUD_PROJECT_ID"] = teamspace_id
|
|
119
|
+
os.environ["LIGHTNING_TEAMSPACE"] = teamspace_name
|
|
120
|
+
except Exception as err:
|
|
121
|
+
# throw an appropriate error that guides users to login through the platform
|
|
122
|
+
raise ValueError(
|
|
123
|
+
"Teamspace information is missing. "
|
|
124
|
+
"If this is your first time using LitAI, please log in at https://lightning.ai/sign-up "
|
|
125
|
+
"and re-run your script, or set the environment variable LIGHTNING_TEAMSPACE=<your-teamspace>."
|
|
126
|
+
) from err
|
|
127
|
+
|
|
128
|
+
# TODO: when teamspace_name is given, we don't know the teamspace_id yet
|
|
129
|
+
# TODO: if LIGHTNING_CLOUD_PROJECT_ID does not exist, we have to get the id from the teamspace name
|
|
130
|
+
|
|
100
131
|
LLM._cached_auth_info = {
|
|
101
132
|
"teamspace_name": teamspace_name,
|
|
102
133
|
"teamspace_id": os.environ.get("LIGHTNING_CLOUD_PROJECT_ID", None),
|
|
@@ -137,7 +168,10 @@ class LLM:
|
|
|
137
168
|
and LLM._public_assistants
|
|
138
169
|
and f"{self._model_provider}/{self._model_name}" in LLM._public_assistants
|
|
139
170
|
):
|
|
140
|
-
|
|
171
|
+
self._context_length = int(
|
|
172
|
+
LLM._public_assistants[f"{self._model_provider}/{self._model_name}"]["context_length"]
|
|
173
|
+
)
|
|
174
|
+
return LLM._public_assistants[f"{self._model_provider}/{self._model_name}"]["id"]
|
|
141
175
|
try:
|
|
142
176
|
return self._llm_api.get_assistant(
|
|
143
177
|
model_provider=PUBLIC_MODEL_PROVIDERS[self._model_provider],
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
"openai/gpt-4o":
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
"openai/gpt-4o": {
|
|
3
|
+
"id": "ast_01jdjds71fs8gt47jexzed4czs",
|
|
4
|
+
"context_length": 128000
|
|
5
|
+
},
|
|
6
|
+
"openai/gpt-4": {
|
|
7
|
+
"id": "ast_01jd38ze6tjbrcd4942nhz41zn",
|
|
8
|
+
"context_length": 8192
|
|
9
|
+
},
|
|
10
|
+
"openai/o3-mini": {
|
|
11
|
+
"id": "ast_01jz3t13fhnjhh11t1k8b5gyp1",
|
|
12
|
+
"context_length": 128000
|
|
13
|
+
},
|
|
14
|
+
"anthropic/claude-3-5-sonnet-20240620": {
|
|
15
|
+
"id": "ast_01jd3923a6p98rqwh3dpj686pq",
|
|
16
|
+
"context_length": 200000
|
|
17
|
+
},
|
|
18
|
+
"google/gemini-2.5-pro": {
|
|
19
|
+
"id": "ast_01jz3tdb1fhey798k95pv61v57",
|
|
20
|
+
"context_length": 1048576
|
|
21
|
+
},
|
|
22
|
+
"google/gemini-2.5-flash": {
|
|
23
|
+
"id": "ast_01jz3thxskg4fcdk4xhkjkym5a",
|
|
24
|
+
"context_length": 8000
|
|
25
|
+
},
|
|
26
|
+
"google/gemini-2.5-flash-lite-preview-06-17": {
|
|
27
|
+
"id": "ast_01jz3thxskg4fcdk4xhkjkym5b",
|
|
28
|
+
"context_length": 8000
|
|
29
|
+
},
|
|
30
|
+
"lightning-ai/llama4-maverick": {
|
|
31
|
+
"id": "ast_01k0wgg56tm8mv9n12aq2mnxas",
|
|
32
|
+
"context_length": 100000
|
|
33
|
+
}
|
|
10
34
|
}
|