From 99b172f6c74ed1fd50342b22da4494e200a4a5fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 16:05:15 +0000 Subject: [PATCH 1/7] docs: add more examples --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6b87b0b..b69b39db 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ import Together from 'together-ai'; const client = new Together(); const stream = await client.chat.completions.create({ - messages: [{ role: 'user', content: 'Say this is a test' }], + messages: [{ role: 'user', content: 'Say this is a test!' }], model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', stream: true, }); From 4a0271f78cecc05e137c6977238917fdf2bae381 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:07:46 +0000 Subject: [PATCH 2/7] feat: Support VLM finetuning --- .stats.yml | 4 ++-- src/resources/fine-tuning.ts | 30 +++++++++++++++++++++++++ tests/api-resources/fine-tuning.test.ts | 2 ++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 71d99e12..576b1352 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 45 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-817bdc0e9a5082575f07386056968f56af20cbc40cbbc716ab4b8c4ec9220b53.yml -openapi_spec_hash: 30b3f6d251dfd02bca8ffa3f755e7574 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-9deb17c2e61bacac1bf17741853c4e5e11059b85fc37538c284d36ce9973836f.yml +openapi_spec_hash: 2f3c2fb0f8a06225670b05fc19a60c23 config_hash: 9749f2f8998aa6b15452b2187ff675b9 diff --git a/src/resources/fine-tuning.ts b/src/resources/fine-tuning.ts index 5e7b54b4..90a5493d 100644 --- a/src/resources/fine-tuning.ts +++ b/src/resources/fine-tuning.ts @@ -247,6 +247,8 @@ export interface FinetuneResponse { model_output_path?: string; + multimodal_params?: FinetuneResponse.MultimodalParams; + n_checkpoints?: number; n_epochs?: number; @@ -319,6 +321,14 @@ export namespace FinetuneResponse { } } + export interface MultimodalParams { + /** + * Whether to train the vision encoder of the model. Only available for multimodal + * models. + */ + train_vision?: boolean; + } + /** * Progress information for a fine-tuning job */ @@ -1255,6 +1265,8 @@ export interface FineTuningCreateParams { */ max_grad_norm?: number; + multimodal_params?: FineTuningCreateParams.MultimodalParams; + /** * Number of intermediate model versions saved during training for evaluation */ @@ -1360,6 +1372,14 @@ export namespace FineTuningCreateParams { } } + export interface MultimodalParams { + /** + * Whether to train the vision encoder of the model. Only available for multimodal + * models. + */ + train_vision?: boolean; + } + export interface TrainingMethodSft { method: 'sft'; @@ -1443,6 +1463,8 @@ export interface FineTuningEstimatePriceParams { */ model?: string; + multimodal_params?: FineTuningEstimatePriceParams.MultimodalParams; + /** * Number of complete passes through the training dataset (higher values may * improve results but increase cost and risk of overfitting) @@ -1473,6 +1495,14 @@ export interface FineTuningEstimatePriceParams { } export namespace FineTuningEstimatePriceParams { + export interface MultimodalParams { + /** + * Whether to train the vision encoder of the model. Only available for multimodal + * models. + */ + train_vision?: boolean; + } + export interface TrainingMethodSft { method: 'sft'; diff --git a/tests/api-resources/fine-tuning.test.ts b/tests/api-resources/fine-tuning.test.ts index c03c77f0..43e151aa 100644 --- a/tests/api-resources/fine-tuning.test.ts +++ b/tests/api-resources/fine-tuning.test.ts @@ -32,6 +32,7 @@ describe('resource fineTuning', () => { learning_rate: 0, lr_scheduler: { lr_scheduler_type: 'linear', lr_scheduler_args: { min_lr_ratio: 0 } }, max_grad_norm: 0, + multimodal_params: { train_vision: true }, n_checkpoints: 0, n_epochs: 0, n_evals: 0, @@ -124,6 +125,7 @@ describe('resource fineTuning', () => { training_file: 'training_file', from_checkpoint: 'from_checkpoint', model: 'model', + multimodal_params: { train_vision: true }, n_epochs: 0, n_evals: 0, training_method: { method: 'sft', train_on_inputs: true }, From f595d105a9bade8b4ff62d3bd18e008e739d910e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Dec 2025 19:43:07 +0000 Subject: [PATCH 3/7] feat: VLM Support update --- .stats.yml | 4 ++-- src/resources/fine-tuning.ts | 10 ---------- tests/api-resources/fine-tuning.test.ts | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index 576b1352..f1fa1193 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 45 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-9deb17c2e61bacac1bf17741853c4e5e11059b85fc37538c284d36ce9973836f.yml -openapi_spec_hash: 2f3c2fb0f8a06225670b05fc19a60c23 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-a12a8f76dabc5f09bc2925b8d82b9d365c82b5eb5d183afcffd9f459dc058bcb.yml +openapi_spec_hash: 5d5efee2b3de68d1a572788125dbf77d config_hash: 9749f2f8998aa6b15452b2187ff675b9 diff --git a/src/resources/fine-tuning.ts b/src/resources/fine-tuning.ts index 90a5493d..a46216b3 100644 --- a/src/resources/fine-tuning.ts +++ b/src/resources/fine-tuning.ts @@ -1463,8 +1463,6 @@ export interface FineTuningEstimatePriceParams { */ model?: string; - multimodal_params?: FineTuningEstimatePriceParams.MultimodalParams; - /** * Number of complete passes through the training dataset (higher values may * improve results but increase cost and risk of overfitting) @@ -1495,14 +1493,6 @@ export interface FineTuningEstimatePriceParams { } export namespace FineTuningEstimatePriceParams { - export interface MultimodalParams { - /** - * Whether to train the vision encoder of the model. Only available for multimodal - * models. - */ - train_vision?: boolean; - } - export interface TrainingMethodSft { method: 'sft'; diff --git a/tests/api-resources/fine-tuning.test.ts b/tests/api-resources/fine-tuning.test.ts index 43e151aa..f65ea7f8 100644 --- a/tests/api-resources/fine-tuning.test.ts +++ b/tests/api-resources/fine-tuning.test.ts @@ -125,7 +125,6 @@ describe('resource fineTuning', () => { training_file: 'training_file', from_checkpoint: 'from_checkpoint', model: 'model', - multimodal_params: { train_vision: true }, n_epochs: 0, n_evals: 0, training_method: { method: 'sft', train_on_inputs: true }, From ebd27f699339a11370d08b33efc0ae8db1641b80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 04:08:41 +0000 Subject: [PATCH 4/7] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 4b55f787..4255f768 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Together + Copyright 2026 Together Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 6b244eecf98a507718759113d7d1372463a4230f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:04:18 +0000 Subject: [PATCH 5/7] chore: break long lines in snippets into multiline --- tests/api-resources/chat/completions.test.ts | 8 ++- .../code-interpreter/code-interpreter.test.ts | 8 ++- tests/api-resources/endpoints.test.ts | 6 +- tests/api-resources/evals.test.ts | 6 +- tests/api-resources/fine-tuning.test.ts | 5 +- tests/index.test.ts | 60 +++++++++++++++---- 6 files changed, 78 insertions(+), 15 deletions(-) diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 0f546815..63815429 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -24,7 +24,13 @@ describe('resource completions', () => { test('create: required and optional params', async () => { const response = await client.chat.completions.create({ - messages: [{ content: 'content', role: 'system', name: 'name' }], + messages: [ + { + content: 'content', + role: 'system', + name: 'name', + }, + ], model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', context_length_exceeded_behavior: 'truncate', echo: true, diff --git a/tests/api-resources/code-interpreter/code-interpreter.test.ts b/tests/api-resources/code-interpreter/code-interpreter.test.ts index c1c4dbfd..ac78df53 100644 --- a/tests/api-resources/code-interpreter/code-interpreter.test.ts +++ b/tests/api-resources/code-interpreter/code-interpreter.test.ts @@ -28,7 +28,13 @@ describe('resource codeInterpreter', () => { const response = await client.codeInterpreter.execute({ code: "print('Hello, world!')", language: 'python', - files: [{ content: 'content', encoding: 'string', name: 'name' }], + files: [ + { + content: 'content', + encoding: 'string', + name: 'name', + }, + ], session_id: 'ses_abcDEF123', }); }); diff --git a/tests/api-resources/endpoints.test.ts b/tests/api-resources/endpoints.test.ts index db10e775..9b17963d 100644 --- a/tests/api-resources/endpoints.test.ts +++ b/tests/api-resources/endpoints.test.ts @@ -74,7 +74,11 @@ describe('resource endpoints', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( client.endpoints.list( - { mine: true, type: 'dedicated', usage_type: 'on-demand' }, + { + mine: true, + type: 'dedicated', + usage_type: 'on-demand', + }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Together.NotFoundError); diff --git a/tests/api-resources/evals.test.ts b/tests/api-resources/evals.test.ts index 2b1992a4..2be0b661 100644 --- a/tests/api-resources/evals.test.ts +++ b/tests/api-resources/evals.test.ts @@ -76,7 +76,11 @@ describe('resource evals', () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( client.evals.list( - { limit: 0, status: 'status', userId: 'userId' }, + { + limit: 0, + status: 'status', + userId: 'userId', + }, { path: '/_stainless_unknown_path' }, ), ).rejects.toThrow(Together.NotFoundError); diff --git a/tests/api-resources/fine-tuning.test.ts b/tests/api-resources/fine-tuning.test.ts index f65ea7f8..a609cae7 100644 --- a/tests/api-resources/fine-tuning.test.ts +++ b/tests/api-resources/fine-tuning.test.ts @@ -30,7 +30,10 @@ describe('resource fineTuning', () => { hf_model_revision: 'hf_model_revision', hf_output_repo_name: 'hf_output_repo_name', learning_rate: 0, - lr_scheduler: { lr_scheduler_type: 'linear', lr_scheduler_args: { min_lr_ratio: 0 } }, + lr_scheduler: { + lr_scheduler_type: 'linear', + lr_scheduler_args: { min_lr_ratio: 0 }, + }, max_grad_norm: 0, multimodal_params: { train_vision: true }, n_checkpoints: 0, diff --git a/tests/index.test.ts b/tests/index.test.ts index d244a513..48e9d068 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -87,7 +87,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new Together({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new Together({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).toHaveBeenCalled(); @@ -107,7 +111,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new Together({ logger: logger, logLevel: 'info', apiKey: 'My API Key' }); + const client = new Together({ + logger: logger, + logLevel: 'info', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -157,7 +165,11 @@ describe('instantiate client', () => { }; process.env['TOGETHER_LOG'] = 'debug'; - const client = new Together({ logger: logger, logLevel: 'off', apiKey: 'My API Key' }); + const client = new Together({ + logger: logger, + logLevel: 'off', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -173,7 +185,11 @@ describe('instantiate client', () => { }; process.env['TOGETHER_LOG'] = 'not a log level'; - const client = new Together({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new Together({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); expect(client.logLevel).toBe('debug'); expect(warnMock).not.toHaveBeenCalled(); }); @@ -349,7 +365,11 @@ describe('instantiate client', () => { describe('withOptions', () => { test('creates a new client with overridden options', async () => { - const client = new Together({ baseURL: 'http://localhost:5000/', maxRetries: 3, apiKey: 'My API Key' }); + const client = new Together({ + baseURL: 'http://localhost:5000/', + maxRetries: 3, + apiKey: 'My API Key', + }); const newClient = client.withOptions({ maxRetries: 5, @@ -389,7 +409,11 @@ describe('instantiate client', () => { }); test('respects runtime property changes when creating new client', () => { - const client = new Together({ baseURL: 'http://localhost:5000/', timeout: 1000, apiKey: 'My API Key' }); + const client = new Together({ + baseURL: 'http://localhost:5000/', + timeout: 1000, + apiKey: 'My API Key', + }); // Modify the client properties directly after creation client.baseURL = 'http://localhost:6000/'; @@ -535,7 +559,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Together({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new Together({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -565,7 +593,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Together({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Together({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); @@ -589,7 +621,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Together({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Together({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ @@ -651,7 +687,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Together({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Together({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ From 137e09b3f4d4bbf459d6c1e5ebbbcee0df60da51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:11:15 +0000 Subject: [PATCH 6/7] feat: Add compliance and chat_template_kwargs to chat completions spec --- .stats.yml | 4 ++-- src/resources/chat/completions.ts | 4 ++++ tests/api-resources/chat/completions.test.ts | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f1fa1193..52b8a0e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 45 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-a12a8f76dabc5f09bc2925b8d82b9d365c82b5eb5d183afcffd9f459dc058bcb.yml -openapi_spec_hash: 5d5efee2b3de68d1a572788125dbf77d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-5bf4a0ec441254dfa07138a49ee44a8b84696db879c4d4df73ba836ba7a51d62.yml +openapi_spec_hash: f602dfd1aaac78f149c1dbe352b7b7e0 config_hash: 9749f2f8998aa6b15452b2187ff675b9 diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index 8bc7be79..c1410c26 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -328,6 +328,10 @@ export interface CompletionCreateParamsBase { | 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo' | (string & {}); + chat_template_kwargs?: unknown; + + compliance?: 'hipaa'; + /** * Defined the behavior of the API when max_tokens exceed the maximum context * length of the model. When set to 'error', API will return 400 with appropriate diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 63815429..b43139e4 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -32,6 +32,8 @@ describe('resource completions', () => { }, ], model: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', + chat_template_kwargs: {}, + compliance: 'hipaa', context_length_exceeded_behavior: 'truncate', echo: true, frequency_penalty: 0, From 3ad79f89dead9fd1e877bd7cdecedbaa60d87e3f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:11:35 +0000 Subject: [PATCH 7/7] release: 0.35.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 21 +++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8878352c..3a39fd8c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.34.0" + ".": "0.35.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 665836e8..b9d624ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 0.35.0 (2026-01-06) + +Full Changelog: [v0.34.0...v0.35.0](https://github.com/togethercomputer/together-typescript/compare/v0.34.0...v0.35.0) + +### Features + +* Add compliance and chat_template_kwargs to chat completions spec ([137e09b](https://github.com/togethercomputer/together-typescript/commit/137e09b3f4d4bbf459d6c1e5ebbbcee0df60da51)) +* Support VLM finetuning ([4a0271f](https://github.com/togethercomputer/together-typescript/commit/4a0271f78cecc05e137c6977238917fdf2bae381)) +* VLM Support update ([f595d10](https://github.com/togethercomputer/together-typescript/commit/f595d105a9bade8b4ff62d3bd18e008e739d910e)) + + +### Chores + +* break long lines in snippets into multiline ([6b244ee](https://github.com/togethercomputer/together-typescript/commit/6b244eecf98a507718759113d7d1372463a4230f)) +* **internal:** codegen related update ([ebd27f6](https://github.com/togethercomputer/together-typescript/commit/ebd27f699339a11370d08b33efc0ae8db1641b80)) + + +### Documentation + +* add more examples ([99b172f](https://github.com/togethercomputer/together-typescript/commit/99b172f6c74ed1fd50342b22da4494e200a4a5fc)) + ## 0.34.0 (2025-12-16) Full Changelog: [v0.33.0...v0.34.0](https://github.com/togethercomputer/together-typescript/compare/v0.33.0...v0.34.0) diff --git a/package.json b/package.json index a9899037..50474016 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "together-ai", - "version": "0.34.0", + "version": "0.35.0", "description": "The official TypeScript library for the Together API", "author": "Together ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 48199984..3f1d4329 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.34.0'; // x-release-please-version +export const VERSION = '0.35.0'; // x-release-please-version