Skip to content

Commit 8985d71

Browse files
stainless-app[bot]technillogueblainekastenjli-together
authored
release: 2.5.0 (#303)
* codegen metadata * fix(jig): use Together.get instead of Together._client.get so that registry errors are handled correctly (#302) * feat: Update llama 3.1 8b w/ qwen 3.5 9b * fix(pydantic): do not pass `by_alias` unless set * fix(deps): bump minimum typing-extensions version * chore(internal): tweak CI branches * fix(types): remove model enum constraint in chat completions * chore: Fix unit tests with recent model deprecations (#305) * Add random seed to finetuning requests (#293) * add random seed option * update to string * update description * convert type from str to int * removed deprecated model from tests * codegen metadata * feat(api): manual updates * feat(api): manual updates * feat(api): manual updates * release: 2.5.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: technillogue <technillogue@gmail.com> Co-authored-by: Blaine Kasten <blainekasten@gmail.com> Co-authored-by: Jasmine <jli@together.ai>
1 parent 86cee4c commit 8985d71

33 files changed

+392
-345
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: CI
22
on:
33
push:
4-
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
1012
pull_request:
1113
branches-ignore:
1214
- 'stl-preview-head/**'

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.4.0"
2+
".": "2.5.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-452048e531c558b879791ccc9788c3f3c23c50c808c909a6d95f47af360566a4.yml
3-
openapi_spec_hash: 11835b47ff4c2d1b4dbeed74c49908e1
4-
config_hash: b66198d27b4d5c152688ff6cccfdeab5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-31893d157d3c85caa1d8615b73a5fa431ea2cc126bd2410e0f84f3defd5c7dec.yml
3+
openapi_spec_hash: b652a4d504b4a3dbf585ab803b0f59fc
4+
config_hash: 52d213100a0ca1a4b2cdcd2718936b51

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 2.5.0 (2026-03-18)
4+
5+
Full Changelog: [v2.4.0...v2.5.0](https://github.com/togethercomputer/together-py/compare/v2.4.0...v2.5.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([9db2163](https://github.com/togethercomputer/together-py/commit/9db2163681520a95a54e03472ed6719abc40dc05))
10+
* **api:** manual updates ([a3436ea](https://github.com/togethercomputer/together-py/commit/a3436ea1f04273a0d91103cbd850136854389794))
11+
* **api:** manual updates ([ca7f97d](https://github.com/togethercomputer/together-py/commit/ca7f97de14718352cb990c281d3fa053e954fc42))
12+
* Update llama 3.1 8b w/ qwen 3.5 9b ([0680858](https://github.com/togethercomputer/together-py/commit/0680858c6f88e9e8ad72c76dc6d374e5074e12a2))
13+
14+
15+
### Bug Fixes
16+
17+
* **deps:** bump minimum typing-extensions version ([94c9632](https://github.com/togethercomputer/together-py/commit/94c96328c13e6955f777e4c6a3517744b84a1d23))
18+
* **jig:** use Together.get instead of Together._client.get so that registry errors are handled correctly ([#302](https://github.com/togethercomputer/together-py/issues/302)) ([aefd483](https://github.com/togethercomputer/together-py/commit/aefd483f7c335232fe798be6f92f52a960f70e88))
19+
* **pydantic:** do not pass `by_alias` unless set ([dca687e](https://github.com/togethercomputer/together-py/commit/dca687e39cf86f80cfd051e4e1596e8f54753968))
20+
* **types:** remove model enum constraint in chat completions ([c30e2a0](https://github.com/togethercomputer/together-py/commit/c30e2a0929888955fe7bae94f38a024ff0a601ed))
21+
22+
23+
### Chores
24+
25+
* Fix unit tests with recent model deprecations ([#305](https://github.com/togethercomputer/together-py/issues/305)) ([28902b4](https://github.com/togethercomputer/together-py/commit/28902b4f67f0f5158ea09589fe63de5e51efc9b7))
26+
* **internal:** tweak CI branches ([556c449](https://github.com/togethercomputer/together-py/commit/556c4491ed2c1ad39f4d587db2c25d94dd210192))
27+
328
## 2.4.0 (2026-03-11)
429

530
Full Changelog: [v2.3.2...v2.4.0](https://github.com/togethercomputer/together-py/compare/v2.3.2...v2.4.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ chat_completion = client.chat.completions.create(
193193
"role": "system",
194194
}
195195
],
196-
model="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
196+
model="model",
197197
reasoning={},
198198
)
199199
print(chat_completion.reasoning)

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Types:
117117
from together.types.chat import (
118118
ChatCompletion,
119119
ChatCompletionChunk,
120+
ChatCompletionPrompt,
120121
ChatCompletionStructuredMessageImageURL,
121122
ChatCompletionStructuredMessageText,
122123
ChatCompletionStructuredMessageVideoURL,

examples/fine_tuning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
client = Together()
66

77
file_id = "file-bf72b951-fa1a-41af-a152-fe385dca0201"
8-
fine_tune_model = client.fine_tuning.create(model="meta-llama/Meta-Llama-3-8B", training_file=file_id)
8+
fine_tune_model = client.fine_tuning.create(model="openai/gpt-oss-20b", training_file=file_id)
99
print(fine_tune_model)
1010

1111
fine_tune_id = fine_tune_model.id

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "together"
3-
version = "2.4.0"
3+
version = "2.5.0"
44
description = "The official Python library for the together API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -11,7 +11,7 @@ authors = [
1111
dependencies = [
1212
"httpx>=0.23.0, <1",
1313
"pydantic>=1.9.0, <3",
14-
"typing-extensions>=4.10, <5",
14+
"typing-extensions>=4.14, <5",
1515
"anyio>=3.5.0, <5",
1616
"distro>=1.7.0, <2",
1717
"sniffio",

requirements-dev.lock

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ execnet==2.1.2
4242
# via pytest-xdist
4343
filelock==3.19.1 ; python_full_version < '3.10'
4444
# via together
45-
filelock==3.20.3 ; python_full_version >= '3.10'
45+
filelock==3.25.2 ; python_full_version >= '3.10'
4646
# via together
4747
frozenlist==1.8.0
4848
# via
@@ -87,7 +87,7 @@ pathspec==1.0.3
8787
# via mypy
8888
pillow==11.3.0 ; python_full_version < '3.10'
8989
# via together
90-
pillow==12.1.0 ; python_full_version >= '3.10'
90+
pillow==12.1.1 ; python_full_version >= '3.10'
9191
# via together
9292
pluggy==1.6.0
9393
# via pytest
@@ -128,7 +128,9 @@ six==1.17.0 ; python_full_version < '3.10'
128128
# via python-dateutil
129129
sniffio==1.3.1
130130
# via together
131-
tabulate==0.9.0
131+
tabulate==0.9.0 ; python_full_version < '3.10'
132+
# via together
133+
tabulate==0.10.0 ; python_full_version >= '3.10'
132134
# via together
133135
time-machine==2.19.0 ; python_full_version < '3.10'
134136
time-machine==3.2.0 ; python_full_version >= '3.10'
@@ -143,9 +145,13 @@ types-pyyaml==6.0.12.20250915
143145
# via together
144146
types-requests==2.32.4.20260107
145147
# via types-tqdm
146-
types-tabulate==0.9.0.20241207
148+
types-tabulate==0.9.0.20241207 ; python_full_version < '3.10'
149+
# via together
150+
types-tabulate==0.10.0.20260308 ; python_full_version >= '3.10'
151+
# via together
152+
types-tqdm==4.67.3.20260205 ; python_full_version < '3.10'
147153
# via together
148-
types-tqdm==4.67.3.20260205
154+
types-tqdm==4.67.3.20260303 ; python_full_version >= '3.10'
149155
# via together
150156
typing-extensions==4.15.0
151157
# via

src/together/_compat.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
44
from datetime import date, datetime
5-
from typing_extensions import Self, Literal
5+
from typing_extensions import Self, Literal, TypedDict
66

77
import pydantic
88
from pydantic.fields import FieldInfo
@@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
131131
return model.model_dump_json(indent=indent)
132132

133133

134+
class _ModelDumpKwargs(TypedDict, total=False):
135+
by_alias: bool
136+
137+
134138
def model_dump(
135139
model: pydantic.BaseModel,
136140
*,
@@ -142,14 +146,17 @@ def model_dump(
142146
by_alias: bool | None = None,
143147
) -> dict[str, Any]:
144148
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
149+
kwargs: _ModelDumpKwargs = {}
150+
if by_alias is not None:
151+
kwargs["by_alias"] = by_alias
145152
return model.model_dump(
146153
mode=mode,
147154
exclude=exclude,
148155
exclude_unset=exclude_unset,
149156
exclude_defaults=exclude_defaults,
150157
# warnings are not supported in Pydantic v1
151158
warnings=True if PYDANTIC_V1 else warnings,
152-
by_alias=by_alias,
159+
**kwargs,
153160
)
154161
return cast(
155162
"dict[str, Any]",

0 commit comments

Comments
 (0)