# Model

Manage and train models

## Create Model

 - [POST /tailored-gen/models](https://docs.bria.ai/tailored-generation/model/create-model.md): Create a new model.

## Get Models

 - [GET /tailored-gen/models](https://docs.bria.ai/tailored-generation/model/get-models.md): Retrieve a list of models. If there are no models, an empty array is returned.

## Get Models by Project

 - [GET /tailored-gen/projects/{project_id}/models](https://docs.bria.ai/tailored-generation/model/get-models-by-project.md): Retrieve all models for a project.

## Get Model by ID

 - [GET /tailored-gen/models/{model_id}](https://docs.bria.ai/tailored-generation/model/get-model.md): Retrieve full model information.

## Update Model

 - [PUT /tailored-gen/models/{model_id}](https://docs.bria.ai/tailored-generation/model/update-model.md): Update a model's name and description.

## Delete Model

 - [DELETE /tailored-gen/models/{model_id}](https://docs.bria.ai/tailored-generation/model/delete-model.md): Delete a specific model.

## Start Training

 - [POST /tailored-gen/models/{model_id}/start_training](https://docs.bria.ai/tailored-generation/model/start-training.md): Start model training. Training duration is typically 2-4 hours.
The associated dataset must have a status of 'completed' before training can begin.

Default Training Parameters:
If parameters are not provided, defaults are automatically selected:
* rank: 128
* learning_rate: 0.0001
* lr_scheduler: "constant_with_warmup"
* total_training_steps: 750
* checkpoint_interval: 500
    
Constraints:
Advanced training parameters are only supported when the model's training_mode is set to 'expert'.

## Stop Training

 - [POST /tailored-gen/models/{model_id}/stop_training](https://docs.bria.ai/tailored-generation/model/stop-training.md): Stop an ongoing model training process. Once stopped, training cannot be resumed - a new model would need to be created and trained.

## List Checkpoints

 - [GET /tailored-gen/models/{model_id}/checkpoints](https://docs.bria.ai/tailored-generation/model/list-checkpoints.md): Retrieve a list of all available checkpoints for a model. Only available for models trained in expert mode.

## Get Specific Checkpoint

 - [GET /tailored-gen/models/{model_id}/checkpoints/{checkpoint_step}](https://docs.bria.ai/tailored-generation/model/get-checkpoint.md): Retrieve details for a specific model checkpoint.

## Delete Checkpoint

 - [DELETE /tailored-gen/models/{model_id}/checkpoints/{checkpoint_step}](https://docs.bria.ai/tailored-generation/model/delete-checkpoint.md): Permanently delete a specific model checkpoint. Cannot delete the checkpoint currently selected for inference.

## Download Tailored Model

 - [GET /tailored-gen/models/{model_id}/download](https://docs.bria.ai/tailored-generation/model/download-tailored-model.md): Download a trained tailored generation model after completing the training process. 
The response includes a pre-signed URL for downloading the model and details about the base model used.

To use the tailored model source code, access to the base model source code is required. 
The base model source code is exclusively available through Bria's Source Code and Weights product. 
For more information, contact us at info@bria.ai.

