Skip to main content
Cohere

Search documentation

Type to search this documentation.

Trains and deploys a fine-tuned model.

POST/v1/finetuning/finetuned-modelsTrains and deploys a fine-tuned model.

Creates a new fine-tuned model. The model will be trained on the dataset specified in the request body. The training process may take some time, and the model will be available once the training is complete.

Parameters

X-Client-Namestringheader

The name of the project that is making the request.

Request body

required

Information about the fine-tuned model. Must contain name and settings.

application/json
objectdeprecatedFinetunedModel

This resource represents a fine-tuned model.

completed_atstring · date-time

read-only. Timestamp for the completed fine-tuning.

created_atstring · date-time

read-only. Creation timestamp.

creator_idstring

read-only. User ID of the creator.

idstring

read-only. FinetunedModel ID.

last_usedstring · date-time

read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.

namestringrequired

FinetunedModel name (e.g. `foobar`).

organization_idstring

read-only. Organization ID.

settingsobjectrequired

The configuration used for fine-tuning.

Show child attributes
base_modelobjectrequired

The base model used for fine-tuning.

Show child attributes
base_typestringrequired

The possible types of fine-tuned models. - BASE_TYPE_UNSPECIFIED: Unspecified model. - BASE_TYPE_GENERATIVE: Deprecated: Generative model. - BASE_TYPE_CLASSIFICATION: Classification model. - BASE_TYPE_RERANK: Rerank model. - BASE_TYPE_CHAT: Chat model.

one of "BASE_TYPE_UNSPECIFIED", "BASE_TYPE_GENERATIVE", "BASE_TYPE_CLASSIFICATION", "BASE_TYPE_RERANK", "BASE_TYPE_CHAT" · default "BASE_TYPE_UNSPECIFIED"

namestring

The name of the base model.

strategystring

The possible strategy used to serve a fine-tuned models. - STRATEGY_UNSPECIFIED: Unspecified strategy. - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU. - STRATEGY_TFEW: Deprecated: Serve the fine-tuned model on a shared GPU.

one of "STRATEGY_UNSPECIFIED", "STRATEGY_VANILLA", "STRATEGY_TFEW" · default "STRATEGY_UNSPECIFIED"

versionstring

read-only. The version of the base model.

dataset_idstringrequired

The data used for training and evaluating the fine-tuned model.

hyperparametersobject

The fine-tuning hyperparameters.

Show child attributes
early_stopping_patienceinteger · int32

Stops training if the loss metric does not improve beyond the value of `early_stopping_threshold` after this many times of evaluation.

early_stopping_thresholdnumber · double

How much the loss must improve to prevent early stopping.

learning_ratenumber · double

The learning rate to be used during training.

lora_alphainteger · int32

Controls the scaling factor for LoRA updates. Higher values make the updates more impactful.

lora_rankinteger · int32

Specifies the rank for low-rank matrices. Lower ranks reduce parameters but may limit model flexibility.

lora_target_modulesstring

The possible combinations of LoRA modules to target. - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules. - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers. - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers. - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN).

one of "LORA_TARGET_MODULES_UNSPECIFIED", "LORA_TARGET_MODULES_QV", "LORA_TARGET_MODULES_QKVO", "LORA_TARGET_MODULES_QKVO_FFN" · default "LORA_TARGET_MODULES_UNSPECIFIED"

train_batch_sizeinteger · int32

The batch size is the number of training examples included in a single training pass.

train_epochsinteger · int32

The number of epochs to train for.

multi_labelboolean

read-only. Whether the model is single-label or multi-label (only for classification).

wandbobject

The Weights & Biases configuration.

Show child attributes
api_keystringrequired

The WandB API key to be used during training.

entitystring

The WandB entity name to be used during training.

projectstringrequired

The WandB project name to be used during training.

statusstring

The possible stages of a fine-tuned model life-cycle. - STATUS_UNSPECIFIED: Unspecified status. - STATUS_FINETUNING: The fine-tuned model is being fine-tuned. - STATUS_DEPLOYING_API: Deprecated: The fine-tuned model is being deployed. - STATUS_READY: The fine-tuned model is ready to receive requests. - STATUS_FAILED: The fine-tuned model failed. - STATUS_DELETED: The fine-tuned model was deleted. - STATUS_TEMPORARILY_OFFLINE: Deprecated: The fine-tuned model is temporarily unavailable. - STATUS_PAUSED: Deprecated: The fine-tuned model is paused (Vanilla only). - STATUS_QUEUED: The fine-tuned model is queued for training.

