oci_generative_ai_model

This resource provides the Model resource in Oracle Cloud Infrastructure Generative Ai service.

Creates a custom model by fine-tuning a base model with your own dataset. You can create a new custom models or create a new version of existing custom model..

The header contains an opc-work-request-id, which is the id for the WorkRequest that tracks the model creation progress.

Example Usage

resource "oci_generative_ai_model" "test_model" {
	#Required
	base_model_id = oci_generative_ai_model.test_model.id
	compartment_id = var.compartment_id
	fine_tune_details {
		#Required
		dedicated_ai_cluster_id = oci_generative_ai_dedicated_ai_cluster.test_dedicated_ai_cluster.id
		training_dataset {
			#Required
			bucket = var.model_fine_tune_details_training_dataset_bucket
			dataset_type = var.model_fine_tune_details_training_dataset_dataset_type
			namespace = var.model_fine_tune_details_training_dataset_namespace
			object = var.model_fine_tune_details_training_dataset_object
		}

		#Optional
		training_config {
			#Required
			training_config_type = var.model_fine_tune_details_training_config_training_config_type

			#Optional
			early_stopping_patience = var.model_fine_tune_details_training_config_early_stopping_patience
			early_stopping_threshold = var.model_fine_tune_details_training_config_early_stopping_threshold
			learning_rate = var.model_fine_tune_details_training_config_learning_rate
			log_model_metrics_interval_in_steps = var.model_fine_tune_details_training_config_log_model_metrics_interval_in_steps
			num_of_last_layers = var.model_fine_tune_details_training_config_num_of_last_layers
			total_training_epochs = var.model_fine_tune_details_training_config_total_training_epochs
			training_batch_size = var.model_fine_tune_details_training_config_training_batch_size
		}
	}

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	description = var.model_description
	display_name = var.model_display_name
	freeform_tags = {"Department"= "Finance"}
	vendor = var.model_vendor
	version = var.model_version
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Model * update - (Defaults to 20 minutes), when updating the Model * delete - (Defaults to 20 minutes), when destroying the Model

Import

Models can be imported using the id, e.g.

$ terraform import oci_generative_ai_model.test_model "id"