gmicloud 0.1.1__py3-none-any.whl → 0.1.2__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.
gmicloud/__init__.py CHANGED
@@ -5,7 +5,7 @@ from ._internal._models import (
5
5
  Task,
6
6
  TaskOwner,
7
7
  TaskConfig,
8
- TaskInfo,
8
+ EndpointInfo,
9
9
  RayTaskConfig,
10
10
  TaskScheduling,
11
11
  ReplicaResource,
@@ -13,7 +13,6 @@ from ._internal._models import (
13
13
  DailyScheduling,
14
14
  DailyTrigger,
15
15
  ArtifactTemplate,
16
- CreateArtifactFromTemplateResponse
17
16
  )
18
17
  from ._internal._enums import (
19
18
  BuildStatus,
@@ -29,7 +28,7 @@ __all__ = [
29
28
  "Task",
30
29
  "TaskOwner",
31
30
  "TaskConfig",
32
- "TaskInfo",
31
+ "EndpointInfo",
33
32
  "RayTaskConfig",
34
33
  "TaskScheduling",
35
34
  "ReplicaResource",
@@ -39,5 +38,4 @@ __all__ = [
39
38
  "ArtifactTemplate",
40
39
  "BuildStatus",
41
40
  "TaskEndpointStatus",
42
- "CreateArtifactFromTemplateResponse"
43
41
  ]
@@ -60,7 +60,6 @@ class HTTPClient:
60
60
  else:
61
61
  error_message = response.json().get('message', 'Unknown error')
62
62
  raise APIError(f"HTTP Request failed: {error_message}")
63
-
64
63
  # Raise for HTTP errors
65
64
  response.raise_for_status()
66
65
 
@@ -14,6 +14,7 @@ class BuildStatus(str, Enum):
14
14
 
15
15
 
16
16
  class TaskEndpointStatus(str, Enum):
17
+ UNKNOWN = ""
17
18
  PENDING = "pending"
18
19
  DEPLOYING = "deploying"
19
20
  SCALING = "scaling"
@@ -21,3 +22,4 @@ class TaskEndpointStatus(str, Enum):
21
22
  ARCHIVED = "archived"
22
23
  READY = "ready"
23
24
  UNREADY = "unready"
25
+ NEW = "new"
@@ -216,7 +216,7 @@ class RayTaskConfig(BaseModel):
216
216
  file_path: Optional[str] = "" # Path to the task file in storage.
217
217
  deployment_name: Optional[str] = "" # Name of the deployment.
218
218
  replica_resource: Optional[ReplicaResource] = None # Resources allocated for task replicas.
219
- volume_mounts: Optional[VolumeMount] = None # Configuration for mounted volumes.
219
+ volume_mounts: Optional[List[VolumeMount]] = None # Configuration for mounted volumes.
220
220
 
221
221
 
222
222
  class OneOffScheduling(BaseModel):
@@ -265,12 +265,12 @@ class TaskConfig(BaseModel):
265
265
  last_update_timestamp: Optional[int] = 0 # Timestamp when the task was last updated.
266
266
 
267
267
 
268
- class TaskInfo(BaseModel):
268
+ class EndpointInfo(BaseModel):
269
269
  """
270
- Additional information about a task.
270
+ Additional information about the task endpoint.
271
271
  """
272
272
  endpoint_status: Optional[TaskEndpointStatus] = None # Current status of the task (e.g., running, stopped).
273
- endpoint: Optional[str] = "" # API endpoint exposed by the task, if applicable.
273
+ endpoint_url: Optional[str] = "" # URL for accessing the task endpoint.
274
274
 
275
275
 
276
276
  class UserPreference(BaseModel):
@@ -288,7 +288,8 @@ class Task(BaseModel):
288
288
  task_id: Optional[str] = None # Unique identifier for the task.
289
289
  owner: Optional[TaskOwner] = None # Ownership information of the task.
290
290
  config: Optional[TaskConfig] = None # Configuration data for the task.
291
- info: Optional[TaskInfo] = None # Additional information about the task.
291
+ endpoint_info: Optional[EndpointInfo] = None # Additional information about the task endpoint.
292
+ cluster_endpoints: Optional[List[EndpointInfo]] = None # Endpoints for the task cluster.
292
293
  task_status: Optional[str] = "" # Status of the task.
293
294
  readiness_status: Optional[str] = "" # Readiness status of the task.
294
295
  user_preference: Optional[UserPreference] = None # User preference for the task.
gmicloud/client.py CHANGED
@@ -7,7 +7,7 @@ from ._internal._client._iam_client import IAMClient
7
7
  from ._internal._manager._artifact_manager import ArtifactManager
8
8
  from ._internal._manager._task_manager import TaskManager
9
9
  from ._internal._enums import BuildStatus
10
- from ._internal._models import Task, TaskConfig, RayTaskConfig, TaskScheduling, OneOffScheduling, ReplicaResource
10
+ from ._internal._models import Task, TaskConfig, RayTaskConfig, TaskScheduling, ReplicaResource
11
11
 
12
12
 
13
13
  class Client:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gmicloud
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: GMI Cloud Python SDK
5
5
  Author-email: GMI <gmi@gmitec.net>
6
6
  License: MIT
@@ -76,10 +76,10 @@ client = Client()
76
76
 
77
77
  # Schedule and start a task from an artifact template
78
78
  task = client.create_task_from_artifact_template(
79
- "llama31_8b_template_001",
79
+ "qwen_2.5_14b_instruct_template_001",
80
80
  TaskScheduling(
81
81
  scheduling_oneoff=OneOffScheduling(
82
- trigger_timestamp=int(datetime.now().timestamp()) + 60, # Delay by 1 min
82
+ trigger_timestamp=int(datetime.now().timestamp()) + 10, # Delay by 10 seconds
83
83
  min_replicas=1,
84
84
  max_replicas=10,
85
85
  )
@@ -104,7 +104,7 @@ def create_artifact_from_template(client):
104
104
  # List all available templates
105
105
  templates = artifact_manager.get_artifact_templates()
106
106
  for template in templates:
107
- if template.artifact_name == "Llama3.1 8B":
107
+ if template.artifact_template_id == "qwen_2.5_14b_instruct_template_001":
108
108
  return artifact_manager.create_artifact_from_template(
109
109
  artifact_template_id=template.artifact_template_id
110
110
  )
@@ -132,19 +132,19 @@ def create_task_and_start(client, artifact_id):
132
132
  task = task_manager.create_task(Task(
133
133
  config=TaskConfig(
134
134
  ray_task_config=RayTaskConfig(
135
- ray_version="latest-py311-gpu",
135
+ ray_version="2.40.0-py310-gpu",
136
136
  file_path="serve",
137
137
  artifact_id=artifact_id,
138
138
  deployment_name="app",
139
139
  replica_resource=ReplicaResource(
140
- cpu=24,
141
- ram_gb=128,
142
- gpu=2,
140
+ cpu=10,
141
+ ram_gb=100,
142
+ gpu=1,
143
143
  ),
144
144
  ),
145
145
  task_scheduling=TaskScheduling(
146
146
  scheduling_oneoff=OneOffScheduling(
147
- trigger_timestamp=int(datetime.now().timestamp()) + 60,
147
+ trigger_timestamp=int(datetime.now().timestamp()) + 10,
148
148
  min_replicas=1,
149
149
  max_replicas=10,
150
150
  )
@@ -158,7 +158,7 @@ def create_task_and_start(client, artifact_id):
158
158
 
159
159
  ### (c) Query the Model Endpoint
160
160
 
161
- Once the task is ready, use the endpoint for inference:
161
+ Once the task is running, use the endpoint for inference:
162
162
 
163
163
  ```python
164
164
  from examples.completion import call_chat_completion
@@ -198,8 +198,8 @@ password: Optional[str] = ""
198
198
  ## Notes & Troubleshooting
199
199
 
200
200
  Ensure Credentials are Correct: Double-check your environment variables or parameters passed into the Client object.
201
- Artifact Status: It may take a few minutes for an artifact or task to transition to the "ready" state.
202
- Inference Endpoint Readiness: Use the task endpoint only after the task status changes to "ready".
201
+ Artifact Status: It may take a few minutes for an artifact or task to transition to the "running" state.
202
+ Inference Endpoint Readiness: Use the task endpoint only after the task status changes to "running".
203
203
  Default OpenAI Key: By default, the OpenAI API base URL is derived from the endpoint provided by GMI.
204
204
 
205
205
  ## Contributing
@@ -1,16 +1,16 @@
1
- gmicloud/__init__.py,sha256=jIefHqO_DemXBs6qR9cTtXsuHAEBQo0INuKZKEl3mW8,822
2
- gmicloud/client.py,sha256=qgN6Pcoa_dRwBWRy463yW3Nne52d_D8ogdEODH7LGp4,4751
1
+ gmicloud/__init__.py,sha256=AJP9Z3Ba-AClp5P49YL32qH5-XzDTbEXhWZFF1iLP8Q,750
2
+ gmicloud/client.py,sha256=G3sgH7zzODhdW_Ad56xgomDWXKAhnjzZuj1_mEBGYCI,4733
3
3
  gmicloud/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  gmicloud/_internal/_config.py,sha256=qIH76TSyS3MQWe62LHI46RJhDnklNFisdajY75oUAqE,218
5
5
  gmicloud/_internal/_constants.py,sha256=EyhjJp_mEIsAuopFyfnRzGRVjQH9jOhU5AQvtBF_IeU,339
6
- gmicloud/_internal/_enums.py,sha256=1xGle0FARJEQWkphjUM6yJ1hCqD9YKsh8_5GfkGEvio,477
6
+ gmicloud/_internal/_enums.py,sha256=C4oy6Ps7OGdYd3tK-Wcpi6uXMyAKbOZW8_KykYAKsgw,510
7
7
  gmicloud/_internal/_exceptions.py,sha256=hScBq7n2fOit4_umlkabZJchY8zVbWSRfWM2Y0rLCbw,306
8
- gmicloud/_internal/_models.py,sha256=tqPiqVktwCtHaldi4imzmQVi7zpjKPCi9O8c6QN2Zn8,13083
8
+ gmicloud/_internal/_models.py,sha256=1yUk1yIyfXybIeR8guwYLbXc8gAKzXRpIZ7_6SOId28,13212
9
9
  gmicloud/_internal/_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  gmicloud/_internal/_client/_artifact_client.py,sha256=V8q78L1wys0d2GYJ87m2EFsLUOJG7nsJvAkrHBeXVU8,6895
11
11
  gmicloud/_internal/_client/_decorator.py,sha256=sy4gxzsUB6ORXHw5pqmMf7TTlK41Nmu1fhIhK2AIsbY,670
12
12
  gmicloud/_internal/_client/_file_upload_client.py,sha256=1JRs4X57S3EScPIP9w2DC1Uo6_Wbcjumcw3nVM7uIGM,4667
13
- gmicloud/_internal/_client/_http_client.py,sha256=6xvzYp-pFcKV9U2nOcMKkWpOi3NB_zfWx-bMfsGQwQY,5672
13
+ gmicloud/_internal/_client/_http_client.py,sha256=y5u7jn71exFWYRvh81vs_-8WWmueW7WnEkRjPPyPctI,5671
14
14
  gmicloud/_internal/_client/_iam_client.py,sha256=57KHyGg_0Vj5AzwhIto0kmbqQYxnixKIOilNO8hCwr0,2698
15
15
  gmicloud/_internal/_client/_task_client.py,sha256=G0MqsNDHhdL885jo-isuu9H_Pv_6DLimN7lT-gz2Uv4,5074
16
16
  gmicloud/_internal/_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -20,7 +20,7 @@ gmicloud/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  gmicloud/tests/test_artifacts.py,sha256=YiC1HBMS7g491Ra4acTLI9AdwyjXZfnY9f-fNKn2azQ,17108
21
21
  gmicloud/tests/test_tasks.py,sha256=AY90zTJdsXk1cxn6Jxhi4TDdwXRiGxz_r_aRk_Jkl8Y,10956
22
22
  gmicloud/utils/uninstall_packages.py,sha256=zzuuaJPf39oTXWZ_7tUAGseoxocuCbbkoglJSD5yDrE,1127
23
- gmicloud-0.1.1.dist-info/METADATA,sha256=VtHBj-gOFzBp-4aMRKibO13UAK7wX8Rc71xtXi6fVvs,6583
24
- gmicloud-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
25
- gmicloud-0.1.1.dist-info/top_level.txt,sha256=AZimLw3y0WPpLiSiOidZ1gD0dxALh-jQNk4fxC05hYE,9
26
- gmicloud-0.1.1.dist-info/RECORD,,
23
+ gmicloud-0.1.2.dist-info/METADATA,sha256=Y50szRi4ci9WFSCSn7l0S0IoKX-Tv5nHG0Xb0Vzl76c,6635
24
+ gmicloud-0.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
25
+ gmicloud-0.1.2.dist-info/top_level.txt,sha256=AZimLw3y0WPpLiSiOidZ1gD0dxALh-jQNk4fxC05hYE,9
26
+ gmicloud-0.1.2.dist-info/RECORD,,