together 2.0.0a13__py3-none-any.whl → 2.0.0a15__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.
- together/_client.py +38 -0
- together/_version.py +1 -1
- together/constants.py +34 -0
- together/error.py +16 -0
- together/lib/cli/api/beta/beta.py +12 -0
- together/lib/cli/api/beta/clusters.py +357 -0
- together/lib/cli/api/beta/clusters_storage.py +152 -0
- together/lib/cli/api/utils.py +41 -5
- together/lib/cli/cli.py +2 -0
- together/lib/types/fine_tuning.py +3 -0
- together/resources/__init__.py +14 -0
- together/resources/beta/__init__.py +33 -0
- together/resources/beta/beta.py +102 -0
- together/resources/beta/clusters/__init__.py +33 -0
- together/resources/beta/clusters/clusters.py +628 -0
- together/resources/beta/clusters/storage.py +490 -0
- together/types/__init__.py +12 -1
- together/types/beta/__init__.py +12 -0
- together/types/beta/cluster.py +93 -0
- together/types/beta/cluster_create_params.py +51 -0
- together/types/beta/cluster_create_response.py +9 -0
- together/types/beta/cluster_delete_response.py +9 -0
- together/types/beta/cluster_list_regions_response.py +21 -0
- together/types/beta/cluster_list_response.py +12 -0
- together/types/beta/cluster_update_params.py +13 -0
- together/types/beta/cluster_update_response.py +9 -0
- together/types/beta/clusters/__init__.py +10 -0
- together/types/beta/clusters/cluster_storage.py +13 -0
- together/types/beta/clusters/storage_create_params.py +17 -0
- together/types/beta/clusters/storage_create_response.py +9 -0
- together/types/beta/clusters/storage_delete_response.py +9 -0
- together/types/beta/clusters/storage_list_response.py +12 -0
- together/types/beta/clusters/storage_update_params.py +13 -0
- together/types/chat_completions.py +7 -0
- together/types/endpoints.py +4 -0
- together/types/files.py +8 -0
- together/types/fine_tuning_cancel_response.py +3 -0
- together/types/fine_tuning_list_response.py +3 -0
- together/types/finetune.py +27 -0
- together/types/finetune_response.py +2 -0
- together/types/models.py +2 -0
- {together-2.0.0a13.dist-info → together-2.0.0a15.dist-info}/METADATA +55 -8
- {together-2.0.0a13.dist-info → together-2.0.0a15.dist-info}/RECORD +46 -15
- {together-2.0.0a13.dist-info → together-2.0.0a15.dist-info}/WHEEL +0 -0
- {together-2.0.0a13.dist-info → together-2.0.0a15.dist-info}/entry_points.txt +0 -0
- {together-2.0.0a13.dist-info → together-2.0.0a15.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
8
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
9
|
+
from ...._compat import cached_property
|
|
10
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ...._response import (
|
|
12
|
+
to_raw_response_wrapper,
|
|
13
|
+
to_streamed_response_wrapper,
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
)
|
|
17
|
+
from ...._base_client import make_request_options
|
|
18
|
+
from ....types.beta.clusters import storage_create_params, storage_update_params
|
|
19
|
+
from ....types.beta.clusters.cluster_storage import ClusterStorage
|
|
20
|
+
from ....types.beta.clusters.storage_list_response import StorageListResponse
|
|
21
|
+
from ....types.beta.clusters.storage_create_response import StorageCreateResponse
|
|
22
|
+
from ....types.beta.clusters.storage_delete_response import StorageDeleteResponse
|
|
23
|
+
|
|
24
|
+
__all__ = ["StorageResource", "AsyncStorageResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class StorageResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> StorageResourceWithRawResponse:
|
|
30
|
+
"""
|
|
31
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
32
|
+
the raw response object instead of the parsed content.
|
|
33
|
+
|
|
34
|
+
For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return StorageResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> StorageResourceWithStreamingResponse:
|
|
40
|
+
"""
|
|
41
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
42
|
+
|
|
43
|
+
For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return StorageResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def create(
|
|
48
|
+
self,
|
|
49
|
+
*,
|
|
50
|
+
region: str,
|
|
51
|
+
size_tib: int,
|
|
52
|
+
volume_name: str,
|
|
53
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
54
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
55
|
+
extra_headers: Headers | None = None,
|
|
56
|
+
extra_query: Query | None = None,
|
|
57
|
+
extra_body: Body | None = None,
|
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
59
|
+
) -> StorageCreateResponse:
|
|
60
|
+
"""Create a shared volume.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
region: Region name.
|
|
64
|
+
|
|
65
|
+
Usable regions can be found from `client.clusters.list_regions()`
|
|
66
|
+
|
|
67
|
+
size_tib: Volume size in whole tebibytes (TiB).
|
|
68
|
+
|
|
69
|
+
extra_headers: Send extra headers
|
|
70
|
+
|
|
71
|
+
extra_query: Add additional query parameters to the request
|
|
72
|
+
|
|
73
|
+
extra_body: Add additional JSON properties to the request
|
|
74
|
+
|
|
75
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
76
|
+
"""
|
|
77
|
+
return self._post(
|
|
78
|
+
"/clusters/storages",
|
|
79
|
+
body=maybe_transform(
|
|
80
|
+
{
|
|
81
|
+
"region": region,
|
|
82
|
+
"size_tib": size_tib,
|
|
83
|
+
"volume_name": volume_name,
|
|
84
|
+
},
|
|
85
|
+
storage_create_params.StorageCreateParams,
|
|
86
|
+
),
|
|
87
|
+
options=make_request_options(
|
|
88
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
89
|
+
),
|
|
90
|
+
cast_to=StorageCreateResponse,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def retrieve(
|
|
94
|
+
self,
|
|
95
|
+
volume_id: str,
|
|
96
|
+
*,
|
|
97
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
98
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
99
|
+
extra_headers: Headers | None = None,
|
|
100
|
+
extra_query: Query | None = None,
|
|
101
|
+
extra_body: Body | None = None,
|
|
102
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
103
|
+
) -> ClusterStorage:
|
|
104
|
+
"""
|
|
105
|
+
Get shared volume by volume Id.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
extra_headers: Send extra headers
|
|
109
|
+
|
|
110
|
+
extra_query: Add additional query parameters to the request
|
|
111
|
+
|
|
112
|
+
extra_body: Add additional JSON properties to the request
|
|
113
|
+
|
|
114
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
115
|
+
"""
|
|
116
|
+
if not volume_id:
|
|
117
|
+
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
118
|
+
return self._get(
|
|
119
|
+
f"/clusters/storages/{volume_id}",
|
|
120
|
+
options=make_request_options(
|
|
121
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
122
|
+
),
|
|
123
|
+
cast_to=ClusterStorage,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def update(
|
|
127
|
+
self,
|
|
128
|
+
*,
|
|
129
|
+
size_tib: int | Omit = omit,
|
|
130
|
+
volume_id: str | Omit = omit,
|
|
131
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
132
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
133
|
+
extra_headers: Headers | None = None,
|
|
134
|
+
extra_query: Query | None = None,
|
|
135
|
+
extra_body: Body | None = None,
|
|
136
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
137
|
+
) -> ClusterStorage:
|
|
138
|
+
"""
|
|
139
|
+
Update a shared volume.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
extra_headers: Send extra headers
|
|
143
|
+
|
|
144
|
+
extra_query: Add additional query parameters to the request
|
|
145
|
+
|
|
146
|
+
extra_body: Add additional JSON properties to the request
|
|
147
|
+
|
|
148
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
149
|
+
"""
|
|
150
|
+
return self._put(
|
|
151
|
+
"/clusters/storages",
|
|
152
|
+
body=maybe_transform(
|
|
153
|
+
{
|
|
154
|
+
"size_tib": size_tib,
|
|
155
|
+
"volume_id": volume_id,
|
|
156
|
+
},
|
|
157
|
+
storage_update_params.StorageUpdateParams,
|
|
158
|
+
),
|
|
159
|
+
options=make_request_options(
|
|
160
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
161
|
+
),
|
|
162
|
+
cast_to=ClusterStorage,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
def list(
|
|
166
|
+
self,
|
|
167
|
+
*,
|
|
168
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
169
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
170
|
+
extra_headers: Headers | None = None,
|
|
171
|
+
extra_query: Query | None = None,
|
|
172
|
+
extra_body: Body | None = None,
|
|
173
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
174
|
+
) -> StorageListResponse:
|
|
175
|
+
"""List all shared volumes."""
|
|
176
|
+
return self._get(
|
|
177
|
+
"/clusters/storages",
|
|
178
|
+
options=make_request_options(
|
|
179
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
180
|
+
),
|
|
181
|
+
cast_to=StorageListResponse,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
def delete(
|
|
185
|
+
self,
|
|
186
|
+
volume_id: str,
|
|
187
|
+
*,
|
|
188
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
189
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
190
|
+
extra_headers: Headers | None = None,
|
|
191
|
+
extra_query: Query | None = None,
|
|
192
|
+
extra_body: Body | None = None,
|
|
193
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
194
|
+
) -> StorageDeleteResponse:
|
|
195
|
+
"""
|
|
196
|
+
Delete shared volume by volume id.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
extra_headers: Send extra headers
|
|
200
|
+
|
|
201
|
+
extra_query: Add additional query parameters to the request
|
|
202
|
+
|
|
203
|
+
extra_body: Add additional JSON properties to the request
|
|
204
|
+
|
|
205
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
206
|
+
"""
|
|
207
|
+
if not volume_id:
|
|
208
|
+
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
209
|
+
return self._delete(
|
|
210
|
+
f"/clusters/storages/{volume_id}",
|
|
211
|
+
options=make_request_options(
|
|
212
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
213
|
+
),
|
|
214
|
+
cast_to=StorageDeleteResponse,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class AsyncStorageResource(AsyncAPIResource):
|
|
219
|
+
@cached_property
|
|
220
|
+
def with_raw_response(self) -> AsyncStorageResourceWithRawResponse:
|
|
221
|
+
"""
|
|
222
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
223
|
+
the raw response object instead of the parsed content.
|
|
224
|
+
|
|
225
|
+
For more information, see https://www.github.com/togethercomputer/together-py#accessing-raw-response-data-eg-headers
|
|
226
|
+
"""
|
|
227
|
+
return AsyncStorageResourceWithRawResponse(self)
|
|
228
|
+
|
|
229
|
+
@cached_property
|
|
230
|
+
def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse:
|
|
231
|
+
"""
|
|
232
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
233
|
+
|
|
234
|
+
For more information, see https://www.github.com/togethercomputer/together-py#with_streaming_response
|
|
235
|
+
"""
|
|
236
|
+
return AsyncStorageResourceWithStreamingResponse(self)
|
|
237
|
+
|
|
238
|
+
async def create(
|
|
239
|
+
self,
|
|
240
|
+
*,
|
|
241
|
+
region: str,
|
|
242
|
+
size_tib: int,
|
|
243
|
+
volume_name: str,
|
|
244
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
245
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
246
|
+
extra_headers: Headers | None = None,
|
|
247
|
+
extra_query: Query | None = None,
|
|
248
|
+
extra_body: Body | None = None,
|
|
249
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
250
|
+
) -> StorageCreateResponse:
|
|
251
|
+
"""Create a shared volume.
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
region: Region name.
|
|
255
|
+
|
|
256
|
+
Usable regions can be found from `client.clusters.list_regions()`
|
|
257
|
+
|
|
258
|
+
size_tib: Volume size in whole tebibytes (TiB).
|
|
259
|
+
|
|
260
|
+
extra_headers: Send extra headers
|
|
261
|
+
|
|
262
|
+
extra_query: Add additional query parameters to the request
|
|
263
|
+
|
|
264
|
+
extra_body: Add additional JSON properties to the request
|
|
265
|
+
|
|
266
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
267
|
+
"""
|
|
268
|
+
return await self._post(
|
|
269
|
+
"/clusters/storages",
|
|
270
|
+
body=await async_maybe_transform(
|
|
271
|
+
{
|
|
272
|
+
"region": region,
|
|
273
|
+
"size_tib": size_tib,
|
|
274
|
+
"volume_name": volume_name,
|
|
275
|
+
},
|
|
276
|
+
storage_create_params.StorageCreateParams,
|
|
277
|
+
),
|
|
278
|
+
options=make_request_options(
|
|
279
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
280
|
+
),
|
|
281
|
+
cast_to=StorageCreateResponse,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
async def retrieve(
|
|
285
|
+
self,
|
|
286
|
+
volume_id: str,
|
|
287
|
+
*,
|
|
288
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
289
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
290
|
+
extra_headers: Headers | None = None,
|
|
291
|
+
extra_query: Query | None = None,
|
|
292
|
+
extra_body: Body | None = None,
|
|
293
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
294
|
+
) -> ClusterStorage:
|
|
295
|
+
"""
|
|
296
|
+
Get shared volume by volume Id.
|
|
297
|
+
|
|
298
|
+
Args:
|
|
299
|
+
extra_headers: Send extra headers
|
|
300
|
+
|
|
301
|
+
extra_query: Add additional query parameters to the request
|
|
302
|
+
|
|
303
|
+
extra_body: Add additional JSON properties to the request
|
|
304
|
+
|
|
305
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
306
|
+
"""
|
|
307
|
+
if not volume_id:
|
|
308
|
+
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
309
|
+
return await self._get(
|
|
310
|
+
f"/clusters/storages/{volume_id}",
|
|
311
|
+
options=make_request_options(
|
|
312
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
313
|
+
),
|
|
314
|
+
cast_to=ClusterStorage,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
async def update(
|
|
318
|
+
self,
|
|
319
|
+
*,
|
|
320
|
+
size_tib: int | Omit = omit,
|
|
321
|
+
volume_id: str | Omit = omit,
|
|
322
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
323
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
324
|
+
extra_headers: Headers | None = None,
|
|
325
|
+
extra_query: Query | None = None,
|
|
326
|
+
extra_body: Body | None = None,
|
|
327
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
328
|
+
) -> ClusterStorage:
|
|
329
|
+
"""
|
|
330
|
+
Update a shared volume.
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
extra_headers: Send extra headers
|
|
334
|
+
|
|
335
|
+
extra_query: Add additional query parameters to the request
|
|
336
|
+
|
|
337
|
+
extra_body: Add additional JSON properties to the request
|
|
338
|
+
|
|
339
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
340
|
+
"""
|
|
341
|
+
return await self._put(
|
|
342
|
+
"/clusters/storages",
|
|
343
|
+
body=await async_maybe_transform(
|
|
344
|
+
{
|
|
345
|
+
"size_tib": size_tib,
|
|
346
|
+
"volume_id": volume_id,
|
|
347
|
+
},
|
|
348
|
+
storage_update_params.StorageUpdateParams,
|
|
349
|
+
),
|
|
350
|
+
options=make_request_options(
|
|
351
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
352
|
+
),
|
|
353
|
+
cast_to=ClusterStorage,
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
async def list(
|
|
357
|
+
self,
|
|
358
|
+
*,
|
|
359
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
360
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
361
|
+
extra_headers: Headers | None = None,
|
|
362
|
+
extra_query: Query | None = None,
|
|
363
|
+
extra_body: Body | None = None,
|
|
364
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
365
|
+
) -> StorageListResponse:
|
|
366
|
+
"""List all shared volumes."""
|
|
367
|
+
return await self._get(
|
|
368
|
+
"/clusters/storages",
|
|
369
|
+
options=make_request_options(
|
|
370
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
371
|
+
),
|
|
372
|
+
cast_to=StorageListResponse,
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
async def delete(
|
|
376
|
+
self,
|
|
377
|
+
volume_id: str,
|
|
378
|
+
*,
|
|
379
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
380
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
381
|
+
extra_headers: Headers | None = None,
|
|
382
|
+
extra_query: Query | None = None,
|
|
383
|
+
extra_body: Body | None = None,
|
|
384
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
385
|
+
) -> StorageDeleteResponse:
|
|
386
|
+
"""
|
|
387
|
+
Delete shared volume by volume id.
|
|
388
|
+
|
|
389
|
+
Args:
|
|
390
|
+
extra_headers: Send extra headers
|
|
391
|
+
|
|
392
|
+
extra_query: Add additional query parameters to the request
|
|
393
|
+
|
|
394
|
+
extra_body: Add additional JSON properties to the request
|
|
395
|
+
|
|
396
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
397
|
+
"""
|
|
398
|
+
if not volume_id:
|
|
399
|
+
raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}")
|
|
400
|
+
return await self._delete(
|
|
401
|
+
f"/clusters/storages/{volume_id}",
|
|
402
|
+
options=make_request_options(
|
|
403
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
404
|
+
),
|
|
405
|
+
cast_to=StorageDeleteResponse,
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
class StorageResourceWithRawResponse:
|
|
410
|
+
def __init__(self, storage: StorageResource) -> None:
|
|
411
|
+
self._storage = storage
|
|
412
|
+
|
|
413
|
+
self.create = to_raw_response_wrapper(
|
|
414
|
+
storage.create,
|
|
415
|
+
)
|
|
416
|
+
self.retrieve = to_raw_response_wrapper(
|
|
417
|
+
storage.retrieve,
|
|
418
|
+
)
|
|
419
|
+
self.update = to_raw_response_wrapper(
|
|
420
|
+
storage.update,
|
|
421
|
+
)
|
|
422
|
+
self.list = to_raw_response_wrapper(
|
|
423
|
+
storage.list,
|
|
424
|
+
)
|
|
425
|
+
self.delete = to_raw_response_wrapper(
|
|
426
|
+
storage.delete,
|
|
427
|
+
)
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
class AsyncStorageResourceWithRawResponse:
|
|
431
|
+
def __init__(self, storage: AsyncStorageResource) -> None:
|
|
432
|
+
self._storage = storage
|
|
433
|
+
|
|
434
|
+
self.create = async_to_raw_response_wrapper(
|
|
435
|
+
storage.create,
|
|
436
|
+
)
|
|
437
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
438
|
+
storage.retrieve,
|
|
439
|
+
)
|
|
440
|
+
self.update = async_to_raw_response_wrapper(
|
|
441
|
+
storage.update,
|
|
442
|
+
)
|
|
443
|
+
self.list = async_to_raw_response_wrapper(
|
|
444
|
+
storage.list,
|
|
445
|
+
)
|
|
446
|
+
self.delete = async_to_raw_response_wrapper(
|
|
447
|
+
storage.delete,
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
class StorageResourceWithStreamingResponse:
|
|
452
|
+
def __init__(self, storage: StorageResource) -> None:
|
|
453
|
+
self._storage = storage
|
|
454
|
+
|
|
455
|
+
self.create = to_streamed_response_wrapper(
|
|
456
|
+
storage.create,
|
|
457
|
+
)
|
|
458
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
459
|
+
storage.retrieve,
|
|
460
|
+
)
|
|
461
|
+
self.update = to_streamed_response_wrapper(
|
|
462
|
+
storage.update,
|
|
463
|
+
)
|
|
464
|
+
self.list = to_streamed_response_wrapper(
|
|
465
|
+
storage.list,
|
|
466
|
+
)
|
|
467
|
+
self.delete = to_streamed_response_wrapper(
|
|
468
|
+
storage.delete,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
class AsyncStorageResourceWithStreamingResponse:
|
|
473
|
+
def __init__(self, storage: AsyncStorageResource) -> None:
|
|
474
|
+
self._storage = storage
|
|
475
|
+
|
|
476
|
+
self.create = async_to_streamed_response_wrapper(
|
|
477
|
+
storage.create,
|
|
478
|
+
)
|
|
479
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
480
|
+
storage.retrieve,
|
|
481
|
+
)
|
|
482
|
+
self.update = async_to_streamed_response_wrapper(
|
|
483
|
+
storage.update,
|
|
484
|
+
)
|
|
485
|
+
self.list = async_to_streamed_response_wrapper(
|
|
486
|
+
storage.list,
|
|
487
|
+
)
|
|
488
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
489
|
+
storage.delete,
|
|
490
|
+
)
|
together/types/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
from __future__ import annotations
|
|
3
|
+
from __future__ import annotations # noqa
|
|
4
4
|
|
|
5
5
|
from .batch_job import BatchJob as BatchJob
|
|
6
6
|
from .embedding import Embedding as Embedding
|
|
@@ -68,3 +68,14 @@ from .fine_tuning_estimate_price_response import FineTuningEstimatePriceResponse
|
|
|
68
68
|
from .fine_tuning_list_checkpoints_response import (
|
|
69
69
|
FineTuningListCheckpointsResponse as FineTuningListCheckpointsResponse,
|
|
70
70
|
)
|
|
71
|
+
|
|
72
|
+
# Manually added to minimize breaking changes from V1
|
|
73
|
+
from .chat.chat_completion import ChatCompletion
|
|
74
|
+
from .chat.chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk
|
|
75
|
+
from .chat.chat_completion_usage import ChatCompletionUsage
|
|
76
|
+
UsageData = ChatCompletionUsage
|
|
77
|
+
ChatCompletionResponse = ChatCompletion
|
|
78
|
+
CompletionResponse = Completion
|
|
79
|
+
ListEndpoint = EndpointListResponse
|
|
80
|
+
ImageRequest = ImageGenerateParams
|
|
81
|
+
ImageResponse = ImageFile
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .cluster import Cluster as Cluster
|
|
6
|
+
from .cluster_create_params import ClusterCreateParams as ClusterCreateParams
|
|
7
|
+
from .cluster_list_response import ClusterListResponse as ClusterListResponse
|
|
8
|
+
from .cluster_update_params import ClusterUpdateParams as ClusterUpdateParams
|
|
9
|
+
from .cluster_create_response import ClusterCreateResponse as ClusterCreateResponse
|
|
10
|
+
from .cluster_delete_response import ClusterDeleteResponse as ClusterDeleteResponse
|
|
11
|
+
from .cluster_update_response import ClusterUpdateResponse as ClusterUpdateResponse
|
|
12
|
+
from .cluster_list_regions_response import ClusterListRegionsResponse as ClusterListRegionsResponse
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from ..._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["Cluster", "ControlPlaneNode", "GPUWorkerNode", "Volume"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ControlPlaneNode(BaseModel):
|
|
12
|
+
host_name: str
|
|
13
|
+
|
|
14
|
+
memory_gib: float
|
|
15
|
+
|
|
16
|
+
network: str
|
|
17
|
+
|
|
18
|
+
node_id: str
|
|
19
|
+
|
|
20
|
+
node_name: str
|
|
21
|
+
|
|
22
|
+
num_cpu_cores: int
|
|
23
|
+
|
|
24
|
+
status: str
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class GPUWorkerNode(BaseModel):
|
|
28
|
+
host_name: str
|
|
29
|
+
|
|
30
|
+
memory_gib: float
|
|
31
|
+
|
|
32
|
+
networks: List[str]
|
|
33
|
+
|
|
34
|
+
node_id: str
|
|
35
|
+
|
|
36
|
+
node_name: str
|
|
37
|
+
|
|
38
|
+
num_cpu_cores: int
|
|
39
|
+
|
|
40
|
+
num_gpus: int
|
|
41
|
+
|
|
42
|
+
status: str
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class Volume(BaseModel):
|
|
46
|
+
size_tib: int
|
|
47
|
+
|
|
48
|
+
status: str
|
|
49
|
+
|
|
50
|
+
volume_id: str
|
|
51
|
+
|
|
52
|
+
volume_name: str
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class Cluster(BaseModel):
|
|
56
|
+
cluster_id: str
|
|
57
|
+
|
|
58
|
+
cluster_name: str
|
|
59
|
+
|
|
60
|
+
cluster_type: Literal["KUBERNETES", "SLURM"]
|
|
61
|
+
|
|
62
|
+
control_plane_nodes: List[ControlPlaneNode]
|
|
63
|
+
|
|
64
|
+
driver_version: Literal["CUDA_12_5_555", "CUDA_12_6_560", "CUDA_12_6_565", "CUDA_12_8_570"]
|
|
65
|
+
|
|
66
|
+
duration_hours: int
|
|
67
|
+
|
|
68
|
+
gpu_type: Literal["H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM", "H100_SXM_INF"]
|
|
69
|
+
|
|
70
|
+
gpu_worker_nodes: List[GPUWorkerNode]
|
|
71
|
+
|
|
72
|
+
kube_config: str
|
|
73
|
+
|
|
74
|
+
num_gpus: int
|
|
75
|
+
|
|
76
|
+
region: str
|
|
77
|
+
|
|
78
|
+
status: Literal[
|
|
79
|
+
"WaitingForControlPlaneNodes",
|
|
80
|
+
"WaitingForDataPlaneNodes",
|
|
81
|
+
"WaitingForSubnet",
|
|
82
|
+
"WaitingForSharedVolume",
|
|
83
|
+
"InstallingDrivers",
|
|
84
|
+
"RunningAcceptanceTests",
|
|
85
|
+
"Paused",
|
|
86
|
+
"OnDemandComputePaused",
|
|
87
|
+
"Ready",
|
|
88
|
+
"Degraded",
|
|
89
|
+
"Deleting",
|
|
90
|
+
]
|
|
91
|
+
"""Current status of the GPU cluster."""
|
|
92
|
+
|
|
93
|
+
volumes: List[Volume]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal, Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["ClusterCreateParams", "SharedVolume"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ClusterCreateParams(TypedDict, total=False):
|
|
11
|
+
billing_type: Required[Literal["RESERVED", "ON_DEMAND"]]
|
|
12
|
+
|
|
13
|
+
cluster_name: Required[str]
|
|
14
|
+
"""Name of the GPU cluster."""
|
|
15
|
+
|
|
16
|
+
driver_version: Required[Literal["CUDA_12_5_555", "CUDA_12_6_560", "CUDA_12_6_565", "CUDA_12_8_570"]]
|
|
17
|
+
"""NVIDIA driver version to use in the cluster."""
|
|
18
|
+
|
|
19
|
+
duration_days: Required[int]
|
|
20
|
+
"""Duration in days to keep the cluster running."""
|
|
21
|
+
|
|
22
|
+
gpu_type: Required[Literal["H100_SXM", "H200_SXM", "RTX_6000_PCI", "L40_PCIE", "B200_SXM", "H100_SXM_INF"]]
|
|
23
|
+
"""Type of GPU to use in the cluster"""
|
|
24
|
+
|
|
25
|
+
num_gpus: Required[int]
|
|
26
|
+
"""Number of GPUs to allocate in the cluster.
|
|
27
|
+
|
|
28
|
+
This must be multiple of 8. For example, 8, 16 or 24
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
region: Required[Literal["us-central-8", "us-central-4"]]
|
|
32
|
+
"""Region to create the GPU cluster in.
|
|
33
|
+
|
|
34
|
+
Valid values are us-central-8 and us-central-4.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
cluster_type: Literal["KUBERNETES", "SLURM"]
|
|
38
|
+
|
|
39
|
+
shared_volume: SharedVolume
|
|
40
|
+
|
|
41
|
+
volume_id: str
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SharedVolume(TypedDict, total=False):
|
|
45
|
+
region: Required[str]
|
|
46
|
+
"""Region name. Usable regions can be found from `client.clusters.list_regions()`"""
|
|
47
|
+
|
|
48
|
+
size_tib: Required[int]
|
|
49
|
+
"""Volume size in whole tebibytes (TiB)."""
|
|
50
|
+
|
|
51
|
+
volume_name: Required[str]
|