lightning-sdk 2025.7.9__py3-none-any.whl → 2025.7.17__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/llm_api.py +15 -6
- lightning_sdk/job/base.py +30 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +7 -1
- lightning_sdk/lightning_cloud/openapi/api/billing_service_api.py +109 -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 +7 -1
- lightning_sdk/lightning_cloud/openapi/models/assistant_id_conversations_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/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/{v1_list_new_features_for_user_response.py → v1_ai_pod_v1.py} +23 -23
- 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_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_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_clickhouse_assistant_session_daily_aggregated_response.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_lightningapp_instance_artifact.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_list_notification_dialogs_response.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_message.py +27 -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_tool.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +131 -53
- lightning_sdk/lightning_cloud/openapi/models/v1_volume.py +27 -1
- lightning_sdk/lightning_cloud/utils/data_connection.py +57 -3
- lightning_sdk/llm/llm.py +32 -8
- lightning_sdk/llm/public_assistants.json +3 -1
- lightning_sdk/machine.py +12 -1
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/RECORD +42 -36
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.7.9.dist-info → lightning_sdk-2025.7.17.dist-info}/top_level.txt +0 -0
|
@@ -42,7 +42,6 @@ class V1UserFeatures(object):
|
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
44
|
'academic_tier': 'bool',
|
|
45
|
-
'accurate_billing': 'bool',
|
|
46
45
|
'add_data_v2': 'bool',
|
|
47
46
|
'affiliate_links': 'bool',
|
|
48
47
|
'agents_v2': 'bool',
|
|
@@ -50,6 +49,7 @@ class V1UserFeatures(object):
|
|
|
50
49
|
'auto_fast_load': 'bool',
|
|
51
50
|
'auto_join_orgs': 'bool',
|
|
52
51
|
'b2c_experience': 'bool',
|
|
52
|
+
'byo_machine_type': 'bool',
|
|
53
53
|
'cap_add': 'list[str]',
|
|
54
54
|
'cap_drop': 'list[str]',
|
|
55
55
|
'capacity_reservation_byoc': 'bool',
|
|
@@ -59,7 +59,6 @@ class V1UserFeatures(object):
|
|
|
59
59
|
'cloudy_vibe_code': 'bool',
|
|
60
60
|
'code_tab': 'bool',
|
|
61
61
|
'collab_screen_sharing': 'bool',
|
|
62
|
-
'concurrent_gpu_limit': 'bool',
|
|
63
62
|
'control_center_monitoring': 'bool',
|
|
64
63
|
'cost_attribution_settings': 'bool',
|
|
65
64
|
'custom_app_domain': 'bool',
|
|
@@ -69,13 +68,16 @@ class V1UserFeatures(object):
|
|
|
69
68
|
'deployment_persistent_disk': 'bool',
|
|
70
69
|
'drive_v2': 'bool',
|
|
71
70
|
'enterprise_compute_admin': 'bool',
|
|
71
|
+
'f236': 'bool',
|
|
72
72
|
'fair_share': 'bool',
|
|
73
73
|
'featured_studios_admin': 'bool',
|
|
74
|
+
'gcp_overprovisioning': 'bool',
|
|
74
75
|
'gcs_connections_optimized': 'bool',
|
|
75
76
|
'gcs_folders': 'bool',
|
|
76
77
|
'gcs_fuse': 'bool',
|
|
77
78
|
'instant_capacity_reservation': 'bool',
|
|
78
79
|
'job_artifacts_v2': 'bool',
|
|
80
|
+
'kubernetes_cluster_ui': 'bool',
|
|
79
81
|
'kubernetes_clusters': 'bool',
|
|
80
82
|
'lambda_labs': 'bool',
|
|
81
83
|
'lambda_labs_studios': 'bool',
|
|
@@ -112,6 +114,7 @@ class V1UserFeatures(object):
|
|
|
112
114
|
'project_selector': 'bool',
|
|
113
115
|
'publish_pipelines': 'bool',
|
|
114
116
|
'r2_data_connections': 'bool',
|
|
117
|
+
'r2_uploads': 'bool',
|
|
115
118
|
'reserved_machines_tab': 'bool',
|
|
116
119
|
'restartable_jobs': 'bool',
|
|
117
120
|
'runnable_public_studio_page': 'bool',
|
|
@@ -136,7 +139,6 @@ class V1UserFeatures(object):
|
|
|
136
139
|
|
|
137
140
|
attribute_map = {
|
|
138
141
|
'academic_tier': 'academicTier',
|
|
139
|
-
'accurate_billing': 'accurateBilling',
|
|
140
142
|
'add_data_v2': 'addDataV2',
|
|
141
143
|
'affiliate_links': 'affiliateLinks',
|
|
142
144
|
'agents_v2': 'agentsV2',
|
|
@@ -144,6 +146,7 @@ class V1UserFeatures(object):
|
|
|
144
146
|
'auto_fast_load': 'autoFastLoad',
|
|
145
147
|
'auto_join_orgs': 'autoJoinOrgs',
|
|
146
148
|
'b2c_experience': 'b2cExperience',
|
|
149
|
+
'byo_machine_type': 'byoMachineType',
|
|
147
150
|
'cap_add': 'capAdd',
|
|
148
151
|
'cap_drop': 'capDrop',
|
|
149
152
|
'capacity_reservation_byoc': 'capacityReservationByoc',
|
|
@@ -153,7 +156,6 @@ class V1UserFeatures(object):
|
|
|
153
156
|
'cloudy_vibe_code': 'cloudyVibeCode',
|
|
154
157
|
'code_tab': 'codeTab',
|
|
155
158
|
'collab_screen_sharing': 'collabScreenSharing',
|
|
156
|
-
'concurrent_gpu_limit': 'concurrentGpuLimit',
|
|
157
159
|
'control_center_monitoring': 'controlCenterMonitoring',
|
|
158
160
|
'cost_attribution_settings': 'costAttributionSettings',
|
|
159
161
|
'custom_app_domain': 'customAppDomain',
|
|
@@ -163,13 +165,16 @@ class V1UserFeatures(object):
|
|
|
163
165
|
'deployment_persistent_disk': 'deploymentPersistentDisk',
|
|
164
166
|
'drive_v2': 'driveV2',
|
|
165
167
|
'enterprise_compute_admin': 'enterpriseComputeAdmin',
|
|
168
|
+
'f236': 'f236',
|
|
166
169
|
'fair_share': 'fairShare',
|
|
167
170
|
'featured_studios_admin': 'featuredStudiosAdmin',
|
|
171
|
+
'gcp_overprovisioning': 'gcpOverprovisioning',
|
|
168
172
|
'gcs_connections_optimized': 'gcsConnectionsOptimized',
|
|
169
173
|
'gcs_folders': 'gcsFolders',
|
|
170
174
|
'gcs_fuse': 'gcsFuse',
|
|
171
175
|
'instant_capacity_reservation': 'instantCapacityReservation',
|
|
172
176
|
'job_artifacts_v2': 'jobArtifactsV2',
|
|
177
|
+
'kubernetes_cluster_ui': 'kubernetesClusterUi',
|
|
173
178
|
'kubernetes_clusters': 'kubernetesClusters',
|
|
174
179
|
'lambda_labs': 'lambdaLabs',
|
|
175
180
|
'lambda_labs_studios': 'lambdaLabsStudios',
|
|
@@ -206,6 +211,7 @@ class V1UserFeatures(object):
|
|
|
206
211
|
'project_selector': 'projectSelector',
|
|
207
212
|
'publish_pipelines': 'publishPipelines',
|
|
208
213
|
'r2_data_connections': 'r2DataConnections',
|
|
214
|
+
'r2_uploads': 'r2Uploads',
|
|
209
215
|
'reserved_machines_tab': 'reservedMachinesTab',
|
|
210
216
|
'restartable_jobs': 'restartableJobs',
|
|
211
217
|
'runnable_public_studio_page': 'runnablePublicStudioPage',
|
|
@@ -228,10 +234,9 @@ class V1UserFeatures(object):
|
|
|
228
234
|
'writable_s3_connections': 'writableS3Connections'
|
|
229
235
|
}
|
|
230
236
|
|
|
231
|
-
def __init__(self, academic_tier: 'bool' =None,
|
|
237
|
+
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, cloudy_vibe_code: '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, data_connection_flushing_v2: '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, 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, lambda_labs: 'bool' =None, lambda_labs_studios: 'bool' =None, landing_studios: 'bool' =None, lit_logger: 'bool' =None, machine_selector_v2: '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, multicloud_saas: 'bool' =None, multiple_studio_versions: 'bool' =None, nebius: 'bool' =None, nebius_cpu_studios: 'bool' =None, nebius_gpu_studios: 'bool' =None, nerf_fs_nonpaying: 'bool' =None, onboarding_v2: 'bool' =None, org_level_member_permissions: 'bool' =None, org_usage_limits: 'bool' =None, paygo_free_storage_limit_check: '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, voltage_park: 'bool' =None, voltage_park_studios: 'bool' =None, vultr: 'bool' =None, weka: 'bool' =None, writable_s3_connections: 'bool' =None): # noqa: E501
|
|
232
238
|
"""V1UserFeatures - a model defined in Swagger""" # noqa: E501
|
|
233
239
|
self._academic_tier = None
|
|
234
|
-
self._accurate_billing = None
|
|
235
240
|
self._add_data_v2 = None
|
|
236
241
|
self._affiliate_links = None
|
|
237
242
|
self._agents_v2 = None
|
|
@@ -239,6 +244,7 @@ class V1UserFeatures(object):
|
|
|
239
244
|
self._auto_fast_load = None
|
|
240
245
|
self._auto_join_orgs = None
|
|
241
246
|
self._b2c_experience = None
|
|
247
|
+
self._byo_machine_type = None
|
|
242
248
|
self._cap_add = None
|
|
243
249
|
self._cap_drop = None
|
|
244
250
|
self._capacity_reservation_byoc = None
|
|
@@ -248,7 +254,6 @@ class V1UserFeatures(object):
|
|
|
248
254
|
self._cloudy_vibe_code = None
|
|
249
255
|
self._code_tab = None
|
|
250
256
|
self._collab_screen_sharing = None
|
|
251
|
-
self._concurrent_gpu_limit = None
|
|
252
257
|
self._control_center_monitoring = None
|
|
253
258
|
self._cost_attribution_settings = None
|
|
254
259
|
self._custom_app_domain = None
|
|
@@ -258,13 +263,16 @@ class V1UserFeatures(object):
|
|
|
258
263
|
self._deployment_persistent_disk = None
|
|
259
264
|
self._drive_v2 = None
|
|
260
265
|
self._enterprise_compute_admin = None
|
|
266
|
+
self._f236 = None
|
|
261
267
|
self._fair_share = None
|
|
262
268
|
self._featured_studios_admin = None
|
|
269
|
+
self._gcp_overprovisioning = None
|
|
263
270
|
self._gcs_connections_optimized = None
|
|
264
271
|
self._gcs_folders = None
|
|
265
272
|
self._gcs_fuse = None
|
|
266
273
|
self._instant_capacity_reservation = None
|
|
267
274
|
self._job_artifacts_v2 = None
|
|
275
|
+
self._kubernetes_cluster_ui = None
|
|
268
276
|
self._kubernetes_clusters = None
|
|
269
277
|
self._lambda_labs = None
|
|
270
278
|
self._lambda_labs_studios = None
|
|
@@ -301,6 +309,7 @@ class V1UserFeatures(object):
|
|
|
301
309
|
self._project_selector = None
|
|
302
310
|
self._publish_pipelines = None
|
|
303
311
|
self._r2_data_connections = None
|
|
312
|
+
self._r2_uploads = None
|
|
304
313
|
self._reserved_machines_tab = None
|
|
305
314
|
self._restartable_jobs = None
|
|
306
315
|
self._runnable_public_studio_page = None
|
|
@@ -324,8 +333,6 @@ class V1UserFeatures(object):
|
|
|
324
333
|
self.discriminator = None
|
|
325
334
|
if academic_tier is not None:
|
|
326
335
|
self.academic_tier = academic_tier
|
|
327
|
-
if accurate_billing is not None:
|
|
328
|
-
self.accurate_billing = accurate_billing
|
|
329
336
|
if add_data_v2 is not None:
|
|
330
337
|
self.add_data_v2 = add_data_v2
|
|
331
338
|
if affiliate_links is not None:
|
|
@@ -340,6 +347,8 @@ class V1UserFeatures(object):
|
|
|
340
347
|
self.auto_join_orgs = auto_join_orgs
|
|
341
348
|
if b2c_experience is not None:
|
|
342
349
|
self.b2c_experience = b2c_experience
|
|
350
|
+
if byo_machine_type is not None:
|
|
351
|
+
self.byo_machine_type = byo_machine_type
|
|
343
352
|
if cap_add is not None:
|
|
344
353
|
self.cap_add = cap_add
|
|
345
354
|
if cap_drop is not None:
|
|
@@ -358,8 +367,6 @@ class V1UserFeatures(object):
|
|
|
358
367
|
self.code_tab = code_tab
|
|
359
368
|
if collab_screen_sharing is not None:
|
|
360
369
|
self.collab_screen_sharing = collab_screen_sharing
|
|
361
|
-
if concurrent_gpu_limit is not None:
|
|
362
|
-
self.concurrent_gpu_limit = concurrent_gpu_limit
|
|
363
370
|
if control_center_monitoring is not None:
|
|
364
371
|
self.control_center_monitoring = control_center_monitoring
|
|
365
372
|
if cost_attribution_settings is not None:
|
|
@@ -378,10 +385,14 @@ class V1UserFeatures(object):
|
|
|
378
385
|
self.drive_v2 = drive_v2
|
|
379
386
|
if enterprise_compute_admin is not None:
|
|
380
387
|
self.enterprise_compute_admin = enterprise_compute_admin
|
|
388
|
+
if f236 is not None:
|
|
389
|
+
self.f236 = f236
|
|
381
390
|
if fair_share is not None:
|
|
382
391
|
self.fair_share = fair_share
|
|
383
392
|
if featured_studios_admin is not None:
|
|
384
393
|
self.featured_studios_admin = featured_studios_admin
|
|
394
|
+
if gcp_overprovisioning is not None:
|
|
395
|
+
self.gcp_overprovisioning = gcp_overprovisioning
|
|
385
396
|
if gcs_connections_optimized is not None:
|
|
386
397
|
self.gcs_connections_optimized = gcs_connections_optimized
|
|
387
398
|
if gcs_folders is not None:
|
|
@@ -392,6 +403,8 @@ class V1UserFeatures(object):
|
|
|
392
403
|
self.instant_capacity_reservation = instant_capacity_reservation
|
|
393
404
|
if job_artifacts_v2 is not None:
|
|
394
405
|
self.job_artifacts_v2 = job_artifacts_v2
|
|
406
|
+
if kubernetes_cluster_ui is not None:
|
|
407
|
+
self.kubernetes_cluster_ui = kubernetes_cluster_ui
|
|
395
408
|
if kubernetes_clusters is not None:
|
|
396
409
|
self.kubernetes_clusters = kubernetes_clusters
|
|
397
410
|
if lambda_labs is not None:
|
|
@@ -464,6 +477,8 @@ class V1UserFeatures(object):
|
|
|
464
477
|
self.publish_pipelines = publish_pipelines
|
|
465
478
|
if r2_data_connections is not None:
|
|
466
479
|
self.r2_data_connections = r2_data_connections
|
|
480
|
+
if r2_uploads is not None:
|
|
481
|
+
self.r2_uploads = r2_uploads
|
|
467
482
|
if reserved_machines_tab is not None:
|
|
468
483
|
self.reserved_machines_tab = reserved_machines_tab
|
|
469
484
|
if restartable_jobs is not None:
|
|
@@ -526,27 +541,6 @@ class V1UserFeatures(object):
|
|
|
526
541
|
|
|
527
542
|
self._academic_tier = academic_tier
|
|
528
543
|
|
|
529
|
-
@property
|
|
530
|
-
def accurate_billing(self) -> 'bool':
|
|
531
|
-
"""Gets the accurate_billing of this V1UserFeatures. # noqa: E501
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
:return: The accurate_billing of this V1UserFeatures. # noqa: E501
|
|
535
|
-
:rtype: bool
|
|
536
|
-
"""
|
|
537
|
-
return self._accurate_billing
|
|
538
|
-
|
|
539
|
-
@accurate_billing.setter
|
|
540
|
-
def accurate_billing(self, accurate_billing: 'bool'):
|
|
541
|
-
"""Sets the accurate_billing of this V1UserFeatures.
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
:param accurate_billing: The accurate_billing of this V1UserFeatures. # noqa: E501
|
|
545
|
-
:type: bool
|
|
546
|
-
"""
|
|
547
|
-
|
|
548
|
-
self._accurate_billing = accurate_billing
|
|
549
|
-
|
|
550
544
|
@property
|
|
551
545
|
def add_data_v2(self) -> 'bool':
|
|
552
546
|
"""Gets the add_data_v2 of this V1UserFeatures. # noqa: E501
|
|
@@ -694,6 +688,27 @@ class V1UserFeatures(object):
|
|
|
694
688
|
|
|
695
689
|
self._b2c_experience = b2c_experience
|
|
696
690
|
|
|
691
|
+
@property
|
|
692
|
+
def byo_machine_type(self) -> 'bool':
|
|
693
|
+
"""Gets the byo_machine_type of this V1UserFeatures. # noqa: E501
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
:return: The byo_machine_type of this V1UserFeatures. # noqa: E501
|
|
697
|
+
:rtype: bool
|
|
698
|
+
"""
|
|
699
|
+
return self._byo_machine_type
|
|
700
|
+
|
|
701
|
+
@byo_machine_type.setter
|
|
702
|
+
def byo_machine_type(self, byo_machine_type: 'bool'):
|
|
703
|
+
"""Sets the byo_machine_type of this V1UserFeatures.
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
:param byo_machine_type: The byo_machine_type of this V1UserFeatures. # noqa: E501
|
|
707
|
+
:type: bool
|
|
708
|
+
"""
|
|
709
|
+
|
|
710
|
+
self._byo_machine_type = byo_machine_type
|
|
711
|
+
|
|
697
712
|
@property
|
|
698
713
|
def cap_add(self) -> 'list[str]':
|
|
699
714
|
"""Gets the cap_add of this V1UserFeatures. # noqa: E501
|
|
@@ -883,27 +898,6 @@ class V1UserFeatures(object):
|
|
|
883
898
|
|
|
884
899
|
self._collab_screen_sharing = collab_screen_sharing
|
|
885
900
|
|
|
886
|
-
@property
|
|
887
|
-
def concurrent_gpu_limit(self) -> 'bool':
|
|
888
|
-
"""Gets the concurrent_gpu_limit of this V1UserFeatures. # noqa: E501
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
:return: The concurrent_gpu_limit of this V1UserFeatures. # noqa: E501
|
|
892
|
-
:rtype: bool
|
|
893
|
-
"""
|
|
894
|
-
return self._concurrent_gpu_limit
|
|
895
|
-
|
|
896
|
-
@concurrent_gpu_limit.setter
|
|
897
|
-
def concurrent_gpu_limit(self, concurrent_gpu_limit: 'bool'):
|
|
898
|
-
"""Sets the concurrent_gpu_limit of this V1UserFeatures.
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
:param concurrent_gpu_limit: The concurrent_gpu_limit of this V1UserFeatures. # noqa: E501
|
|
902
|
-
:type: bool
|
|
903
|
-
"""
|
|
904
|
-
|
|
905
|
-
self._concurrent_gpu_limit = concurrent_gpu_limit
|
|
906
|
-
|
|
907
901
|
@property
|
|
908
902
|
def control_center_monitoring(self) -> 'bool':
|
|
909
903
|
"""Gets the control_center_monitoring of this V1UserFeatures. # noqa: E501
|
|
@@ -1093,6 +1087,27 @@ class V1UserFeatures(object):
|
|
|
1093
1087
|
|
|
1094
1088
|
self._enterprise_compute_admin = enterprise_compute_admin
|
|
1095
1089
|
|
|
1090
|
+
@property
|
|
1091
|
+
def f236(self) -> 'bool':
|
|
1092
|
+
"""Gets the f236 of this V1UserFeatures. # noqa: E501
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
:return: The f236 of this V1UserFeatures. # noqa: E501
|
|
1096
|
+
:rtype: bool
|
|
1097
|
+
"""
|
|
1098
|
+
return self._f236
|
|
1099
|
+
|
|
1100
|
+
@f236.setter
|
|
1101
|
+
def f236(self, f236: 'bool'):
|
|
1102
|
+
"""Sets the f236 of this V1UserFeatures.
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
:param f236: The f236 of this V1UserFeatures. # noqa: E501
|
|
1106
|
+
:type: bool
|
|
1107
|
+
"""
|
|
1108
|
+
|
|
1109
|
+
self._f236 = f236
|
|
1110
|
+
|
|
1096
1111
|
@property
|
|
1097
1112
|
def fair_share(self) -> 'bool':
|
|
1098
1113
|
"""Gets the fair_share of this V1UserFeatures. # noqa: E501
|
|
@@ -1135,6 +1150,27 @@ class V1UserFeatures(object):
|
|
|
1135
1150
|
|
|
1136
1151
|
self._featured_studios_admin = featured_studios_admin
|
|
1137
1152
|
|
|
1153
|
+
@property
|
|
1154
|
+
def gcp_overprovisioning(self) -> 'bool':
|
|
1155
|
+
"""Gets the gcp_overprovisioning of this V1UserFeatures. # noqa: E501
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
:return: The gcp_overprovisioning of this V1UserFeatures. # noqa: E501
|
|
1159
|
+
:rtype: bool
|
|
1160
|
+
"""
|
|
1161
|
+
return self._gcp_overprovisioning
|
|
1162
|
+
|
|
1163
|
+
@gcp_overprovisioning.setter
|
|
1164
|
+
def gcp_overprovisioning(self, gcp_overprovisioning: 'bool'):
|
|
1165
|
+
"""Sets the gcp_overprovisioning of this V1UserFeatures.
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
:param gcp_overprovisioning: The gcp_overprovisioning of this V1UserFeatures. # noqa: E501
|
|
1169
|
+
:type: bool
|
|
1170
|
+
"""
|
|
1171
|
+
|
|
1172
|
+
self._gcp_overprovisioning = gcp_overprovisioning
|
|
1173
|
+
|
|
1138
1174
|
@property
|
|
1139
1175
|
def gcs_connections_optimized(self) -> 'bool':
|
|
1140
1176
|
"""Gets the gcs_connections_optimized of this V1UserFeatures. # noqa: E501
|
|
@@ -1240,6 +1276,27 @@ class V1UserFeatures(object):
|
|
|
1240
1276
|
|
|
1241
1277
|
self._job_artifacts_v2 = job_artifacts_v2
|
|
1242
1278
|
|
|
1279
|
+
@property
|
|
1280
|
+
def kubernetes_cluster_ui(self) -> 'bool':
|
|
1281
|
+
"""Gets the kubernetes_cluster_ui of this V1UserFeatures. # noqa: E501
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
:return: The kubernetes_cluster_ui of this V1UserFeatures. # noqa: E501
|
|
1285
|
+
:rtype: bool
|
|
1286
|
+
"""
|
|
1287
|
+
return self._kubernetes_cluster_ui
|
|
1288
|
+
|
|
1289
|
+
@kubernetes_cluster_ui.setter
|
|
1290
|
+
def kubernetes_cluster_ui(self, kubernetes_cluster_ui: 'bool'):
|
|
1291
|
+
"""Sets the kubernetes_cluster_ui of this V1UserFeatures.
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
:param kubernetes_cluster_ui: The kubernetes_cluster_ui of this V1UserFeatures. # noqa: E501
|
|
1295
|
+
:type: bool
|
|
1296
|
+
"""
|
|
1297
|
+
|
|
1298
|
+
self._kubernetes_cluster_ui = kubernetes_cluster_ui
|
|
1299
|
+
|
|
1243
1300
|
@property
|
|
1244
1301
|
def kubernetes_clusters(self) -> 'bool':
|
|
1245
1302
|
"""Gets the kubernetes_clusters of this V1UserFeatures. # noqa: E501
|
|
@@ -1996,6 +2053,27 @@ class V1UserFeatures(object):
|
|
|
1996
2053
|
|
|
1997
2054
|
self._r2_data_connections = r2_data_connections
|
|
1998
2055
|
|
|
2056
|
+
@property
|
|
2057
|
+
def r2_uploads(self) -> 'bool':
|
|
2058
|
+
"""Gets the r2_uploads of this V1UserFeatures. # noqa: E501
|
|
2059
|
+
|
|
2060
|
+
|
|
2061
|
+
:return: The r2_uploads of this V1UserFeatures. # noqa: E501
|
|
2062
|
+
:rtype: bool
|
|
2063
|
+
"""
|
|
2064
|
+
return self._r2_uploads
|
|
2065
|
+
|
|
2066
|
+
@r2_uploads.setter
|
|
2067
|
+
def r2_uploads(self, r2_uploads: 'bool'):
|
|
2068
|
+
"""Sets the r2_uploads of this V1UserFeatures.
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
:param r2_uploads: The r2_uploads of this V1UserFeatures. # noqa: E501
|
|
2072
|
+
:type: bool
|
|
2073
|
+
"""
|
|
2074
|
+
|
|
2075
|
+
self._r2_uploads = r2_uploads
|
|
2076
|
+
|
|
1999
2077
|
@property
|
|
2000
2078
|
def reserved_machines_tab(self) -> 'bool':
|
|
2001
2079
|
"""Gets the reserved_machines_tab of this V1UserFeatures. # noqa: E501
|
|
@@ -57,6 +57,7 @@ class V1Volume(object):
|
|
|
57
57
|
'server_id': 'str',
|
|
58
58
|
'size_gb': 'str',
|
|
59
59
|
'state': 'V1VolumeState',
|
|
60
|
+
'subnet_id': 'str',
|
|
60
61
|
'throughput': 'str',
|
|
61
62
|
'type': 'str',
|
|
62
63
|
'updated_at': 'datetime',
|
|
@@ -80,13 +81,14 @@ class V1Volume(object):
|
|
|
80
81
|
'server_id': 'serverId',
|
|
81
82
|
'size_gb': 'sizeGb',
|
|
82
83
|
'state': 'state',
|
|
84
|
+
'subnet_id': 'subnetId',
|
|
83
85
|
'throughput': 'throughput',
|
|
84
86
|
'type': 'type',
|
|
85
87
|
'updated_at': 'updatedAt',
|
|
86
88
|
'user_id': 'userId'
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
def __init__(self, attached_at: 'datetime' =None, availability_zone: 'str' =None, detached_at: 'datetime' =None, encrypted: 'bool' =None, iops: 'str' =None, metadata: 'V1Metadata' =None, path: 'str' =None, provider: 'str' =None, provider_id: 'str' =None, region: 'str' =None, resource_id: 'str' =None, resource_type: 'str' =None, retention_period: 'str' =None, server_id: 'str' =None, size_gb: 'str' =None, state: 'V1VolumeState' =None, throughput: 'str' =None, type: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
91
|
+
def __init__(self, attached_at: 'datetime' =None, availability_zone: 'str' =None, detached_at: 'datetime' =None, encrypted: 'bool' =None, iops: 'str' =None, metadata: 'V1Metadata' =None, path: 'str' =None, provider: 'str' =None, provider_id: 'str' =None, region: 'str' =None, resource_id: 'str' =None, resource_type: 'str' =None, retention_period: 'str' =None, server_id: 'str' =None, size_gb: 'str' =None, state: 'V1VolumeState' =None, subnet_id: 'str' =None, throughput: 'str' =None, type: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
90
92
|
"""V1Volume - a model defined in Swagger""" # noqa: E501
|
|
91
93
|
self._attached_at = None
|
|
92
94
|
self._availability_zone = None
|
|
@@ -104,6 +106,7 @@ class V1Volume(object):
|
|
|
104
106
|
self._server_id = None
|
|
105
107
|
self._size_gb = None
|
|
106
108
|
self._state = None
|
|
109
|
+
self._subnet_id = None
|
|
107
110
|
self._throughput = None
|
|
108
111
|
self._type = None
|
|
109
112
|
self._updated_at = None
|
|
@@ -141,6 +144,8 @@ class V1Volume(object):
|
|
|
141
144
|
self.size_gb = size_gb
|
|
142
145
|
if state is not None:
|
|
143
146
|
self.state = state
|
|
147
|
+
if subnet_id is not None:
|
|
148
|
+
self.subnet_id = subnet_id
|
|
144
149
|
if throughput is not None:
|
|
145
150
|
self.throughput = throughput
|
|
146
151
|
if type is not None:
|
|
@@ -486,6 +491,27 @@ class V1Volume(object):
|
|
|
486
491
|
|
|
487
492
|
self._state = state
|
|
488
493
|
|
|
494
|
+
@property
|
|
495
|
+
def subnet_id(self) -> 'str':
|
|
496
|
+
"""Gets the subnet_id of this V1Volume. # noqa: E501
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
:return: The subnet_id of this V1Volume. # noqa: E501
|
|
500
|
+
:rtype: str
|
|
501
|
+
"""
|
|
502
|
+
return self._subnet_id
|
|
503
|
+
|
|
504
|
+
@subnet_id.setter
|
|
505
|
+
def subnet_id(self, subnet_id: 'str'):
|
|
506
|
+
"""Sets the subnet_id of this V1Volume.
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
:param subnet_id: The subnet_id of this V1Volume. # noqa: E501
|
|
510
|
+
:type: str
|
|
511
|
+
"""
|
|
512
|
+
|
|
513
|
+
self._subnet_id = subnet_id
|
|
514
|
+
|
|
489
515
|
@property
|
|
490
516
|
def throughput(self) -> 'str':
|
|
491
517
|
"""Gets the throughput of this V1Volume. # noqa: E501
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from time import sleep, time
|
|
3
3
|
from lightning_sdk.lightning_cloud import rest_client
|
|
4
|
-
from lightning_sdk.lightning_cloud.openapi import Create, V1AwsDataConnection, V1S3FolderDataConnection, V1EfsConfig
|
|
4
|
+
from lightning_sdk.lightning_cloud.openapi import Create, V1AwsDataConnection, V1S3FolderDataConnection, V1EfsConfig, V1GcpDataConnection
|
|
5
5
|
from lightning_sdk.lightning_cloud.openapi.rest import ApiException
|
|
6
6
|
import urllib3
|
|
7
|
-
import os
|
|
8
7
|
|
|
9
8
|
def add_s3_connection(bucket_name: str, region: str = "us-east-1", create_timeout: int = 15) -> None:
|
|
10
9
|
"""Utility to add a data connection."""
|
|
@@ -217,6 +216,62 @@ def add_efs_connection(name: str, filesystem_id: str, region: str = "us-east-1",
|
|
|
217
216
|
|
|
218
217
|
return
|
|
219
218
|
|
|
219
|
+
def add_gcs_connection(connection_name: str, bucket_name: str, create_timeout: int = 15) -> None:
|
|
220
|
+
"""
|
|
221
|
+
Utility function to add a GCS data connection.
|
|
222
|
+
|
|
223
|
+
Parameters:
|
|
224
|
+
1. connection_name (str): The name of the data connection.
|
|
225
|
+
2. bucket_name (str): The name of the bucket to attach.
|
|
226
|
+
3. create_timeout (int): The timeout for the data connectio creation.
|
|
227
|
+
Returns:
|
|
228
|
+
None
|
|
229
|
+
"""
|
|
230
|
+
|
|
231
|
+
client = rest_client.LightningClient(retry=False)
|
|
232
|
+
|
|
233
|
+
project_id = os.getenv("LIGHTNING_CLOUD_PROJECT_ID")
|
|
234
|
+
cluster_id = os.getenv("LIGHTNING_CLUSTER_ID")
|
|
235
|
+
|
|
236
|
+
# Get existing data connections and ensure there is no an existing one with the same name and type
|
|
237
|
+
data_connections = client.data_connection_service_list_data_connections(project_id).data_connections
|
|
238
|
+
|
|
239
|
+
for connection in data_connections:
|
|
240
|
+
existing_connection_name = getattr(connection, 'name', None)
|
|
241
|
+
isGCSConnection = getattr(connection, 'gcp', None) is not None
|
|
242
|
+
|
|
243
|
+
# Same name and type already exists
|
|
244
|
+
if existing_connection_name == connection_name and isGCSConnection:
|
|
245
|
+
return
|
|
246
|
+
|
|
247
|
+
body = Create(
|
|
248
|
+
name=connection_name,
|
|
249
|
+
create_index=True,
|
|
250
|
+
cluster_id=cluster_id,
|
|
251
|
+
access_cluster_ids=[cluster_id],
|
|
252
|
+
gcp=V1GcpDataConnection(
|
|
253
|
+
source=f"gs://{bucket_name}",
|
|
254
|
+
))
|
|
255
|
+
try:
|
|
256
|
+
client.data_connection_service_create_data_connection(body, project_id)
|
|
257
|
+
except (ApiException, urllib3.exceptions.HTTPError) as ex:
|
|
258
|
+
# Note: This function can be called in a distributed way.
|
|
259
|
+
# There is a race condition where one machine might create the entry before another machine
|
|
260
|
+
# and this request would fail with duplicated key
|
|
261
|
+
# In this case, it is fine not to raise
|
|
262
|
+
if isinstance(ex, ApiException) and 'duplicate key value violates unique constraint' in str(ex.body):
|
|
263
|
+
pass
|
|
264
|
+
else:
|
|
265
|
+
raise ex
|
|
266
|
+
|
|
267
|
+
# Wait for the filesystem picks up the newly added GCS data connection
|
|
268
|
+
start = time()
|
|
269
|
+
|
|
270
|
+
while not os.path.isdir(f"/teamspace/gcs_connections/{bucket_name}") and (time() - start) < create_timeout:
|
|
271
|
+
sleep(1)
|
|
272
|
+
|
|
273
|
+
return
|
|
274
|
+
|
|
220
275
|
def delete_data_connection(name: str):
|
|
221
276
|
"""Utility to delete a data connection
|
|
222
277
|
|
|
@@ -249,4 +304,3 @@ def delete_data_connection(name: str):
|
|
|
249
304
|
# for now it's best to actually stop the studio and all other things where the connection
|
|
250
305
|
# is mounted before trying to delete it
|
|
251
306
|
raise e from None
|
|
252
|
-
|
lightning_sdk/llm/llm.py
CHANGED
|
@@ -9,6 +9,7 @@ PUBLIC_MODEL_PROVIDERS: Dict[str, str] = {
|
|
|
9
9
|
"openai": "OpenAI",
|
|
10
10
|
"anthropic": "Anthropic",
|
|
11
11
|
"google": "Google",
|
|
12
|
+
"lightning-ai": "lightning-ai",
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
|
|
@@ -169,21 +170,33 @@ class LLM:
|
|
|
169
170
|
self._conversations[conversation.name] = conversation.id
|
|
170
171
|
|
|
171
172
|
def _stream_chat_response(
|
|
172
|
-
self,
|
|
173
|
+
self,
|
|
174
|
+
result: Generator[V1ConversationResponseChunk, None, None],
|
|
175
|
+
conversation: Optional[str] = None,
|
|
176
|
+
full_response: bool = False,
|
|
173
177
|
) -> Generator[str, None, None]:
|
|
174
178
|
first_line = next(result, None)
|
|
175
179
|
if first_line:
|
|
176
180
|
if conversation and first_line.conversation_id:
|
|
177
181
|
self._conversations[conversation] = first_line.conversation_id
|
|
178
|
-
|
|
182
|
+
if full_response:
|
|
183
|
+
yield first_line
|
|
184
|
+
else:
|
|
185
|
+
yield first_line.choices[0].delta.content
|
|
179
186
|
|
|
180
187
|
for line in result:
|
|
181
|
-
|
|
188
|
+
if full_response:
|
|
189
|
+
yield line
|
|
190
|
+
else:
|
|
191
|
+
yield line.choices[0].delta.content
|
|
182
192
|
|
|
183
|
-
async def _async_stream_text(self, output: str) -> AsyncGenerator[str, None]:
|
|
193
|
+
async def _async_stream_text(self, output: str, full_response: bool = False) -> AsyncGenerator[str, None]:
|
|
184
194
|
async for chunk in output:
|
|
185
195
|
if chunk.choices and chunk.choices[0].delta:
|
|
186
|
-
|
|
196
|
+
if full_response:
|
|
197
|
+
yield chunk
|
|
198
|
+
else:
|
|
199
|
+
yield chunk.choices[0].delta.content
|
|
187
200
|
|
|
188
201
|
async def _async_chat(
|
|
189
202
|
self,
|
|
@@ -194,6 +207,7 @@ class LLM:
|
|
|
194
207
|
conversation: Optional[str] = None,
|
|
195
208
|
metadata: Optional[Dict[str, str]] = None,
|
|
196
209
|
stream: bool = False,
|
|
210
|
+
full_response: bool = False,
|
|
197
211
|
**kwargs: Any,
|
|
198
212
|
) -> Union[str, AsyncGenerator[str, None]]:
|
|
199
213
|
conversation_id = self._conversations.get(conversation) if conversation else None
|
|
@@ -213,8 +227,10 @@ class LLM:
|
|
|
213
227
|
if not stream:
|
|
214
228
|
if conversation and not conversation_id:
|
|
215
229
|
self._conversations[conversation] = output.conversation_id
|
|
230
|
+
if full_response:
|
|
231
|
+
return output
|
|
216
232
|
return output.choices[0].delta.content
|
|
217
|
-
return self._async_stream_text(output)
|
|
233
|
+
return self._async_stream_text(output, full_response)
|
|
218
234
|
|
|
219
235
|
def chat(
|
|
220
236
|
self,
|
|
@@ -225,8 +241,12 @@ class LLM:
|
|
|
225
241
|
conversation: Optional[str] = None,
|
|
226
242
|
metadata: Optional[Dict[str, str]] = None,
|
|
227
243
|
stream: bool = False,
|
|
244
|
+
full_response: bool = False,
|
|
245
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
228
246
|
**kwargs: Any,
|
|
229
|
-
) -> Union[
|
|
247
|
+
) -> Union[
|
|
248
|
+
V1ConversationResponseChunk, Generator[V1ConversationResponseChunk, None, None], str, Generator[str, None, None]
|
|
249
|
+
]:
|
|
230
250
|
if conversation and conversation not in self._conversations:
|
|
231
251
|
self._get_conversations()
|
|
232
252
|
|
|
@@ -248,6 +268,7 @@ class LLM:
|
|
|
248
268
|
conversation,
|
|
249
269
|
metadata,
|
|
250
270
|
stream,
|
|
271
|
+
full_response,
|
|
251
272
|
**kwargs,
|
|
252
273
|
)
|
|
253
274
|
|
|
@@ -262,13 +283,16 @@ class LLM:
|
|
|
262
283
|
metadata=metadata,
|
|
263
284
|
name=conversation,
|
|
264
285
|
stream=stream,
|
|
286
|
+
tools=tools,
|
|
265
287
|
**kwargs,
|
|
266
288
|
)
|
|
267
289
|
if not stream:
|
|
268
290
|
if conversation and not conversation_id:
|
|
269
291
|
self._conversations[conversation] = output.conversation_id
|
|
292
|
+
if full_response:
|
|
293
|
+
return output
|
|
270
294
|
return output.choices[0].delta.content
|
|
271
|
-
return self._stream_chat_response(output, conversation=conversation)
|
|
295
|
+
return self._stream_chat_response(output, conversation=conversation, full_response=full_response)
|
|
272
296
|
|
|
273
297
|
def list_conversations(self) -> List[Dict]:
|
|
274
298
|
self._get_conversations()
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
"openai/o3-mini": "ast_01jz3t13fhnjhh11t1k8b5gyp1",
|
|
5
5
|
"anthropic/claude-3-5-sonnet-20240620": "ast_01jd3923a6p98rqwh3dpj686pq",
|
|
6
6
|
"google/gemini-2.5-pro": "ast_01jz3tdb1fhey798k95pv61v57",
|
|
7
|
-
"google/gemini-2.5-flash": "ast_01jz3thxskg4fcdk4xhkjkym5a"
|
|
7
|
+
"google/gemini-2.5-flash": "ast_01jz3thxskg4fcdk4xhkjkym5a",
|
|
8
|
+
"google/gemini-2.5-flash-lite-preview-06-17": "ast_01jz3thxskg4fcdk4xhkjkym5b",
|
|
9
|
+
"lightning-ai/llama4-maverick": "ast_01k073vsqs66tenpns02cf5jnq"
|
|
8
10
|
}
|