one of "STATUS_UNSPECIFIED", "STATUS_FINETUNING", "STATUS_DEPLOYING_API", "STATUS_READY", "STATUS_FAILED", "STATUS_DELETED", "STATUS_TEMPORARILY_OFFLINE", "STATUS_PAUSED", "STATUS_QUEUED" · default "STATUS_UNSPECIFIED"

updated_atstring · date-time

read-only. Latest update timestamp.

Example request
{
  "name": "string",
  "settings": {
    "base_model": {
      "base_type": "BASE_TYPE_UNSPECIFIED",
      "name": "string",
      "strategy": "STRATEGY_UNSPECIFIED"
    },
    "dataset_id": "string",
    "hyperparameters": {
      "early_stopping_patience": 0,
      "early_stopping_threshold": 0,
      "learning_rate": 0,
      "lora_alpha": 0,
      "lora_rank": 0,
      "lora_target_modules": "LORA_TARGET_MODULES_UNSPECIFIED",
      "train_batch_size": 0,
      "train_epochs": 0
    },
    "wandb": {
      "api_key": "",
      "entity": "string",
      "project": "string"
    }
  }
}

Responses

200A successful response.application/json
objectdeprecatedCreateFinetunedModelResponse

Response to request to create a fine-tuned model.

finetuned_modelobject

This resource represents a fine-tuned model.

Show child attributes
completed_atstring · date-time

read-only. Timestamp for the completed fine-tuning.

created_atstring · date-time

read-only. Creation timestamp.

creator_idstring

read-only. User ID of the creator.

idstring

read-only. FinetunedModel ID.

last_usedstring · date-time

read-only. Deprecated: Timestamp for the latest request to this fine-tuned model.

namestringrequired

FinetunedModel name (e.g. `foobar`).

organization_idstring

read-only. Organization ID.

settingsobjectrequiredSettings ↑

The configuration used for fine-tuning.

statusstring

The possible stages of a fine-tuned model life-cycle. - STATUS_UNSPECIFIED: Unspecified status. - STATUS_FINETUNING: The fine-tuned model is being fine-tuned. - STATUS_DEPLOYING_API: Deprecated: The fine-tuned model is being deployed. - STATUS_READY: The fine-tuned model is ready to receive requests. - STATUS_FAILED: The fine-tuned model failed. - STATUS_DELETED: The fine-tuned model was deleted. - STATUS_TEMPORARILY_OFFLINE: Deprecated: The fine-tuned model is temporarily unavailable. - STATUS_PAUSED: Deprecated: The fine-tuned model is paused (Vanilla only). - STATUS_QUEUED: The fine-tuned model is queued for training.

one of "STATUS_UNSPECIFIED", "STATUS_FINETUNING", "STATUS_DEPLOYING_API", "STATUS_READY", "STATUS_FAILED", "STATUS_DELETED", "STATUS_TEMPORARILY_OFFLINE", "STATUS_PAUSED", "STATUS_QUEUED" · default "STATUS_UNSPECIFIED"

updated_atstring · date-time

read-only. Latest update timestamp.

Example response
{
  "finetuned_model": {
    "completed_at": "2026-06-09T00:00:00Z",
    "created_at": "2026-06-09T00:00:00Z",
    "creator_id": "string",
    "id": "string",
    "last_used": "2026-06-09T00:00:00Z",
    "name": "string",
    "organization_id": "string",
    "settings": {
      "base_model": {
        "base_type": "BASE_TYPE_UNSPECIFIED",
        "name": "string",
        "strategy": "STRATEGY_UNSPECIFIED",
        "version": "string"
      },
      "dataset_id": "string",
      "hyperparameters": {
        "early_stopping_patience": 0,
        "early_stopping_threshold": 0,
        "learning_rate": 0,
        "lora_alpha": 0,
        "lora_rank": 0,
        "lora_target_modules": "LORA_TARGET_MODULES_UNSPECIFIED",
        "train_batch_size": 0,
        "train_epochs": 0
      },
      "multi_label": true,
      "wandb": {
        "api_key": "",
        "entity": "string",
        "project": "string"
      }
    },
    "status": "STATUS_UNSPECIFIED",
    "updated_at": "2026-06-09T00:00:00Z"
  }
}
400Bad Requestapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
401Unauthorizedapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
403Forbiddenapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
404Not Foundapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
500Internal Server Errorapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
503Status Service Unavailableapplication/json
objectdeprecatedError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
Documentation menu