v3

OpenAPI 3.1.0MIT2026-07-31192456807.8 KB
Fine-tuning

Create job

Create a fine-tuning job with the provided model and training data.

post/fine-tunes

Request body

training_filestring required

File-ID of a training file uploaded to the Together API

validation_filestring

File-ID of a validation file uploaded to the Together API

packingboolean

Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.

max_seq_lengthinteger

Maximum sequence length to use for training. If not specified, the maximum allowed for the model and training method will be used.

modelstring required

Name of the base model to run fine-tune job on

n_epochsinteger

Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting)

n_checkpointsinteger

Number of intermediate model versions saved during training for evaluation

n_evalsinteger

Number of evaluations to be run on a given validation set during training

gradient_accumulation_stepsinteger

Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used.

learning_ratenumber

Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)

warmup_rationumber

The percent of steps at the start of training to linearly increase the learning rate.

max_grad_normnumber

Max gradient norm to be used for gradient clipping. Set to 0 to disable.

weight_decaynumber

Weight decay. Regularization parameter for the optimizer.

random_seedinteger nullable

Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42).

early_stopping_enabledboolean

Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.

early_stopping_patienceinteger

Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.

early_stopping_min_deltanumber

Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.

early_stopping_warmup_evalsinteger nullable

Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.

suffixstring

Suffix to add to your fine-tuned model name. Must be at most 64 characters long.

wandb_api_keystring

Integration key for tracking experiments and model metrics on W&B platform

wandb_base_urlstring

The base URL of a dedicated Weights & Biases instance.

wandb_project_namestring

The Weights & Biases project for your run. If not specified, uses together as the project name.

wandb_namestring

The Weights & Biases name for your run.

wandb_entitystring

The Weights & Biases entity for your run.

train_on_inputsboolean

Whether to mask user messages in conversational data or prompts in instruction data.

from_checkpointstring

The checkpoint identifier to continue training from a previous fine-tuning job. Format is {$JOB_ID} or {$OUTPUT_MODEL_NAME} or {$JOB_ID}:{$STEP} or {$OUTPUT_MODEL_NAME}:{$STEP}. The step value is optional; without it, uses the final checkpoint.

from_hf_modelstring

The Hugging Face Hub repo to start training from. Should be as close as possible to the base model (specified by the model argument) in terms of architecture and size.

hf_model_revisionstring

The revision of the Hugging Face Hub model to continue training from. E.g., hf_model_revision=main (default, used if the argument is not provided) or hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).

hf_api_tokenstring

The API token for the Hugging Face Hub.

hf_output_repo_namestring

The name of the Hugging Face repository to upload the fine-tuned model to.

Response

Fine-tuning job initiated successfully

idstring required

Unique identifier for the fine-tune job

status'pending' | 'queued' | 'running' | 'compressing' | 'uploading' | 'cancel_requested' | 'cancelled' | 'error' | 'completed' required
created_atstring date-time required

Creation timestamp of the fine-tune job

updated_atstring date-time required

Last update timestamp of the fine-tune job

started_atstring date-time

Start timestamp of the current stage of the fine-tune job

user_idstring required

ID of the user who created the fine-tune job.

owner_addressstring

Owner address information

total_priceinteger

Total price for the fine-tuning job

token_countinteger

Count of tokens processed

training_filestring

File-ID of the training file

validation_filestring

File-ID of the validation file

packingboolean

Whether sequence packing is being used for training.

max_seq_lengthinteger

Maximum sequence length to use for training. If not specified, uses the maximum allowed for the model and training method.

modelstring

Base model used for fine-tuning

model_output_namestring
suffixstring

Suffix added to the fine-tuned model name

n_epochsinteger

Number of training epochs

n_evalsinteger

Number of evaluations during training

n_checkpointsinteger

Number of checkpoints saved during training

batch_sizeinteger

Batch size used for training

learning_ratenumber

Learning rate used for training

warmup_rationumber

Ratio of warmup steps

max_grad_normnumber

Maximum gradient norm for clipping

weight_decaynumber

Weight decay value used

random_seedinteger nullable

Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded.

wandb_project_namestring

Weights & Biases project name

wandb_namestring

Weights & Biases run name

from_checkpointstring

Checkpoint used to continue training

from_hf_modelstring

Hugging Face Hub repo to start training from

hf_model_revisionstring

The revision of the Hugging Face Hub model to continue training from

early_stoppedboolean

Whether the early-stopping criterion triggered.

early_stopping_best_stepinteger

Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step.

early_stopping_best_metricnumber nullable

Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded.

Example response

{
  "id": "ft-01234567890123456789",
  "status": "completed",
  "created_at": "2023-05-17T17:35:45.123Z",
  "updated_at": "2023-05-17T18:46:23.456Z",
  "user_id": "user_789xyz012",
  "owner_address": "user@example.com",
  "total_price": 1500,
  "token_count": 850000,
  "events": [],
  "model": "meta-llama/Llama-2-7b-hf",
  "model_output_name": "mynamespace/meta-llama/Llama-2-7b-hf-32162631",
  "n_epochs": 3,
  "training_file": "file-01234567890123456789",
  "wandb_project_name": "my-finetune-project"
}