(fineTuning)
Manage fine-tuning jobs to tailor a model to your specific training data.
- createFineTuningJob - Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
-
listPaginatedFineTuningJobs - List your organization's fine-tuning jobs
-
retrieveFineTuningJob - Get info about a fine-tuning job.
-
listFineTuningEvents - Get status updates for a fine-tuning job.
-
cancelFineTuningJob - Immediately cancel a fine-tune job.
-
listFineTuningJobCheckpoints - List checkpoints for a fine-tuning job.
Creates a fine-tuning job which begins the process of creating a new model from a given dataset.
Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.createFineTuningJob({
model: "gpt-4o-mini",
trainingFile: "file-abc123",
validationFile: "file-abc123",
integrations: [
{
type: "wandb",
wandb: {
project: "my-wandb-project",
tags: [
"custom-tag",
],
},
},
],
seed: 42,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningCreateFineTuningJob } from "argot-open-ai/funcs/fineTuningCreateFineTuningJob.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningCreateFineTuningJob(argotOpenAi, {
model: "gpt-4o-mini",
trainingFile: "file-abc123",
validationFile: "file-abc123",
integrations: [
{
type: "wandb",
wandb: {
project: "my-wandb-project",
tags: [
"custom-tag",
],
},
},
],
seed: 42,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
components.CreateFineTuningJobRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.FineTuningJob>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
List your organization's fine-tuning jobs
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.listPaginatedFineTuningJobs({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningListPaginatedFineTuningJobs } from "argot-open-ai/funcs/fineTuningListPaginatedFineTuningJobs.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningListPaginatedFineTuningJobs(argotOpenAi, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListPaginatedFineTuningJobsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ListPaginatedFineTuningJobsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Get info about a fine-tuning job.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.retrieveFineTuningJob({
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningRetrieveFineTuningJob } from "argot-open-ai/funcs/fineTuningRetrieveFineTuningJob.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningRetrieveFineTuningJob(argotOpenAi, {
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.RetrieveFineTuningJobRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.FineTuningJob>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Get status updates for a fine-tuning job.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.listFineTuningEvents({
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningListFineTuningEvents } from "argot-open-ai/funcs/fineTuningListFineTuningEvents.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningListFineTuningEvents(argotOpenAi, {
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListFineTuningEventsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ListFineTuningJobEventsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Immediately cancel a fine-tune job.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.cancelFineTuningJob({
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningCancelFineTuningJob } from "argot-open-ai/funcs/fineTuningCancelFineTuningJob.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningCancelFineTuningJob(argotOpenAi, {
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CancelFineTuningJobRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.FineTuningJob>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
List checkpoints for a fine-tuning job.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.fineTuning.listFineTuningJobCheckpoints({
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { fineTuningListFineTuningJobCheckpoints } from "argot-open-ai/funcs/fineTuningListFineTuningJobCheckpoints.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await fineTuningListFineTuningJobCheckpoints(argotOpenAi, {
fineTuningJobId: "ft-AF1WoRqd3aJAHsqc9NY7iL8F",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListFineTuningJobCheckpointsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.ListFineTuningJobCheckpointsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |