gmicloud 0.1.1__py3-none-any.whl → 0.1.3__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 +2 -4
- gmicloud/_internal/_client/_artifact_client.py +11 -46
- gmicloud/_internal/_client/_http_client.py +1 -1
- gmicloud/_internal/_client/_iam_client.py +11 -2
- gmicloud/_internal/_client/_task_client.py +8 -42
- gmicloud/_internal/_constants.py +1 -0
- gmicloud/_internal/_enums.py +2 -0
- gmicloud/_internal/_models.py +6 -5
- gmicloud/client.py +1 -1
- {gmicloud-0.1.1.dist-info → gmicloud-0.1.3.dist-info}/METADATA +15 -13
- {gmicloud-0.1.1.dist-info → gmicloud-0.1.3.dist-info}/RECORD +13 -13
- {gmicloud-0.1.1.dist-info → gmicloud-0.1.3.dist-info}/WHEEL +0 -0
- {gmicloud-0.1.1.dist-info → gmicloud-0.1.3.dist-info}/top_level.txt +0 -0
gmicloud/__init__.py
CHANGED
@@ -5,7 +5,7 @@ from ._internal._models import (
|
|
5
5
|
Task,
|
6
6
|
TaskOwner,
|
7
7
|
TaskConfig,
|
8
|
-
|
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
|
-
"
|
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
|
]
|
@@ -5,7 +5,6 @@ from ._iam_client import IAMClient
|
|
5
5
|
from ._decorator import handle_refresh_token
|
6
6
|
from .._models import *
|
7
7
|
from .._config import ARTIFACT_SERVICE_BASE_URL
|
8
|
-
from .._constants import ACCESS_TOKEN_HEADER, CLIENT_ID_HEADER
|
9
8
|
|
10
9
|
|
11
10
|
class ArtifactClient:
|
@@ -33,11 +32,7 @@ class ArtifactClient:
|
|
33
32
|
:return: The Artifact object.
|
34
33
|
:rtype: Artifact
|
35
34
|
"""
|
36
|
-
|
37
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
38
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
39
|
-
}
|
40
|
-
result = self.client.get(f"/get_artifact", custom_headers, {"artifact_id": artifact_id})
|
35
|
+
result = self.client.get(f"/get_artifact", self.iam_client.get_custom_headers(), {"artifact_id": artifact_id})
|
41
36
|
|
42
37
|
return Artifact.model_validate(result)
|
43
38
|
|
@@ -49,11 +44,7 @@ class ArtifactClient:
|
|
49
44
|
:return: A list of Artifact objects.
|
50
45
|
:rtype: List[Artifact]
|
51
46
|
"""
|
52
|
-
|
53
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
54
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
55
|
-
}
|
56
|
-
result = self.client.get("/get_all_artifacts", custom_headers)
|
47
|
+
result = self.client.get("/get_all_artifacts", self.iam_client.get_custom_headers())
|
57
48
|
if not result:
|
58
49
|
return []
|
59
50
|
return [Artifact.model_validate(item) for item in result]
|
@@ -67,11 +58,7 @@ class ArtifactClient:
|
|
67
58
|
:return: The response object containing the created artifact details.
|
68
59
|
:rtype: CreateArtifactResponse
|
69
60
|
"""
|
70
|
-
|
71
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
72
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
73
|
-
}
|
74
|
-
result = self.client.post("/create_artifact", custom_headers, request.model_dump())
|
61
|
+
result = self.client.post("/create_artifact", self.iam_client.get_custom_headers(), request.model_dump())
|
75
62
|
|
76
63
|
return CreateArtifactResponse.model_validate(result)
|
77
64
|
|
@@ -84,11 +71,7 @@ class ArtifactClient:
|
|
84
71
|
:return: The response object containing the created artifact details.
|
85
72
|
:rtype: CreateArtifactFromTemplateResponse
|
86
73
|
"""
|
87
|
-
|
88
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
89
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
90
|
-
}
|
91
|
-
result = self.client.post("/create_artifact_from_template", custom_headers,
|
74
|
+
result = self.client.post("/create_artifact_from_template", self.iam_client.get_custom_headers(),
|
92
75
|
{"artifact_template_id": artifact_template_id})
|
93
76
|
|
94
77
|
return CreateArtifactFromTemplateResponse.model_validate(result)
|
@@ -102,11 +85,8 @@ class ArtifactClient:
|
|
102
85
|
:return: The response object containing the rebuilt artifact details.
|
103
86
|
:rtype: RebuildArtifactResponse
|
104
87
|
"""
|
105
|
-
|
106
|
-
|
107
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
108
|
-
}
|
109
|
-
result = self.client.post("/rebuild_artifact", custom_headers, {"artifact_id": artifact_id})
|
88
|
+
result = self.client.post("/rebuild_artifact", self.iam_client.get_custom_headers(),
|
89
|
+
{"artifact_id": artifact_id})
|
110
90
|
|
111
91
|
return CreateArtifactResponse.model_validate(result)
|
112
92
|
|
@@ -119,11 +99,8 @@ class ArtifactClient:
|
|
119
99
|
:return: The response object containing the deleted artifact details.
|
120
100
|
:rtype: DeleteArtifactResponse
|
121
101
|
"""
|
122
|
-
|
123
|
-
|
124
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
125
|
-
}
|
126
|
-
result = self.client.delete("/delete_artifact", custom_headers, {"artifact_id": artifact_id})
|
102
|
+
result = self.client.delete("/delete_artifact", self.iam_client.get_custom_headers(),
|
103
|
+
{"artifact_id": artifact_id})
|
127
104
|
|
128
105
|
return DeleteArtifactResponse.model_validate(result)
|
129
106
|
|
@@ -136,11 +113,7 @@ class ArtifactClient:
|
|
136
113
|
:return: The response object containing the pre-signed URL and upload details.
|
137
114
|
:rtype: GetBigFileUploadUrlResponse
|
138
115
|
"""
|
139
|
-
|
140
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
141
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
142
|
-
}
|
143
|
-
result = self.client.post("/get_bigfile_upload_url", custom_headers, request.model_dump())
|
116
|
+
result = self.client.post("/get_bigfile_upload_url", self.iam_client.get_custom_headers(), request.model_dump())
|
144
117
|
|
145
118
|
return GetBigFileUploadUrlResponse.model_validate(result)
|
146
119
|
|
@@ -153,11 +126,7 @@ class ArtifactClient:
|
|
153
126
|
:return: The response object containing the deletion status.
|
154
127
|
:rtype: DeleteBigfileResponse
|
155
128
|
"""
|
156
|
-
|
157
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
158
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
159
|
-
}
|
160
|
-
result = self.client.delete("/delete_bigfile", custom_headers, request.dict())
|
129
|
+
result = self.client.delete("/delete_bigfile", self.iam_client.get_custom_headers(), request.dict())
|
161
130
|
|
162
131
|
return DeleteBigfileResponse.model_validate(result)
|
163
132
|
|
@@ -169,9 +138,5 @@ class ArtifactClient:
|
|
169
138
|
:return: A list of ArtifactTemplate objects.
|
170
139
|
:rtype: List[ArtifactTemplate]
|
171
140
|
"""
|
172
|
-
|
173
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
174
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
175
|
-
}
|
176
|
-
result = self.client.get("/get_artifact_templates", custom_headers)
|
141
|
+
result = self.client.get("/get_artifact_templates", self.iam_client.get_custom_headers())
|
177
142
|
return GetArtifactTemplatesResponse.model_validate(result)
|
@@ -60,9 +60,9 @@ 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()
|
65
|
+
print(response.text)
|
66
66
|
|
67
67
|
except requests.exceptions.RequestException as e:
|
68
68
|
raise APIError(f"HTTP Request failed: {str(e)}")
|
@@ -3,7 +3,7 @@ import jwt
|
|
3
3
|
from ._http_client import HTTPClient
|
4
4
|
from .._config import IAM_SERVICE_BASE_URL
|
5
5
|
from .._models import *
|
6
|
-
from .._constants import CLIENT_ID_HEADER
|
6
|
+
from .._constants import CLIENT_ID_HEADER, AUTHORIZATION_HEADER
|
7
7
|
|
8
8
|
|
9
9
|
class IAMClient:
|
@@ -49,7 +49,7 @@ class IAMClient:
|
|
49
49
|
custom_headers = {
|
50
50
|
CLIENT_ID_HEADER: self._client_id
|
51
51
|
}
|
52
|
-
result = self.client.patch("/me/sessions", custom_headers, {"refreshToken": self.
|
52
|
+
result = self.client.patch("/me/sessions", custom_headers, {"refreshToken": self._refresh_token})
|
53
53
|
|
54
54
|
resp = LoginResponse.model_validate(result)
|
55
55
|
self._access_token = resp.accessToken
|
@@ -90,3 +90,12 @@ class IAMClient:
|
|
90
90
|
Gets the current client ID.
|
91
91
|
"""
|
92
92
|
return self._client_id
|
93
|
+
|
94
|
+
def get_custom_headers(self) -> dict:
|
95
|
+
"""
|
96
|
+
Gets the custom headers for the IAM client.
|
97
|
+
"""
|
98
|
+
return {
|
99
|
+
AUTHORIZATION_HEADER: f'Bearer {self._access_token}',
|
100
|
+
CLIENT_ID_HEADER: self._client_id
|
101
|
+
}
|
@@ -3,7 +3,6 @@ from ._decorator import handle_refresh_token
|
|
3
3
|
from ._iam_client import IAMClient
|
4
4
|
from .._config import TASK_SERVICE_BASE_URL
|
5
5
|
from .._models import *
|
6
|
-
from .._constants import ACCESS_TOKEN_HEADER, CLIENT_ID_HEADER
|
7
6
|
|
8
7
|
|
9
8
|
class TaskClient:
|
@@ -30,11 +29,7 @@ class TaskClient:
|
|
30
29
|
:return: An instance of Task containing the details of the retrieved task.
|
31
30
|
:rtype: Task
|
32
31
|
"""
|
33
|
-
|
34
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
35
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
36
|
-
}
|
37
|
-
result = self.client.get("/get_task", custom_headers, {"task_id": task_id})
|
32
|
+
result = self.client.get("/get_task", self.iam_client.get_custom_headers(), {"task_id": task_id})
|
38
33
|
|
39
34
|
return Task.model_validate(result)
|
40
35
|
|
@@ -46,11 +41,7 @@ class TaskClient:
|
|
46
41
|
:return: An instance of GetAllTasksResponse containing the retrieved tasks.
|
47
42
|
:rtype: GetAllTasksResponse
|
48
43
|
"""
|
49
|
-
|
50
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
51
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
52
|
-
}
|
53
|
-
result = self.client.get("/get_tasks", custom_headers)
|
44
|
+
result = self.client.get("/get_tasks", self.iam_client.get_custom_headers())
|
54
45
|
if not result:
|
55
46
|
return GetAllTasksResponse(tasks=[])
|
56
47
|
|
@@ -63,12 +54,7 @@ class TaskClient:
|
|
63
54
|
|
64
55
|
:param task: The Task object containing the details of the task to be created.
|
65
56
|
"""
|
66
|
-
|
67
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
68
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
69
|
-
}
|
70
|
-
|
71
|
-
result = self.client.post("/create_task", custom_headers, task.model_dump())
|
57
|
+
result = self.client.post("/create_task", self.iam_client.get_custom_headers(), task.model_dump())
|
72
58
|
|
73
59
|
return CreateTaskResponse.model_validate(result)
|
74
60
|
|
@@ -79,11 +65,7 @@ class TaskClient:
|
|
79
65
|
|
80
66
|
:param task: The Task object containing the updated task details.
|
81
67
|
"""
|
82
|
-
|
83
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
84
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
85
|
-
}
|
86
|
-
self.client.put("/update_schedule", custom_headers, task.model_dump())
|
68
|
+
self.client.put("/update_schedule", self.iam_client.get_custom_headers(), task.model_dump())
|
87
69
|
|
88
70
|
@handle_refresh_token
|
89
71
|
def start_task(self, task_id: str):
|
@@ -92,11 +74,7 @@ class TaskClient:
|
|
92
74
|
|
93
75
|
:param task_id: The ID of the task to be started.
|
94
76
|
"""
|
95
|
-
|
96
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
97
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
98
|
-
}
|
99
|
-
self.client.post("/start_task", custom_headers, {"task_id": task_id})
|
77
|
+
self.client.post("/start_task", self.iam_client.get_custom_headers(), {"task_id": task_id})
|
100
78
|
|
101
79
|
@handle_refresh_token
|
102
80
|
def stop_task(self, task_id: str):
|
@@ -105,11 +83,7 @@ class TaskClient:
|
|
105
83
|
|
106
84
|
:param task_id: The ID of the task to be stopped.
|
107
85
|
"""
|
108
|
-
|
109
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
110
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
111
|
-
}
|
112
|
-
self.client.post("/stop_task", custom_headers, {"task_id": task_id})
|
86
|
+
self.client.post("/stop_task", self.iam_client.get_custom_headers(), {"task_id": task_id})
|
113
87
|
|
114
88
|
@handle_refresh_token
|
115
89
|
def get_usage_data(self, start_timestamp: str, end_timestamp: str) -> GetUsageDataResponse:
|
@@ -119,11 +93,7 @@ class TaskClient:
|
|
119
93
|
:param start_timestamp: The start timestamp of the usage data.
|
120
94
|
:param end_timestamp: The end timestamp of the usage data.
|
121
95
|
"""
|
122
|
-
|
123
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
124
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
125
|
-
}
|
126
|
-
result = self.client.get("/get_usage_data", custom_headers,
|
96
|
+
result = self.client.get("/get_usage_data", self.iam_client.get_custom_headers(),
|
127
97
|
{"start_timestamp": start_timestamp, "end_timestamp": end_timestamp})
|
128
98
|
|
129
99
|
return result
|
@@ -135,8 +105,4 @@ class TaskClient:
|
|
135
105
|
|
136
106
|
:param task_id: The ID of the task to be archived.
|
137
107
|
"""
|
138
|
-
|
139
|
-
ACCESS_TOKEN_HEADER: self.iam_client.get_access_token(),
|
140
|
-
CLIENT_ID_HEADER: self.iam_client.get_client_id()
|
141
|
-
}
|
142
|
-
self.client.post("/archive_task", custom_headers, {"task_id": task_id})
|
108
|
+
self.client.post("/archive_task", self.iam_client.get_custom_headers(), {"task_id": task_id})
|
gmicloud/_internal/_constants.py
CHANGED
gmicloud/_internal/_enums.py
CHANGED
@@ -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"
|
gmicloud/_internal/_models.py
CHANGED
@@ -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
|
268
|
+
class EndpointInfo(BaseModel):
|
269
269
|
"""
|
270
|
-
Additional information about
|
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
|
-
|
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
|
-
|
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,
|
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.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: GMI Cloud Python SDK
|
5
5
|
Author-email: GMI <gmi@gmitec.net>
|
6
6
|
License: MIT
|
@@ -10,10 +10,12 @@ Classifier: Operating System :: OS Independent
|
|
10
10
|
Requires-Python: >=3.6
|
11
11
|
Description-Content-Type: text/markdown
|
12
12
|
|
13
|
-
# GMICloud SDK
|
13
|
+
# GMICloud SDK (Beta)
|
14
14
|
|
15
15
|
## Overview
|
16
16
|
|
17
|
+
Before you start: Our service and GPU resource is currenly invite-only so please contact our team (getstarted@gmicloud.ai) to get invited if you don't have one yet.
|
18
|
+
|
17
19
|
The GMI Inference Engine SDK provides a Python interface for deploying and managing machine learning models in
|
18
20
|
production environments. It allows users to create model artifacts, schedule tasks for serving models, and call
|
19
21
|
inference APIs easily.
|
@@ -76,10 +78,10 @@ client = Client()
|
|
76
78
|
|
77
79
|
# Schedule and start a task from an artifact template
|
78
80
|
task = client.create_task_from_artifact_template(
|
79
|
-
"
|
81
|
+
"qwen_2.5_14b_instruct_template_001",
|
80
82
|
TaskScheduling(
|
81
83
|
scheduling_oneoff=OneOffScheduling(
|
82
|
-
trigger_timestamp=int(datetime.now().timestamp()) +
|
84
|
+
trigger_timestamp=int(datetime.now().timestamp()) + 10, # Delay by 10 seconds
|
83
85
|
min_replicas=1,
|
84
86
|
max_replicas=10,
|
85
87
|
)
|
@@ -104,7 +106,7 @@ def create_artifact_from_template(client):
|
|
104
106
|
# List all available templates
|
105
107
|
templates = artifact_manager.get_artifact_templates()
|
106
108
|
for template in templates:
|
107
|
-
if template.
|
109
|
+
if template.artifact_template_id == "qwen_2.5_14b_instruct_template_001":
|
108
110
|
return artifact_manager.create_artifact_from_template(
|
109
111
|
artifact_template_id=template.artifact_template_id
|
110
112
|
)
|
@@ -132,19 +134,19 @@ def create_task_and_start(client, artifact_id):
|
|
132
134
|
task = task_manager.create_task(Task(
|
133
135
|
config=TaskConfig(
|
134
136
|
ray_task_config=RayTaskConfig(
|
135
|
-
ray_version="
|
137
|
+
ray_version="2.40.0-py310-gpu",
|
136
138
|
file_path="serve",
|
137
139
|
artifact_id=artifact_id,
|
138
140
|
deployment_name="app",
|
139
141
|
replica_resource=ReplicaResource(
|
140
|
-
cpu=
|
141
|
-
ram_gb=
|
142
|
-
gpu=
|
142
|
+
cpu=10,
|
143
|
+
ram_gb=100,
|
144
|
+
gpu=1,
|
143
145
|
),
|
144
146
|
),
|
145
147
|
task_scheduling=TaskScheduling(
|
146
148
|
scheduling_oneoff=OneOffScheduling(
|
147
|
-
trigger_timestamp=int(datetime.now().timestamp()) +
|
149
|
+
trigger_timestamp=int(datetime.now().timestamp()) + 10,
|
148
150
|
min_replicas=1,
|
149
151
|
max_replicas=10,
|
150
152
|
)
|
@@ -158,7 +160,7 @@ def create_task_and_start(client, artifact_id):
|
|
158
160
|
|
159
161
|
### (c) Query the Model Endpoint
|
160
162
|
|
161
|
-
Once the task is
|
163
|
+
Once the task is running, use the endpoint for inference:
|
162
164
|
|
163
165
|
```python
|
164
166
|
from examples.completion import call_chat_completion
|
@@ -198,8 +200,8 @@ password: Optional[str] = ""
|
|
198
200
|
## Notes & Troubleshooting
|
199
201
|
|
200
202
|
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 "
|
202
|
-
Inference Endpoint Readiness: Use the task endpoint only after the task status changes to "
|
203
|
+
Artifact Status: It may take a few minutes for an artifact or task to transition to the "running" state.
|
204
|
+
Inference Endpoint Readiness: Use the task endpoint only after the task status changes to "running".
|
203
205
|
Default OpenAI Key: By default, the OpenAI API base URL is derived from the endpoint provided by GMI.
|
204
206
|
|
205
207
|
## Contributing
|
@@ -1,18 +1,18 @@
|
|
1
|
-
gmicloud/__init__.py,sha256=
|
2
|
-
gmicloud/client.py,sha256=
|
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
|
-
gmicloud/_internal/_constants.py,sha256=
|
6
|
-
gmicloud/_internal/_enums.py,sha256=
|
5
|
+
gmicloud/_internal/_constants.py,sha256=Y085dwFlqdFkCf39iBfxz39QiiB7lX59ayNJjB86_m4,378
|
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=
|
8
|
+
gmicloud/_internal/_models.py,sha256=1yUk1yIyfXybIeR8guwYLbXc8gAKzXRpIZ7_6SOId28,13212
|
9
9
|
gmicloud/_internal/_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
gmicloud/_internal/_client/_artifact_client.py,sha256=
|
10
|
+
gmicloud/_internal/_client/_artifact_client.py,sha256=py6SQ1tVoK365hIIxnla433mpCapActZ6KE6Yakds-8,5588
|
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=
|
14
|
-
gmicloud/_internal/_client/_iam_client.py,sha256=
|
15
|
-
gmicloud/_internal/_client/_task_client.py,sha256=
|
13
|
+
gmicloud/_internal/_client/_http_client.py,sha256=F7qpq6WLp6PJkqusWojdi483LijWBsSIY43NjJcyXNU,5704
|
14
|
+
gmicloud/_internal/_client/_iam_client.py,sha256=D7PhQerSzjGGerXsd5Si-e-Wa5f-fJpOACkfWOnkPJg,2979
|
15
|
+
gmicloud/_internal/_client/_task_client.py,sha256=JgYewfDy2iblRVrc9sdA8RbcooXyAho79ESuCK8PRWI,3842
|
16
16
|
gmicloud/_internal/_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
gmicloud/_internal/_manager/_artifact_manager.py,sha256=cc367Kd-W9Zn2d_wUcG6tT06544HRItIZ5IsFfA5_RQ,12201
|
18
18
|
gmicloud/_internal/_manager/_task_manager.py,sha256=QQfpYXFKAAI_FSI--Nxvjlgf_jeVZuVnTuRGTQzrZso,8034
|
@@ -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.
|
24
|
-
gmicloud-0.1.
|
25
|
-
gmicloud-0.1.
|
26
|
-
gmicloud-0.1.
|
23
|
+
gmicloud-0.1.3.dist-info/METADATA,sha256=OuNXnrFTE_tTDuArqevbW81fKwB--E23YUv6-uj91u0,6808
|
24
|
+
gmicloud-0.1.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
25
|
+
gmicloud-0.1.3.dist-info/top_level.txt,sha256=AZimLw3y0WPpLiSiOidZ1gD0dxALh-jQNk4fxC05hYE,9
|
26
|
+
gmicloud-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|