Create job
Create a fine-tuning job with the provided model and training data.
Request body
File-ID of a training file uploaded to the Together API
File-ID of a validation file uploaded to the Together API
Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
Maximum sequence length to use for training. If not specified, the maximum allowed for the model and training method will be used.
Name of the base model to run fine-tune job on
Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting)
Number of intermediate model versions saved during training for evaluation
Number of evaluations to be run on a given validation set during training
Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used.
Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
The percent of steps at the start of training to linearly increase the learning rate.
Max gradient norm to be used for gradient clipping. Set to 0 to disable.
Weight decay. Regularization parameter for the optimizer.
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).
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.
Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
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.
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.
Suffix to add to your fine-tuned model name. Must be at most 64 characters long.
Integration key for tracking experiments and model metrics on W&B platform
The base URL of a dedicated Weights & Biases instance.
The Weights & Biases project for your run. If not specified, uses together as the project name.
The Weights & Biases name for your run.
The Weights & Biases entity for your run.
Whether to mask user messages in conversational data or prompts in instruction data.
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.
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.
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).
The API token for the Hugging Face Hub.
The name of the Hugging Face repository to upload the fine-tuned model to.
Response
Fine-tuning job initiated successfully
Unique identifier for the fine-tune job
Creation timestamp of the fine-tune job
Last update timestamp of the fine-tune job
Start timestamp of the current stage of the fine-tune job
ID of the user who created the fine-tune job.
Owner address information
Total price for the fine-tuning job
Count of tokens processed
File-ID of the training file
File-ID of the validation file
Whether sequence packing is being used for training.
Maximum sequence length to use for training. If not specified, uses the maximum allowed for the model and training method.
Base model used for fine-tuning
Suffix added to the fine-tuned model name
Number of training epochs
Number of evaluations during training
Number of checkpoints saved during training
Batch size used for training
Learning rate used for training
Ratio of warmup steps
Maximum gradient norm for clipping
Weight decay value used
Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded.
Weights & Biases project name
Weights & Biases run name
Checkpoint used to continue training
Hugging Face Hub repo to start training from
The revision of the Hugging Face Hub model to continue training from
Whether the early-stopping criterion triggered.
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.
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"
}