Create job
Create a fine-tuning job with the provided model and training data.
Authorization
bearerAuth In: header
Request Body
application/json
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.
trueMaximum 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)
1Number of intermediate model versions saved during training for evaluation
value <= 101Number of evaluations to be run on a given validation set during training
0Number of training examples processed together (larger batches use more memory but may train faster). Defaults to "max". We use training optimizations like packing, so the effective batch size may be different than the value you set.
"max"Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used.
0 <= valueControls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
0.00001The learning rate scheduler to use. It specifies how the learning rate is adjusted during training.
"none"The percent of steps at the start of training to linearly increase the learning rate.
0Max gradient norm to be used for gradient clipping. Set to 0 to disable.
1Weight decay. Regularization parameter for the optimizer.
0Random 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.
falseNumber of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
1 <= value2Minimum 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.
0 <= value0Number 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.
0 <= value1Suffix to add to your fine-tuned model name. Must be at most 64 characters long.
length <= 64Integration 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.
"auto"The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization.
The training type to use. Defaults to LoRA if not provided.
nullThe 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 Body
application/json
application/json
curl -X POST "https://example.com/fine-tunes" \ -H "Content-Type: application/json" \ -d '{ "training_file": "string", "model": "string" }'{ "id": "string", "status": "pending", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "started_at": "2019-08-24T14:15:22Z", "user_id": "string", "owner_address": "string", "total_price": 0, "token_count": 0, "events": [ { "object": "fine-tune-event", "created_at": "string", "level": null, "message": "string", "type": "job_pending", "param_count": 0, "token_count": 0, "total_steps": 0, "wandb_url": "string", "step": 0, "checkpoint_path": "string", "model_path": "string", "tokenized_dataset_path": "string", "early_stopping_best_step": 0, "early_stopping_best_metric_value": 0 } ], "training_file": "string", "validation_file": "string", "packing": true, "max_seq_length": 0, "model": "string", "model_output_name": "string", "suffix": "string", "n_epochs": 0, "n_evals": 0, "n_checkpoints": 0, "batch_size": 0, "training_type": { "type": "Full" }, "training_method": { "method": "sft", "train_on_inputs": "auto" }, "learning_rate": 0, "lr_scheduler": { "lr_scheduler_type": "linear", "lr_scheduler_args": { "min_lr_ratio": 0 } }, "warmup_ratio": 0, "max_grad_norm": 0, "weight_decay": 0, "random_seed": 0, "wandb_project_name": "string", "wandb_name": "string", "from_checkpoint": "string", "from_hf_model": "string", "hf_model_revision": "string", "progress": { "estimate_available": true, "seconds_remaining": 0 }, "early_stopped": true, "early_stopping_best_step": 0, "early_stopping_best_metric": 0}