openapi: 3.0.3 info: title: remediation.proto Audio Fine-tuning API version: version not set servers: - url: https://api.together.xyz/v1 security: - bearerAuth: [] tags: - name: Fine-tuning paths: /fine-tunes: post: tags: - Fine-tuning summary: Create job description: Create a fine-tuning job with the provided model and training data. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.create(\n model=\"meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\",\n training_file=\"file-id\"\n)\n\nprint(response)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.create(\n model=\"meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\",\n training_file=\"file-id\"\n)\n\nprint(response)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.create({\n model: \"meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\",\n training_file: \"file-id\",\n});\n\nconsole.log(response);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.create({\n model: \"meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\",\n training_file: \"file-id\",\n});\n\nconsole.log(response);\n" - lang: Shell label: cURL source: "curl -X POST \"https://api.together.ai/v1/fine-tunes\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\",\n \"training_file\": \"file-id\"\n }'\n" requestBody: required: true content: application/json: schema: type: object required: - training_file - model properties: training_file: type: string description: File-ID of a training file uploaded to the Together API validation_file: type: string description: File-ID of a validation file uploaded to the Together API packing: type: boolean default: true description: Whether to use sequence packing for training. max_seq_length: type: integer description: Maximum sequence length to use for training. model: type: string description: Name of the base model to run fine-tune job on n_epochs: type: integer default: 1 description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting) n_checkpoints: type: integer default: 1 description: Number of intermediate model versions saved during training for evaluation n_evals: type: integer default: 0 description: Number of evaluations to be run on a given validation set during training batch_size: oneOf: - type: integer - type: string enum: - max default: max description: Number 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. learning_rate: type: number format: float default: 1.0e-05 description: Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence) lr_scheduler: type: object default: none $ref: '#/components/schemas/LRScheduler' description: The learning rate scheduler to use. It specifies how the learning rate is adjusted during training. warmup_ratio: type: number format: float default: 0 description: The percent of steps at the start of training to linearly increase the learning rate. max_grad_norm: type: number format: float default: 1 description: Max gradient norm to be used for gradient clipping. Set to 0 to disable. weight_decay: type: number format: float default: 0 description: Weight decay. Regularization parameter for the optimizer. random_seed: type: integer nullable: true description: '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). ' suffix: type: string description: Suffix that will be added to your fine-tuned model name wandb_api_key: type: string description: Integration key for tracking experiments and model metrics on W&B platform wandb_base_url: type: string description: The base URL of a dedicated Weights & Biases instance. wandb_project_name: type: string description: The Weights & Biases project for your run. If not specified, will use `together` as the project name. wandb_name: type: string description: The Weights & Biases name for your run. wandb_entity: type: string description: The Weights & Biases entity for your run. train_on_inputs: oneOf: - type: boolean - type: string enum: - auto type: boolean default: auto description: Whether to mask the user messages in conversational data or prompts in instruction data. deprecated: true training_method: type: object oneOf: - $ref: '#/components/schemas/TrainingMethodSFT' - $ref: '#/components/schemas/TrainingMethodDPO' description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization. training_type: type: object default: null nullable: true anyOf: - $ref: '#/components/schemas/FullTrainingType' - $ref: '#/components/schemas/LoRATrainingType' description: The training type to use. If not provided, the job will default to LoRA training type. multimodal_params: $ref: '#/components/schemas/MultimodalParams' from_checkpoint: type: string description: 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, the final checkpoint will be used. from_hf_model: type: string description: 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_revision: type: string description: 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_token: type: string description: The API token for the Hugging Face Hub. hf_output_repo_name: type: string description: The name of the Hugging Face repository to upload the fine-tuned model to. responses: '200': description: Fine-tuning job initiated successfully content: application/json: schema: $ref: '#/components/schemas/FinetuneResponseTruncated' get: tags: - Fine-tuning summary: List all jobs description: List the metadata for all fine-tuning jobs. Returns a list of FinetuneResponseTruncated objects. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.list()\n\nfor fine_tune in response.data:\n print(f\"ID: {fine_tune.id}, Status: {fine_tune.status}\")\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.list()\n\nfor fine_tune in response.data:\n print(f\"ID: {fine_tune.id}, Status: {fine_tune.status}\")\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.list();\n\nfor (const fineTune of response.data) {\n console.log(fineTune.id, fineTune.status);\n}\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.list();\n\nfor (const fineTune of response.data) {\n console.log(fineTune.id, fineTune.status);\n}\n" - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/fine-tunes\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" responses: '200': description: List of fine-tune jobs content: application/json: schema: $ref: '#/components/schemas/FinetuneTruncatedList' /fine-tunes/estimate-price: post: tags: - Fine-tuning summary: Estimate price description: Estimate the price of a fine-tuning job. requestBody: required: true content: application/json: schema: type: object required: - training_file properties: training_file: type: string description: File-ID of a training file uploaded to the Together API validation_file: type: string description: File-ID of a validation file uploaded to the Together API model: type: string description: Name of the base model to run fine-tune job on n_epochs: type: integer default: 1 description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting) n_evals: type: integer default: 0 description: Number of evaluations to be run on a given validation set during training training_method: type: object oneOf: - $ref: '#/components/schemas/TrainingMethodSFT' - $ref: '#/components/schemas/TrainingMethodDPO' description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization. training_type: type: object default: null nullable: true oneOf: - $ref: '#/components/schemas/FullTrainingType' - $ref: '#/components/schemas/LoRATrainingType' description: The training type to use. If not provided, the job will default to LoRA training type. from_checkpoint: type: string description: 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, the final checkpoint will be used. responses: '200': description: Price estimated successfully content: application/json: schema: type: object properties: estimated_total_price: type: number description: The price of the fine-tuning job allowed_to_proceed: type: boolean description: Whether the user is allowed to proceed with the fine-tuning job example: true user_limit: type: number description: The user's credit limit in dollars estimated_train_token_count: type: number description: The estimated number of tokens to be trained estimated_eval_token_count: type: number description: The estimated number of tokens for evaluation '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/ErrorData' /fine-tunes/{id}: get: tags: - Fine-tuning summary: List job description: List the metadata for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nfine_tune = client.fine_tuning.retrieve(id=\"ft-id\")\n\nprint(fine_tune)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nfine_tune = client.fine_tuning.retrieve(id=\"ft-id\")\n\nprint(fine_tune)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst fineTune = await client.fineTuning.retrieve(\"ft-id\");\n\nconsole.log(fineTune);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst fineTune = await client.fineTuning.retrieve(\"ft-id\");\n\nconsole.log(fineTune);\n" - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/fine-tunes/ft-id\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - name: id in: path required: true schema: description: The ID of the job to retrieve type: string responses: '200': description: Fine-tune job details retrieved successfully content: application/json: schema: $ref: '#/components/schemas/FinetuneResponse' delete: tags: - Fine-tuning summary: Delete a fine-tune job description: Delete a fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.delete(id=\"ft-id\")\n\nprint(response)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.delete(id=\"ft-id\")\n\nprint(response)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.delete(\"ft-id\");\n\nconsole.log(response);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.delete(\"ft-id\");\n\nconsole.log(response);\n" - lang: Shell label: cURL source: "curl -X \"DELETE\" \"https://api.together.ai/v1/fine-tunes/ft-id?force=false\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - name: id in: path required: true schema: description: The ID of the fine-tune job to delete type: string - name: force deprecated: true in: query schema: description: Deprecated and unused parameter. type: boolean default: false responses: '200': description: Fine-tune job deleted successfully content: application/json: schema: $ref: '#/components/schemas/FinetuneDeleteResponse' '404': description: Fine-tune job not found content: application/json: schema: $ref: '#/components/schemas/ErrorData' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorData' /fine-tunes/{id}/events: get: tags: - Fine-tuning summary: List job events description: List the events for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.list_events(id=\"ft-id\")\n\nfor event in response.data:\n print(event)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nevents = client.fine_tuning.list_events(id=\"ft-id\")\n\nprint(events)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst events = await client.fineTuning.listEvents(\"ft-id\");\n\nconsole.log(events);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst events = await client.fineTuning.listEvents(\"ft-id\");\n\nconsole.log(events);\n" - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/fine-tunes/ft-id/events\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - name: id in: path required: true schema: description: The ID of the fine-tune job to list events for type: string responses: '200': description: List of fine-tune events content: application/json: schema: $ref: '#/components/schemas/FinetuneListEvents' /fine-tunes/{id}/checkpoints: get: tags: - Fine-tuning summary: List checkpoints description: List the checkpoints for a single fine-tuning job. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\ncheckpoints = client.fine_tuning.list_checkpoints(id=\"ft-id\")\n\nprint(checkpoints)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\ncheckpoints = client.fine_tuning.list_checkpoints(id=\"ft-id\")\n\nprint(checkpoints)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst checkpoints = await client.fineTuning.listCheckpoints(\"ft-id\");\n\nconsole.log(checkpoints);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst checkpoints = await client.fineTuning.listCheckpoints(\"ft-id\");\n\nconsole.log(checkpoints);\n" - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/fine-tunes/ft-id/checkpoints\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - name: id in: path required: true schema: description: The ID of the fine-tune job to list checkpoints for type: string responses: '200': description: List of fine-tune checkpoints content: application/json: schema: $ref: '#/components/schemas/FinetuneListCheckpoints' /finetune/download: get: tags: - Fine-tuning summary: Download model description: Receive a compressed fine-tuned model or checkpoint. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\n# Using `with_streaming_response` gives you control to do what you want with the response.\nstream = client.fine_tuning.with_streaming_response.content(ft_id=\"ft-id\")\n\nwith stream as response:\n for line in response.iter_lines():\n print(line)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\n# This will download the content to a location on disk\nresponse = client.fine_tuning.download(id=\"ft-id\")\n\nprint(response)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.content({\n ft_id: \"ft-id\",\n});\n\nconsole.log(await response.blob());\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.content({\n ft_id: \"ft-id\",\n});\n\nconsole.log(await response.blob());\n" - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/finetune/download?ft_id=ft-id&checkpoint=merged\"\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - in: query name: ft_id required: true schema: description: Fine-tune ID to download. A string that starts with `ft-`. type: string - in: query name: checkpoint_step required: false schema: description: Specifies step number for checkpoint to download. Ignores `checkpoint` value if set. type: integer - in: query name: checkpoint schema: description: Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set. type: string enum: - merged - adapter - model_output_path responses: '200': description: Successfully downloaded the fine-tuned model or checkpoint. content: application/octet-stream: schema: type: string format: binary '400': description: Invalid request parameters. '404': description: Fine-tune ID not found. /fine-tunes/{id}/cancel: post: tags: - Fine-tuning summary: Cancel job description: Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object. x-codeSamples: - lang: Python label: Together AI SDK (v2) source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.cancel(id=\"ft-id\")\n\nprint(response)\n" - lang: Python label: Together AI SDK (v1) source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.fine_tuning.cancel(id=\"ft-id\")\n\nprint(response)\n" - lang: TypeScript label: Together AI SDK (TypeScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.cancel(\"ft-id\");\n\nconsole.log(response);\n" - lang: JavaScript label: Together AI SDK (JavaScript) source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTuning.cancel(\"ft-id\");\n\nconsole.log(response);\n" - lang: Shell label: cURL source: "curl -X POST \"https://api.together.ai/v1/fine-tunes/ft-id/cancel\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n" parameters: - name: id in: path required: true schema: description: Fine-tune ID to cancel. A string that starts with `ft-`. type: string responses: '200': description: Successfully cancelled the fine-tuning job. content: application/json: schema: $ref: '#/components/schemas/FinetuneResponseTruncated' '400': description: Invalid request parameters. '404': description: Fine-tune ID not found. /fine-tunes/{id}/metrics: get: tags: - Fine-tuning summary: Get metrics description: 'Retrieves recorded training metrics for a fine-tuning job in chronological order. All filter fields are optional — omit the body or send `{}` to retrieve all metrics. ' x-codeSamples: - lang: Shell label: cURL source: "curl -X GET \"https://api.together.ai/v1/fine-tunes/ft-id/metrics\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"global_step_from\": 0,\n \"global_step_to\": 500\n }'\n" parameters: - name: id in: path required: true schema: description: Fine-tune job ID. A string that starts with `ft-`. type: string requestBody: required: false content: application/json: schema: type: object properties: global_step_from: type: integer format: int64 description: Return only metrics with global_step >= this value. example: 0 global_step_to: type: integer format: int64 description: Return only metrics with global_step <= this value. example: 500 logged_at_from: type: string format: date-time description: Return only metrics logged at or after this ISO-8601 timestamp. example: '2024-01-01T00:00:00Z' logged_at_to: type: string format: date-time description: Return only metrics logged at or before this ISO-8601 timestamp. example: '2024-01-01T12:00:00Z' resolution: type: integer format: int64 description: Number of (uniformly sampled) train metrics to return. example: 100 responses: '200': description: List of metrics snapshots in chronological order. content: application/json: schema: type: object properties: metrics: type: array items: type: object additionalProperties: type: number description: A flat dictionary of scalar metric values. example: metrics: - train/loss: 0.5 train/learning_rate: 0.0001 train/global_step: 7 - train/loss: 0.45 train/learning_rate: 9.0e-05 train/global_step: 14 '400': description: Invalid request — bad JSON body or missing job ID. '404': description: Fine-tune job not found. '500': description: Internal server error — failed to retrieve metrics. /fine-tunes/models/supported: get: tags: - Fine-tuning summary: List supported models description: List models supported for fine-tuning. x-codeSamples: - lang: Shell label: cURL (list all) source: "curl \"https://api.together.ai/v1/fine-tunes/models/supported\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\"\n" responses: '200': description: List of supported models. content: application/json: schema: type: object required: - models properties: models: type: array items: type: string description: List of supported model names. /fine-tunes/models/limits: get: tags: - Fine-tuning summary: Get model limits description: Get model limits for a specific fine-tuning model. x-codeSamples: - lang: Shell label: cURL source: "curl \"https://api.together.ai/v1/fine-tunes/models/limits?model_name=meta-llama/Meta-Llama-3.1-8B-Instruct-Reference\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\"\n" parameters: - in: query name: model_name schema: type: string description: The model name to get limits for. required: true responses: '200': description: Model limits. content: application/json: schema: $ref: '#/components/schemas/FineTuneModelLimits' '404': description: Model not found or not supported for fine-tuning. content: application/json: schema: type: object properties: message: type: string description: Error message explaining the model is not available. components: schemas: LinearLRSchedulerArgs: type: object properties: min_lr_ratio: type: number format: float default: 0 description: The ratio of the final learning rate to the peak learning rate CosineLRSchedulerArgs: type: object properties: min_lr_ratio: type: number format: float default: 0 description: The ratio of the final learning rate to the peak learning rate num_cycles: type: number format: float default: 0.5 description: Number or fraction of cycles for the cosine learning rate scheduler required: - min_lr_ratio - num_cycles FineTuneEvent: type: object required: - object - created_at - message - type - param_count - token_count - total_steps - wandb_url - step - checkpoint_path - model_path - training_offset - hash properties: object: description: The object type, which is always `fine-tune-event`. const: fine-tune-event created_at: type: string level: anyOf: - $ref: '#/components/schemas/FinetuneEventLevels' message: type: string type: $ref: '#/components/schemas/FinetuneEventType' param_count: type: integer token_count: type: integer total_steps: type: integer wandb_url: type: string step: type: integer checkpoint_path: type: string model_path: type: string training_offset: type: integer hash: type: string FineTuneProgress: type: object description: Progress information for a fine-tuning job required: - estimate_available - seconds_remaining properties: estimate_available: type: boolean description: Whether time estimate is available seconds_remaining: type: integer description: Estimated time remaining in seconds for the fine-tuning job to next state FineTuneModelLimits: type: object description: Model limits for fine-tuning. required: - model_name - max_num_epochs - max_num_evals - max_learning_rate - min_learning_rate - supports_vision - supports_tools - supports_reasoning - merge_output_lora properties: model_name: type: string description: The name of the model. full_training: type: object description: Limits for full training. required: - max_batch_size - max_batch_size_dpo - min_batch_size properties: max_batch_size: type: integer description: Maximum batch size for SFT full training. max_batch_size_dpo: type: integer description: Maximum batch size for DPO full training. min_batch_size: type: integer description: Minimum batch size for full training. lora_training: type: object description: Limits for LoRA training. required: - max_batch_size - max_batch_size_dpo - min_batch_size - max_rank - target_modules properties: max_batch_size: type: integer description: Maximum batch size for SFT LoRA training. max_batch_size_dpo: type: integer description: Maximum batch size for DPO LoRA training. min_batch_size: type: integer description: Minimum batch size for LoRA training. max_rank: type: integer description: Maximum LoRA rank. target_modules: type: array items: type: string description: Available target modules for LoRA. max_num_epochs: type: integer description: Maximum number of training epochs. max_num_evals: type: integer description: Maximum number of evaluations. max_learning_rate: type: number description: Maximum learning rate. min_learning_rate: type: number description: Minimum learning rate. supports_vision: type: boolean description: Whether the model supports vision/multimodal inputs. supports_tools: type: boolean description: Whether the model supports tool/function calling. supports_reasoning: type: boolean description: Whether the model supports reasoning. merge_output_lora: type: boolean description: Whether to merge the output LoRA. FinetuneListEvents: type: object required: - data properties: data: type: array items: $ref: '#/components/schemas/FineTuneEvent' LRScheduler: type: object properties: lr_scheduler_type: type: string enum: - linear - cosine lr_scheduler_args: oneOf: - $ref: '#/components/schemas/LinearLRSchedulerArgs' - $ref: '#/components/schemas/CosineLRSchedulerArgs' required: - lr_scheduler_type FinetuneDeleteResponse: type: object properties: message: type: string description: Message indicating the result of the deletion FinetuneJobStatus: type: string enum: - pending - queued - running - compressing - uploading - cancel_requested - cancelled - error - completed LoRATrainingType: type: object properties: type: type: string enum: - Lora lora_r: type: integer lora_alpha: type: integer lora_dropout: type: number format: float default: 0 lora_trainable_modules: type: string default: all-linear required: - type - lora_r - lora_alpha TrainingMethodDPO: type: object properties: method: type: string enum: - dpo dpo_beta: type: number format: float default: 0.1 rpo_alpha: type: number format: float default: 0 dpo_normalize_logratios_by_length: type: boolean default: false dpo_reference_free: type: boolean default: false simpo_gamma: type: number format: float default: 0 required: - method FineTuneCheckpoint: type: object required: - step - path - created_at - checkpoint_type properties: step: type: integer created_at: type: string path: type: string checkpoint_type: type: string ErrorData: type: object required: - error properties: error: type: object properties: message: type: string nullable: false type: type: string nullable: false param: type: string nullable: true default: null code: type: string nullable: true default: null required: - type - message FullTrainingType: type: object properties: type: type: string enum: - Full required: - type FinetuneEventLevels: type: string enum: - null - info - warning - error - legacy_info - legacy_iwarning - legacy_ierror TrainingMethodSFT: type: object properties: method: type: string enum: - sft train_on_inputs: oneOf: - type: boolean - type: string enum: - auto type: boolean default: auto description: Whether to mask the user messages in conversational data or prompts in instruction data. required: - method - train_on_inputs FinetuneEventType: type: string enum: - job_pending - job_start - job_stopped - model_downloading - model_download_complete - training_data_downloading - training_data_download_complete - validation_data_downloading - validation_data_download_complete - wandb_init - training_start - checkpoint_save - billing_limit - epoch_complete - training_complete - model_compressing - model_compression_complete - model_uploading - model_upload_complete - job_complete - job_error - cancel_requested - job_restarted - refund - warning FinetuneResponseTruncated: type: object description: A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints required: - id - status - created_at - updated_at example: id: ft-01234567890123456789 status: completed created_at: '2023-05-17T17:35:45.123Z' updated_at: '2023-05-17T18:46:23.456Z' user_id: user_01234567890123456789 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 properties: id: type: string description: Unique identifier for the fine-tune job status: $ref: '#/components/schemas/FinetuneJobStatus' created_at: type: string format: date-time description: Creation timestamp of the fine-tune job updated_at: type: string format: date-time description: Last update timestamp of the fine-tune job started_at: type: string format: date-time description: Start timestamp of the current stage of the fine-tune job user_id: type: string description: Identifier for the user who created the job owner_address: type: string description: Owner address information total_price: type: integer description: Total price for the fine-tuning job token_count: type: integer description: Count of tokens processed events: type: array items: $ref: '#/components/schemas/FineTuneEvent' description: Events related to this fine-tune job training_file: type: string description: File-ID of the training file validation_file: type: string description: File-ID of the validation file packing: type: boolean description: Whether sequence packing is being used for training. max_seq_length: type: integer description: Maximum sequence length to use for training. If not specified, the maximum allowed for the model and training method will be used. model: type: string description: Base model used for fine-tuning model_output_name: type: string suffix: type: string description: Suffix added to the fine-tuned model name n_epochs: type: integer description: Number of training epochs n_evals: type: integer description: Number of evaluations during training n_checkpoints: type: integer description: Number of checkpoints saved during training batch_size: type: integer description: Batch size used for training training_type: oneOf: - $ref: '#/components/schemas/FullTrainingType' - $ref: '#/components/schemas/LoRATrainingType' description: Type of training used (full or LoRA) training_method: oneOf: - $ref: '#/components/schemas/TrainingMethodSFT' - $ref: '#/components/schemas/TrainingMethodDPO' description: Method of training used learning_rate: type: number format: float description: Learning rate used for training lr_scheduler: $ref: '#/components/schemas/LRScheduler' description: Learning rate scheduler configuration warmup_ratio: type: number format: float description: Ratio of warmup steps max_grad_norm: type: number format: float description: Maximum gradient norm for clipping weight_decay: type: number format: float description: Weight decay value used random_seed: type: integer nullable: true description: 'Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded. ' wandb_project_name: type: string description: Weights & Biases project name wandb_name: type: string description: Weights & Biases run name from_checkpoint: type: string description: Checkpoint used to continue training from_hf_model: type: string description: Hugging Face Hub repo to start training from hf_model_revision: type: string description: The revision of the Hugging Face Hub model to continue training from progress: $ref: '#/components/schemas/FineTuneProgress' description: Progress information for the fine-tuning job FinetuneResponse: type: object required: - id - status properties: id: type: string format: uuid training_file: type: string validation_file: type: string model: type: string model_output_name: type: string model_output_path: type: string trainingfile_numlines: type: integer trainingfile_size: type: integer created_at: type: string format: date-time updated_at: type: string format: date-time started_at: type: string format: date-time n_epochs: type: integer n_checkpoints: type: integer n_evals: type: integer batch_size: oneOf: - type: integer - type: string enum: - max default: max learning_rate: type: number lr_scheduler: type: object $ref: '#/components/schemas/LRScheduler' warmup_ratio: type: number max_grad_norm: type: number format: float weight_decay: type: number format: float eval_steps: type: integer train_on_inputs: oneOf: - type: boolean - type: string enum: - auto default: auto training_method: type: object oneOf: - $ref: '#/components/schemas/TrainingMethodSFT' - $ref: '#/components/schemas/TrainingMethodDPO' training_type: type: object oneOf: - $ref: '#/components/schemas/FullTrainingType' - $ref: '#/components/schemas/LoRATrainingType' multimodal_params: $ref: '#/components/schemas/MultimodalParams' status: $ref: '#/components/schemas/FinetuneJobStatus' job_id: type: string events: type: array items: $ref: '#/components/schemas/FineTuneEvent' token_count: type: integer param_count: type: integer total_price: type: integer epochs_completed: type: integer queue_depth: type: integer wandb_project_name: type: string wandb_url: type: string from_checkpoint: type: string from_hf_model: type: string hf_model_revision: type: string progress: $ref: '#/components/schemas/FineTuneProgress' FinetuneListCheckpoints: type: object required: - data properties: data: type: array items: $ref: '#/components/schemas/FineTuneCheckpoint' FinetuneTruncatedList: type: object required: - data properties: data: type: array items: $ref: '#/components/schemas/FinetuneResponseTruncated' MultimodalParams: type: object properties: train_vision: type: boolean description: Whether to train the vision encoder of the model. Only available for multimodal models. securitySchemes: bearerAuth: type: http scheme: bearer x-bearer-format: bearer x-default: default