Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69c334c
fix: unbounded read into memory in upload path - ENG-89831 (#399)
narasul Jun 22, 2026
38511c9
MOSH-3014: Update CLI for early stopping (#405)
jli-together Jun 22, 2026
e4b9e66
release: 2.17.0 (#404)
github-actions[bot] Jun 22, 2026
83c5119
Merge pull request #42 from togethercomputer/stlc/from-prod
blainekasten Jun 22, 2026
34052ce
feat: add /v1/whoami endpoint to OpenAPI spec
stlc-workflow-app[bot] Jun 23, 2026
657f622
docs(adapters): align endpoint adapter code samples with the SDK
stlc-workflow-app[bot] Jun 23, 2026
f143789
Merge branch 'main' into stlc/from-prod
blainekasten Jun 24, 2026
0b7ba07
Merge pull request #43 from togethercomputer/stlc/from-prod
blainekasten Jun 24, 2026
2c08a3f
Build SDK
stlc-workflow-app[bot] Jun 24, 2026
faa9ef8
Sync RL attach-only training session OpenAPI
stlc-workflow-app[bot] Jun 24, 2026
4b11539
chore: fix yaml
stlc-workflow-app[bot] Jun 24, 2026
5a7e1a0
chore: Clarify warning messages on unavailable price estimation for f…
sadreamer Jun 24, 2026
cac1f18
feat(cli): expose remediation approval mode (#418)
cursor[bot] Jun 24, 2026
03fa99b
release: 2.19.0 (#419)
github-actions[bot] Jun 24, 2026
39e72f7
Build SDK
stlc-workflow-app[bot] Jun 24, 2026
618c8ac
feat: expose GPU cluster reserved counts
stlc-workflow-app[bot] Jun 25, 2026
52a22f8
Sync fine-tune public OpenAPI schema
stlc-workflow-app[bot] Jun 25, 2026
097409a
Merge branch 'main' into stlc/from-prod
blainekasten Jun 26, 2026
00fb6e9
Merge pull request #46 from togethercomputer/stlc/from-prod
blainekasten Jun 26, 2026
0fe1eaa
Build SDK
stlc-workflow-app[bot] Jun 26, 2026
a1a246a
feat(openapi): sync RL model resources stop API
stlc-workflow-app[bot] Jun 26, 2026
b7c63c9
internal: Ensure CI runs unit tests (#49)
blainekasten Jun 29, 2026
78f81c0
feat: Add early_stopping params to fine_tuning.create() (#425)
artek0chumak Jun 29, 2026
dfab128
release: 2.21.0 (#427)
github-actions[bot] Jun 29, 2026
b2eeb1c
Build SDK
stlc-workflow-app[bot] Jun 29, 2026
8d6afbe
feart: Add queue clear method
stlc-workflow-app[bot] Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,43 @@ jobs:

- name: Run build
run: uv build

test-others:
timeout-minutes: 10
name: test-others
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras

- name: Run tests
env:
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
run: './scripts/test --ignore=tests/integration'

test-integration:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: test-integration
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras

- name: Run tests
env:
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
run: './scripts/test tests/integration'
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.20.0"
".": "2.21.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 85
configured_endpoints: 86
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.21.0](https://github.com/togethercomputer/together-py/compare/v2.20.0...v2.21.0) (2026-06-29)


### Features

* Add early_stopping params to fine_tuning.create() ([#425](https://github.com/togethercomputer/together-py/issues/425)) ([74a793c](https://github.com/togethercomputer/together-py/commit/74a793c2415cdb82453906195d06c4e71e06296c))

## [2.20.0](https://github.com/togethercomputer/together-py/compare/v2.19.0...v2.20.0) (2026-06-26)


Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Types:
from together.types.beta.jig import (
QueueRetrieveResponse,
QueueCancelResponse,
QueueClearResponse,
QueueMetricsResponse,
QueueSubmitResponse,
)
Expand All @@ -46,6 +47,7 @@ Methods:

- <code title="get /queue/status">client.beta.jig.queue.<a href="./src/together/resources/beta/jig/queue.py">retrieve</a>(\*\*<a href="src/together/types/beta/jig/queue_retrieve_params.py">params</a>) -> <a href="./src/together/types/beta/jig/queue_retrieve_response.py">QueueRetrieveResponse</a></code>
- <code title="post /queue/cancel">client.beta.jig.queue.<a href="./src/together/resources/beta/jig/queue.py">cancel</a>(\*\*<a href="src/together/types/beta/jig/queue_cancel_params.py">params</a>) -> <a href="./src/together/types/beta/jig/queue_cancel_response.py">QueueCancelResponse</a></code>
- <code title="post /queue/clear">client.beta.jig.queue.<a href="./src/together/resources/beta/jig/queue.py">clear</a>(\*\*<a href="src/together/types/beta/jig/queue_clear_params.py">params</a>) -> <a href="./src/together/types/beta/jig/queue_clear_response.py">QueueClearResponse</a></code>
- <code title="get /queue/metrics">client.beta.jig.queue.<a href="./src/together/resources/beta/jig/queue.py">metrics</a>(\*\*<a href="src/together/types/beta/jig/queue_metrics_params.py">params</a>) -> <a href="./src/together/types/beta/jig/queue_metrics_response.py">QueueMetricsResponse</a></code>
- <code title="post /queue/submit">client.beta.jig.queue.<a href="./src/together/resources/beta/jig/queue.py">submit</a>(\*\*<a href="src/together/types/beta/jig/queue_submit_params.py">params</a>) -> <a href="./src/together/types/beta/jig/queue_submit_response.py">QueueSubmitResponse</a></code>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "together"
version = "2.20.0"
version = "2.21.0"
description = "The official Python library for the together API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/together/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "together"
__version__ = "2.20.0" # x-release-please-version
__version__ = "2.21.0" # x-release-please-version
93 changes: 92 additions & 1 deletion src/together/resources/beta/jig/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
async_to_streamed_response_wrapper,
)
from ...._base_client import make_request_options
from ....types.beta.jig import queue_cancel_params, queue_submit_params, queue_metrics_params, queue_retrieve_params
from ....types.beta.jig import (
queue_clear_params,
queue_cancel_params,
queue_submit_params,
queue_metrics_params,
queue_retrieve_params,
)
from ....types.beta.jig.queue_clear_response import QueueClearResponse
from ....types.beta.jig.queue_cancel_response import QueueCancelResponse
from ....types.beta.jig.queue_submit_response import QueueSubmitResponse
from ....types.beta.jig.queue_metrics_response import QueueMetricsResponse
Expand Down Expand Up @@ -140,6 +147,42 @@ def cancel(
cast_to=QueueCancelResponse,
)

def clear(
self,
*,
model: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> QueueClearResponse:
"""Cancel all pending jobs for the given model.

Running jobs are left untouched.
Returns the number of jobs that were canceled.

Args:
model: Model identifier whose pending jobs should be canceled

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/queue/clear",
body=maybe_transform({"model": model}, queue_clear_params.QueueClearParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QueueClearResponse,
)

def metrics(
self,
*,
Expand Down Expand Up @@ -350,6 +393,42 @@ async def cancel(
cast_to=QueueCancelResponse,
)

async def clear(
self,
*,
model: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> QueueClearResponse:
"""Cancel all pending jobs for the given model.

Running jobs are left untouched.
Returns the number of jobs that were canceled.

Args:
model: Model identifier whose pending jobs should be canceled

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/queue/clear",
body=await async_maybe_transform({"model": model}, queue_clear_params.QueueClearParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=QueueClearResponse,
)

async def metrics(
self,
*,
Expand Down Expand Up @@ -456,6 +535,9 @@ def __init__(self, queue: QueueResource) -> None:
self.cancel = to_raw_response_wrapper(
queue.cancel,
)
self.clear = to_raw_response_wrapper(
queue.clear,
)
self.metrics = to_raw_response_wrapper(
queue.metrics,
)
Expand All @@ -474,6 +556,9 @@ def __init__(self, queue: AsyncQueueResource) -> None:
self.cancel = async_to_raw_response_wrapper(
queue.cancel,
)
self.clear = async_to_raw_response_wrapper(
queue.clear,
)
self.metrics = async_to_raw_response_wrapper(
queue.metrics,
)
Expand All @@ -492,6 +577,9 @@ def __init__(self, queue: QueueResource) -> None:
self.cancel = to_streamed_response_wrapper(
queue.cancel,
)
self.clear = to_streamed_response_wrapper(
queue.clear,
)
self.metrics = to_streamed_response_wrapper(
queue.metrics,
)
Expand All @@ -510,6 +598,9 @@ def __init__(self, queue: AsyncQueueResource) -> None:
self.cancel = async_to_streamed_response_wrapper(
queue.cancel,
)
self.clear = async_to_streamed_response_wrapper(
queue.clear,
)
self.metrics = async_to_streamed_response_wrapper(
queue.metrics,
)
Expand Down
34 changes: 34 additions & 0 deletions src/together/resources/fine_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def create(
wandb_name: str | None = None,
wandb_entity: str | None = None,
random_seed: int | None = None,
early_stopping_enabled: bool = False,
early_stopping_patience: int | None = None,
early_stopping_min_delta: float | None = None,
early_stopping_warmup_evals: int | None = None,
verbose: bool = False,
model_limits: FinetuneTrainingLimits | None = None,
train_on_inputs: bool | Literal["auto"] | None = None,
Expand Down Expand Up @@ -173,6 +177,15 @@ def create(
random_seed (int, optional): Random seed for reproducible training (e.g. 42). When set, the same seed produces
the same run (e.g. data shuffle, init). If not provided (None), the server uses its default seed (42).
Defaults to None.
early_stopping_enabled (bool, optional): Stop training early when validation eval_loss stops improving.
Requires a validation_file, and n_evals must be at least
early_stopping_patience + early_stopping_warmup_evals + 1. Defaults to False.
early_stopping_patience (int, optional): Consecutive non-improving evals to tolerate before stopping.
Only applies when early_stopping_enabled is True. Defaults to None (server default 2).
early_stopping_min_delta (float, optional): Minimum eval_loss decrease to count as an improvement.
Only applies when early_stopping_enabled is True. Defaults to None (server default 0.0).
early_stopping_warmup_evals (int, optional): Initial evals to skip before counting patience.
Only applies when early_stopping_enabled is True. Defaults to None (server default 1).
verbose (bool, optional): whether to print the job parameters before submitting a request.
Defaults to False.
model_limits (FinetuneTrainingLimits, optional): Limits for the hyperparameters the model in Fine-tuning.
Expand Down Expand Up @@ -248,6 +261,10 @@ def create(
wandb_name=wandb_name,
wandb_entity=wandb_entity,
random_seed=random_seed,
early_stopping_enabled=early_stopping_enabled,
early_stopping_patience=early_stopping_patience,
early_stopping_min_delta=early_stopping_min_delta,
early_stopping_warmup_evals=early_stopping_warmup_evals,
train_on_inputs=train_on_inputs,
training_method=training_method,
dpo_beta=dpo_beta,
Expand Down Expand Up @@ -750,6 +767,10 @@ async def create(
wandb_name: str | None = None,
wandb_entity: str | None = None,
random_seed: int | None = None,
early_stopping_enabled: bool = False,
early_stopping_patience: int | None = None,
early_stopping_min_delta: float | None = None,
early_stopping_warmup_evals: int | None = None,
verbose: bool = False,
model_limits: FinetuneTrainingLimits | None = None,
train_on_inputs: bool | Literal["auto"] | None = None,
Expand Down Expand Up @@ -807,6 +828,15 @@ async def create(
random_seed (int, optional): Random seed for reproducible training (e.g. 42). When set, the same seed produces
the same run (e.g. data shuffle, init). If not provided (None), the server uses its default seed (42).
Defaults to None.
early_stopping_enabled (bool, optional): Stop training early when validation eval_loss stops improving.
Requires a validation_file, and n_evals must be at least
early_stopping_patience + early_stopping_warmup_evals + 1. Defaults to False.
early_stopping_patience (int, optional): Consecutive non-improving evals to tolerate before stopping.
Only applies when early_stopping_enabled is True. Defaults to None (server default 2).
early_stopping_min_delta (float, optional): Minimum eval_loss decrease to count as an improvement.
Only applies when early_stopping_enabled is True. Defaults to None (server default 0.0).
early_stopping_warmup_evals (int, optional): Initial evals to skip before counting patience.
Only applies when early_stopping_enabled is True. Defaults to None (server default 1).
verbose (bool, optional): whether to print the job parameters before submitting a request.
Defaults to False.
model_limits (FinetuneTrainingLimits, optional): Limits for the hyperparameters the model in Fine-tuning.
Expand Down Expand Up @@ -882,6 +912,10 @@ async def create(
wandb_name=wandb_name,
wandb_entity=wandb_entity,
random_seed=random_seed,
early_stopping_enabled=early_stopping_enabled,
early_stopping_patience=early_stopping_patience,
early_stopping_min_delta=early_stopping_min_delta,
early_stopping_warmup_evals=early_stopping_warmup_evals,
train_on_inputs=train_on_inputs,
training_method=training_method,
dpo_beta=dpo_beta,
Expand Down
33 changes: 33 additions & 0 deletions src/together/types/beta/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"AddOnConfig",
"AddOnConfigDashboard",
"AddOnConfigIngress",
"AddOnConfigTorchpass",
"AddOnState",
"AddOnStateDashboard",
"AddOnStateIngress",
"AddOnStateTorchpass",
"ControlPlaneNode",
"ControlPlaneNodePhaseTransition",
"GPUWorkerNode",
Expand All @@ -41,11 +43,23 @@ class AddOnConfigIngress(BaseModel):
enabled: Optional[bool] = None


class AddOnConfigTorchpass(BaseModel):
"""Configuration for the Model Aware TorchPass add-on."""

enabled: Optional[bool] = None
"""Whether to enable the Model Aware TorchPass add-on."""


class AddOnConfig(BaseModel):
"""Configuration for a cluster add-on."""

dashboard: Optional[AddOnConfigDashboard] = None

ingress: Optional[AddOnConfigIngress] = None

torchpass: Optional[AddOnConfigTorchpass] = None
"""Configuration for the Model Aware TorchPass add-on."""


class AddOnStateDashboard(BaseModel):
pass
Expand All @@ -55,22 +69,35 @@ class AddOnStateIngress(BaseModel):
pass


class AddOnStateTorchpass(BaseModel):
"""State for the Model Aware TorchPass add-on."""

pass


class AddOnState(BaseModel):
"""State for a cluster add-on."""

dashboard: Optional[AddOnStateDashboard] = None

ingress: Optional[AddOnStateIngress] = None

torchpass: Optional[AddOnStateTorchpass] = None
"""State for the Model Aware TorchPass add-on."""


class AddOn(BaseModel):
"""AddOnInfo is returned in cluster responses and add-on CRUD operations."""

add_on_type: str

config: AddOnConfig
"""Configuration for a cluster add-on."""

name: str

state: AddOnState
"""State for a cluster add-on."""


class ControlPlaneNodePhaseTransition(BaseModel):
Expand Down Expand Up @@ -291,6 +318,12 @@ class ClusterConfig(BaseModel):
init, extra conf).
"""

ssh_ca_enabled: Optional[bool] = None
"""
Whether this cluster uses a per-cluster SSH certificate authority for
OIDC-signed SSH access.
"""


class DeletedGPUWorkerNodePhaseTransition(BaseModel):
phase: Literal[
Expand Down
Loading