together 2.0.0a17__py3-none-any.whl → 2.0.0a19__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.
Files changed (67) hide show
  1. together/_base_client.py +5 -2
  2. together/_client.py +1 -77
  3. together/_compat.py +3 -3
  4. together/_utils/_json.py +35 -0
  5. together/_version.py +1 -1
  6. together/lib/cli/api/beta/__init__.py +2 -0
  7. together/lib/cli/api/beta/jig/__init__.py +52 -0
  8. together/lib/cli/api/beta/jig/_config.py +170 -0
  9. together/lib/cli/api/beta/jig/jig.py +664 -0
  10. together/lib/cli/api/beta/jig/secrets.py +138 -0
  11. together/lib/cli/api/beta/jig/volumes.py +509 -0
  12. together/lib/cli/api/endpoints/create.py +7 -3
  13. together/lib/cli/api/endpoints/hardware.py +38 -7
  14. together/lib/cli/api/models/upload.py +5 -1
  15. together/resources/__init__.py +0 -28
  16. together/resources/beta/__init__.py +14 -0
  17. together/resources/beta/beta.py +32 -0
  18. together/resources/beta/clusters/clusters.py +12 -12
  19. together/resources/beta/clusters/storage.py +10 -10
  20. together/resources/beta/jig/__init__.py +61 -0
  21. together/resources/beta/jig/jig.py +1004 -0
  22. together/resources/beta/jig/queue.py +482 -0
  23. together/resources/beta/jig/secrets.py +548 -0
  24. together/resources/beta/jig/volumes.py +514 -0
  25. together/resources/chat/completions.py +10 -0
  26. together/resources/endpoints.py +103 -1
  27. together/resources/models/__init__.py +33 -0
  28. together/resources/{models.py → models/models.py} +41 -9
  29. together/resources/models/uploads.py +163 -0
  30. together/types/__init__.py +2 -4
  31. together/types/beta/__init__.py +6 -0
  32. together/types/beta/deployment.py +261 -0
  33. together/types/beta/deployment_logs.py +11 -0
  34. together/types/beta/jig/__init__.py +20 -0
  35. together/types/beta/jig/queue_cancel_params.py +13 -0
  36. together/types/beta/jig/queue_cancel_response.py +11 -0
  37. together/types/beta/jig/queue_metrics_params.py +12 -0
  38. together/types/beta/jig/queue_metrics_response.py +8 -0
  39. together/types/beta/jig/queue_retrieve_params.py +15 -0
  40. together/types/beta/jig/queue_retrieve_response.py +35 -0
  41. together/types/beta/jig/queue_submit_params.py +19 -0
  42. together/types/beta/jig/queue_submit_response.py +25 -0
  43. together/types/beta/jig/secret.py +33 -0
  44. together/types/beta/jig/secret_create_params.py +34 -0
  45. together/types/beta/jig/secret_list_response.py +16 -0
  46. together/types/beta/jig/secret_update_params.py +34 -0
  47. together/types/beta/jig/volume.py +47 -0
  48. together/types/beta/jig/volume_create_params.py +34 -0
  49. together/types/beta/jig/volume_list_response.py +16 -0
  50. together/types/beta/jig/volume_update_params.py +34 -0
  51. together/types/beta/jig_deploy_params.py +150 -0
  52. together/types/beta/jig_list_response.py +16 -0
  53. together/types/beta/jig_retrieve_logs_params.py +12 -0
  54. together/types/beta/jig_update_params.py +141 -0
  55. together/types/chat/completion_create_params.py +11 -0
  56. together/types/{hardware_list_params.py → endpoint_list_hardware_params.py} +2 -2
  57. together/types/{hardware_list_response.py → endpoint_list_hardware_response.py} +2 -2
  58. together/types/models/__init__.py +5 -0
  59. together/types/{job_retrieve_response.py → models/upload_status_response.py} +3 -3
  60. {together-2.0.0a17.dist-info → together-2.0.0a19.dist-info}/METADATA +15 -14
  61. {together-2.0.0a17.dist-info → together-2.0.0a19.dist-info}/RECORD +64 -30
  62. together/resources/hardware.py +0 -181
  63. together/resources/jobs.py +0 -214
  64. together/types/job_list_response.py +0 -47
  65. {together-2.0.0a17.dist-info → together-2.0.0a19.dist-info}/WHEEL +0 -0
  66. {together-2.0.0a17.dist-info → together-2.0.0a19.dist-info}/entry_points.txt +0 -0
  67. {together-2.0.0a17.dist-info → together-2.0.0a19.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,34 @@
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, TypedDict
6
+
7
+ __all__ = ["VolumeUpdateParams", "Content"]
8
+
9
+
10
+ class VolumeUpdateParams(TypedDict, total=False):
11
+ content: Content
12
+ """Content specifies the new content that will be preloaded to this volume"""
13
+
14
+ name: str
15
+ """Name is the new unique identifier for the volume within the project"""
16
+
17
+ type: Literal["readOnly"]
18
+ """Type is the new volume type (currently only "readOnly" is supported)"""
19
+
20
+
21
+ class Content(TypedDict, total=False):
22
+ """Content specifies the new content that will be preloaded to this volume"""
23
+
24
+ source_prefix: str
25
+ """
26
+ SourcePrefix is the file path prefix for the content to be preloaded into the
27
+ volume
28
+ """
29
+
30
+ type: Literal["files"]
31
+ """
32
+ Type is the content type (currently only "files" is supported which allows
33
+ preloading files uploaded via Files API into the volume)
34
+ """
@@ -0,0 +1,150 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Iterable
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from ..._types import SequenceNotStr
9
+
10
+ __all__ = ["JigDeployParams", "EnvironmentVariable", "Volume"]
11
+
12
+
13
+ class JigDeployParams(TypedDict, total=False):
14
+ gpu_type: Required[Literal["h100-80gb", "a100-80gb"]]
15
+ """GPUType specifies the GPU hardware to use (e.g., "h100-80gb")."""
16
+
17
+ image: Required[str]
18
+ """Image is the container image to deploy from registry.together.ai."""
19
+
20
+ name: Required[str]
21
+ """Name is the unique identifier for your deployment.
22
+
23
+ Must contain only alphanumeric characters, underscores, or hyphens (1-100
24
+ characters)
25
+ """
26
+
27
+ args: SequenceNotStr[str]
28
+ """Args overrides the container's CMD.
29
+
30
+ Provide as an array of arguments (e.g., ["python", "app.py"])
31
+ """
32
+
33
+ autoscaling: Dict[str, str]
34
+ """Autoscaling configuration as key-value pairs.
35
+
36
+ Example: {"metric": "QueueBacklogPerWorker", "target": "10"} to scale based on
37
+ queue backlog
38
+ """
39
+
40
+ command: SequenceNotStr[str]
41
+ """Command overrides the container's ENTRYPOINT.
42
+
43
+ Provide as an array (e.g., ["/bin/sh", "-c"])
44
+ """
45
+
46
+ cpu: float
47
+ """
48
+ CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
49
+ 100 milli cores)
50
+ """
51
+
52
+ description: str
53
+ """Description is an optional human-readable description of your deployment"""
54
+
55
+ environment_variables: Iterable[EnvironmentVariable]
56
+ """EnvironmentVariables is a list of environment variables to set in the container.
57
+
58
+ Each must have a name and either a value or value_from_secret
59
+ """
60
+
61
+ gpu_count: int
62
+ """GPUCount is the number of GPUs to allocate per container instance.
63
+
64
+ Defaults to 0 if not specified
65
+ """
66
+
67
+ health_check_path: str
68
+ """HealthCheckPath is the HTTP path for health checks (e.g., "/health").
69
+
70
+ If set, the platform will check this endpoint to determine container health
71
+ """
72
+
73
+ max_replicas: int
74
+ """
75
+ MaxReplicas is the maximum number of container instances that can be scaled up
76
+ to. If not set, will be set to MinReplicas
77
+ """
78
+
79
+ memory: float
80
+ """
81
+ Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
82
+ = 512MiB)
83
+ """
84
+
85
+ min_replicas: int
86
+ """MinReplicas is the minimum number of container instances to run.
87
+
88
+ Defaults to 1 if not specified
89
+ """
90
+
91
+ port: int
92
+ """
93
+ Port is the container port your application listens on (e.g., 8080 for web
94
+ servers). Required if your application serves traffic
95
+ """
96
+
97
+ storage: int
98
+ """
99
+ Storage is the amount of ephemeral disk storage to allocate per container
100
+ instance (e.g., 10 = 10GiB)
101
+ """
102
+
103
+ termination_grace_period_seconds: int
104
+ """
105
+ TerminationGracePeriodSeconds is the time in seconds to wait for graceful
106
+ shutdown before forcefully terminating the replica
107
+ """
108
+
109
+ volumes: Iterable[Volume]
110
+ """Volumes is a list of volume mounts to attach to the container.
111
+
112
+ Each mount must reference an existing volume by name
113
+ """
114
+
115
+
116
+ class EnvironmentVariable(TypedDict, total=False):
117
+ name: Required[str]
118
+ """Name is the environment variable name (e.g., "DATABASE_URL").
119
+
120
+ Must start with a letter or underscore, followed by letters, numbers, or
121
+ underscores
122
+ """
123
+
124
+ value: str
125
+ """Value is the plain text value for the environment variable.
126
+
127
+ Use this for non-sensitive values. Either Value or ValueFromSecret must be set,
128
+ but not both
129
+ """
130
+
131
+ value_from_secret: str
132
+ """ValueFromSecret references a secret by name or ID to use as the value.
133
+
134
+ Use this for sensitive values like API keys or passwords. Either Value or
135
+ ValueFromSecret must be set, but not both
136
+ """
137
+
138
+
139
+ class Volume(TypedDict, total=False):
140
+ mount_path: Required[str]
141
+ """
142
+ MountPath is the path in the container where the volume will be mounted (e.g.,
143
+ "/data")
144
+ """
145
+
146
+ name: Required[str]
147
+ """Name is the name of the volume to mount.
148
+
149
+ Must reference an existing volume by name or ID
150
+ """
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+
5
+ from ..._models import BaseModel
6
+ from .deployment import Deployment
7
+
8
+ __all__ = ["JigListResponse"]
9
+
10
+
11
+ class JigListResponse(BaseModel):
12
+ data: Optional[List[Deployment]] = None
13
+ """Data is the array of deployment items"""
14
+
15
+ object: Optional[str] = None
16
+ """Object is the type identifier for this response (always "list")"""
@@ -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 typing_extensions import TypedDict
6
+
7
+ __all__ = ["JigRetrieveLogsParams"]
8
+
9
+
10
+ class JigRetrieveLogsParams(TypedDict, total=False):
11
+ replica_id: str
12
+ """Replica ID to filter logs"""
@@ -0,0 +1,141 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Iterable
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from ..._types import SequenceNotStr
9
+
10
+ __all__ = ["JigUpdateParams", "EnvironmentVariable", "Volume"]
11
+
12
+
13
+ class JigUpdateParams(TypedDict, total=False):
14
+ args: SequenceNotStr[str]
15
+ """Args overrides the container's CMD.
16
+
17
+ Provide as an array of arguments (e.g., ["python", "app.py"])
18
+ """
19
+
20
+ autoscaling: Dict[str, str]
21
+ """Autoscaling configuration as key-value pairs.
22
+
23
+ Example: {"metric": "QueueBacklogPerWorker", "target": "10"} to scale based on
24
+ queue backlog
25
+ """
26
+
27
+ command: SequenceNotStr[str]
28
+ """Command overrides the container's ENTRYPOINT.
29
+
30
+ Provide as an array (e.g., ["/bin/sh", "-c"])
31
+ """
32
+
33
+ cpu: float
34
+ """
35
+ CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 =
36
+ 100 milli cores)
37
+ """
38
+
39
+ description: str
40
+ """Description is an optional human-readable description of your deployment"""
41
+
42
+ environment_variables: Iterable[EnvironmentVariable]
43
+ """EnvironmentVariables is a list of environment variables to set in the container.
44
+
45
+ This will replace all existing environment variables
46
+ """
47
+
48
+ gpu_count: int
49
+ """GPUCount is the number of GPUs to allocate per container instance"""
50
+
51
+ gpu_type: Literal["h100-80gb", " a100-80gb"]
52
+ """GPUType specifies the GPU hardware to use (e.g., "h100-80gb")"""
53
+
54
+ health_check_path: str
55
+ """HealthCheckPath is the HTTP path for health checks (e.g., "/health").
56
+
57
+ Set to empty string to disable health checks
58
+ """
59
+
60
+ image: str
61
+ """Image is the container image to deploy from registry.together.ai."""
62
+
63
+ max_replicas: int
64
+ """MaxReplicas is the maximum number of replicas that can be scaled up to."""
65
+
66
+ memory: float
67
+ """
68
+ Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5
69
+ = 512MiB)
70
+ """
71
+
72
+ min_replicas: int
73
+ """MinReplicas is the minimum number of replicas to run"""
74
+
75
+ name: str
76
+ """Name is the new unique identifier for your deployment.
77
+
78
+ Must contain only alphanumeric characters, underscores, or hyphens (1-100
79
+ characters)
80
+ """
81
+
82
+ port: int
83
+ """
84
+ Port is the container port your application listens on (e.g., 8080 for web
85
+ servers)
86
+ """
87
+
88
+ storage: int
89
+ """
90
+ Storage is the amount of ephemeral disk storage to allocate per container
91
+ instance (e.g., 10 = 10GiB)
92
+ """
93
+
94
+ termination_grace_period_seconds: int
95
+ """
96
+ TerminationGracePeriodSeconds is the time in seconds to wait for graceful
97
+ shutdown before forcefully terminating the replica
98
+ """
99
+
100
+ volumes: Iterable[Volume]
101
+ """Volumes is a list of volume mounts to attach to the container.
102
+
103
+ This will replace all existing volumes
104
+ """
105
+
106
+
107
+ class EnvironmentVariable(TypedDict, total=False):
108
+ name: Required[str]
109
+ """Name is the environment variable name (e.g., "DATABASE_URL").
110
+
111
+ Must start with a letter or underscore, followed by letters, numbers, or
112
+ underscores
113
+ """
114
+
115
+ value: str
116
+ """Value is the plain text value for the environment variable.
117
+
118
+ Use this for non-sensitive values. Either Value or ValueFromSecret must be set,
119
+ but not both
120
+ """
121
+
122
+ value_from_secret: str
123
+ """ValueFromSecret references a secret by name or ID to use as the value.
124
+
125
+ Use this for sensitive values like API keys or passwords. Either Value or
126
+ ValueFromSecret must be set, but not both
127
+ """
128
+
129
+
130
+ class Volume(TypedDict, total=False):
131
+ mount_path: Required[str]
132
+ """
133
+ MountPath is the path in the container where the volume will be mounted (e.g.,
134
+ "/data")
135
+ """
136
+
137
+ name: Required[str]
138
+ """Name is the name of the volume to mount.
139
+
140
+ Must reference an existing volume by name or ID
141
+ """
@@ -28,6 +28,7 @@ __all__ = [
28
28
  "MessageChatCompletionFunctionMessageParam",
29
29
  "FunctionCall",
30
30
  "FunctionCallName",
31
+ "Reasoning",
31
32
  "ResponseFormat",
32
33
  "ResponseFormatText",
33
34
  "ResponseFormatJsonSchema",
@@ -111,6 +112,8 @@ class CompletionCreateParamsBase(TypedDict, total=False):
111
112
  a model talking about new topics.
112
113
  """
113
114
 
115
+ reasoning: Reasoning
116
+
114
117
  reasoning_effort: Literal["low", "medium", "high"]
115
118
  """
116
119
  Controls the level of reasoning effort the model should apply when generating
@@ -314,6 +317,14 @@ class FunctionCallName(TypedDict, total=False):
314
317
  FunctionCall: TypeAlias = Union[Literal["none", "auto"], FunctionCallName]
315
318
 
316
319
 
320
+ class Reasoning(TypedDict, total=False):
321
+ enabled: bool
322
+ """
323
+ For models that support toggling reasoning functionality, this object can be
324
+ used to control that functionality.
325
+ """
326
+
327
+
317
328
  class ResponseFormatText(TypedDict, total=False):
318
329
  """Default response format. Used to generate text responses."""
319
330
 
@@ -4,10 +4,10 @@ from __future__ import annotations
4
4
 
5
5
  from typing_extensions import TypedDict
6
6
 
7
- __all__ = ["HardwareListParams"]
7
+ __all__ = ["EndpointListHardwareParams"]
8
8
 
9
9
 
10
- class HardwareListParams(TypedDict, total=False):
10
+ class EndpointListHardwareParams(TypedDict, total=False):
11
11
  model: str
12
12
  """Filter hardware configurations by model compatibility.
13
13
 
@@ -6,7 +6,7 @@ from typing_extensions import Literal
6
6
 
7
7
  from .._models import BaseModel
8
8
 
9
- __all__ = ["HardwareListResponse", "Data", "DataPricing", "DataSpecs", "DataAvailability"]
9
+ __all__ = ["EndpointListHardwareResponse", "Data", "DataPricing", "DataSpecs", "DataAvailability"]
10
10
 
11
11
 
12
12
  class DataPricing(BaseModel):
@@ -60,7 +60,7 @@ class Data(BaseModel):
60
60
  """Indicates the current availability status of a hardware configuration"""
61
61
 
62
62
 
63
- class HardwareListResponse(BaseModel):
63
+ class EndpointListHardwareResponse(BaseModel):
64
64
  data: List[Data]
65
65
 
66
66
  object: Literal["list"]
@@ -0,0 +1,5 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .upload_status_response import UploadStatusResponse as UploadStatusResponse
@@ -6,9 +6,9 @@ from typing_extensions import Literal
6
6
 
7
7
  from pydantic import Field as FieldInfo
8
8
 
9
- from .._models import BaseModel
9
+ from ..._models import BaseModel
10
10
 
11
- __all__ = ["JobRetrieveResponse", "Args", "StatusUpdate"]
11
+ __all__ = ["UploadStatusResponse", "Args", "StatusUpdate"]
12
12
 
13
13
 
14
14
  class Args(BaseModel):
@@ -27,7 +27,7 @@ class StatusUpdate(BaseModel):
27
27
  timestamp: datetime
28
28
 
29
29
 
30
- class JobRetrieveResponse(BaseModel):
30
+ class UploadStatusResponse(BaseModel):
31
31
  args: Args
32
32
 
33
33
  created_at: datetime
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: together
3
- Version: 2.0.0a17
3
+ Version: 2.0.0a19
4
4
  Summary: The official Python library for the together API
5
5
  Project-URL: Homepage, https://github.com/togethercomputer/together-py
6
6
  Project-URL: Repository, https://github.com/togethercomputer/together-py
@@ -32,11 +32,15 @@ Requires-Dist: pydantic<3,>=1.9.0
32
32
  Requires-Dist: rich>=13.7.1
33
33
  Requires-Dist: sniffio
34
34
  Requires-Dist: tabulate>=0.9.0
35
+ Requires-Dist: tomli>=2.0.0; python_version < '3.11'
35
36
  Requires-Dist: tqdm>=4.67.1
36
37
  Requires-Dist: types-pyyaml>=6.0.12.20250915
37
38
  Requires-Dist: types-tabulate>=0.9.0.20240106
38
39
  Requires-Dist: types-tqdm>=4.67.0.20250516
39
40
  Requires-Dist: typing-extensions<5,>=4.10
41
+ Provides-Extra: aiofiles
42
+ Requires-Dist: aiofiles>=25.0.0; extra == 'aiofiles'
43
+ Requires-Dist: types-aiofiles; extra == 'aiofiles'
40
44
  Provides-Extra: aiohttp
41
45
  Requires-Dist: aiohttp; extra == 'aiohttp'
42
46
  Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
@@ -235,20 +239,17 @@ from together import Together
235
239
 
236
240
  client = Together()
237
241
 
238
- cluster = client.beta.clusters.create(
239
- billing_type="RESERVED",
240
- cluster_name="cluster_name",
241
- driver_version="CUDA_12_5_555",
242
- gpu_type="H100_SXM",
243
- num_gpus=0,
244
- region="us-central-8",
245
- shared_volume={
246
- "region": "region",
247
- "size_tib": 0,
248
- "volume_name": "volume_name",
249
- },
242
+ chat_completion = client.chat.completions.create(
243
+ messages=[
244
+ {
245
+ "content": "content",
246
+ "role": "system",
247
+ }
248
+ ],
249
+ model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
250
+ reasoning={},
250
251
  )
251
- print(cluster.shared_volume)
252
+ print(chat_completion.reasoning)
252
253
  ```
253
254
 
254
255
  The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.