Creating a Trained Custom Model

Create a custom model in OCI Generative AI by fine-tuning a base model with your own dataset.

Before you create a model, ensure that you have permission to create custom models and list buckets, and that your dataset meets the training data requirements.

Note

Base models for custom models aren't available in all regions. See Pretrained Foundational Models in Generative AI for the regions that a base model is available in.
  • On the Custom models list page, select Create custom model. If you need help finding the list page, see Listing Custom Models.

    Model definition

    1. Select Create a new model.
    2. Select a compartment to create the model in. The default compartment is the same as the list page, but you can select any compartment that you have permission to work in.
    3. (Optional) Enter a name for the custom model. Start the name with a letter or underscore, followed by letters, numbers, hyphens, or underscores. The length can be 1–255 characters. If you don't enter a name, the system generates a name that you can change later.
      The generated name has the format generativeaimodel<timestamp>. For example: generativeaimodel20250531234930
    4. (Optional) Enter a version for the model. If you don't enter a version, the system generates a version that you can change later.
      The generated version has the format v<timestamp>. For example: v20250531234930
    5. (Optional) Enter a description for the model.
    6. (Optional) Select Add tag and assign tags to this custom model. See Resource Tags.
    7. Select Next.

    Fine-tuning configuration

    1. Select a Base Model for the custom model.
      For details about the base model, see the key features of the pretrained models.
    2. Select a Fine-tuning method.
      Important

      For guidelines, see Selecting a Fine-Tuning Method in Generative AI.
    3. Select a fine-tuning dedicated AI cluster by performing one of the following actions:
      • Select a Dedicated AI cluster from the list. If you created a cluster a few minutes ago, wait for that cluster to become active. Ensure that the base model that's associated with this cluster matches the base model.
      • Select Create new dedicated AI cluster and perform the following steps:
        1. (Optional) Enter a name and description.
        2. Select a Base model that matches the base model in step 1.
        3. (Optional) Select Add tag and assign tags to this custom model. See Resource Tags.
        4. Read the commitment unit hours for the fine-tuning dedicated AI cluster and select the checkbox to agree to the commitment.
        5. (Optional) Select Add tag and assign tags to this dedicated AI cluster. See Resource Tags.
        6. Select Create and wait for the cluster to become active.
        7. From the Dedicated AI cluster list, select the dedicated AI cluster that you created.
    4. (Optional) Select Hyperparameters and update the values as needed. See Fine-Tuning Hyperparameters in Generative AI. To reset the values, select Restore defaults.
    5. Select Next.

    Data Selection

    1. Select the Object Storage bucket that contains the training dataset. If the bucket isn't listed, perform the following actions:
      • Ensure that the bucket is in the same region as the custom model.
      • Select Change compartment and select the compartment that hosts the bucket with the training data.
      • Ask an administrator to give you permission to buckets and objects in this compartment.
    2. From the bucket's listed files, select a Training file to use for this model.
    3. Preview how the data in the training file is ingested.
      • In case of warning or errors, fix the data.
      • If the data records parse correctly, proceed to the next step.

    Review custom model

    Review the custom model information. If you're not happy with the information, go back and change the values. If you're happy with the selections, create the custom model.
  • Use the model create command and required parameters to create a custom model:

    oci generative-ai model create 
    --base-model-id <base-model-OCID>
    --compartment-id <compartment-OCID>
    --fine-tune-details [complex type]
    [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

    Note

    For the base model ID, instead of an OCID, you can use the base model name exactly as listed in the Console's playground. You can also find this OCI model name, in the model's detail page in Pretrained Foundational Models in Generative AI.
  • Run the CreateModel operation to create a custom model.

    Note

    For the base model ID, instead of an OCID, you can use the base model name exactly as listed in the Console's playground. You can also find this OCI model name, in the model's detail page in Pretrained Foundational Models in Generative AI.