1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. GenerativeAi
  5. getModels
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
oci logo
Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi

    This data source provides the list of Models in Oracle Cloud Infrastructure Generative AI service.

    Lists the models in a specific compartment. Includes pretrained base models and fine-tuned custom models.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testModels = oci.GenerativeAi.getModels({
        compartmentId: compartmentId,
        capabilities: modelCapability,
        displayName: modelDisplayName,
        id: modelId,
        state: modelState,
        vendor: modelVendor,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_models = oci.GenerativeAi.get_models(compartment_id=compartment_id,
        capabilities=model_capability,
        display_name=model_display_name,
        id=model_id,
        state=model_state,
        vendor=model_vendor)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/generativeai"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := generativeai.GetModels(ctx, &generativeai.GetModelsArgs{
    			CompartmentId: compartmentId,
    			Capabilities:  modelCapability,
    			DisplayName:   pulumi.StringRef(modelDisplayName),
    			Id:            pulumi.StringRef(modelId),
    			State:         pulumi.StringRef(modelState),
    			Vendor:        pulumi.StringRef(modelVendor),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testModels = Oci.GenerativeAi.GetModels.Invoke(new()
        {
            CompartmentId = compartmentId,
            Capabilities = modelCapability,
            DisplayName = modelDisplayName,
            Id = modelId,
            State = modelState,
            Vendor = modelVendor,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.GenerativeAi.GenerativeAiFunctions;
    import com.pulumi.oci.GenerativeAi.inputs.GetModelsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testModels = GenerativeAiFunctions.getModels(GetModelsArgs.builder()
                .compartmentId(compartmentId)
                .capabilities(modelCapability)
                .displayName(modelDisplayName)
                .id(modelId)
                .state(modelState)
                .vendor(modelVendor)
                .build());
    
        }
    }
    
    variables:
      testModels:
        fn::invoke:
          function: oci:GenerativeAi:getModels
          arguments:
            compartmentId: ${compartmentId}
            capabilities: ${modelCapability}
            displayName: ${modelDisplayName}
            id: ${modelId}
            state: ${modelState}
            vendor: ${modelVendor}
    

    Using getModels

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getModels(args: GetModelsArgs, opts?: InvokeOptions): Promise<GetModelsResult>
    function getModelsOutput(args: GetModelsOutputArgs, opts?: InvokeOptions): Output<GetModelsResult>
    def get_models(capabilities: Optional[Sequence[str]] = None,
                   compartment_id: Optional[str] = None,
                   display_name: Optional[str] = None,
                   filters: Optional[Sequence[GetModelsFilter]] = None,
                   id: Optional[str] = None,
                   state: Optional[str] = None,
                   vendor: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetModelsResult
    def get_models_output(capabilities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   compartment_id: Optional[pulumi.Input[str]] = None,
                   display_name: Optional[pulumi.Input[str]] = None,
                   filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetModelsFilterArgs]]]] = None,
                   id: Optional[pulumi.Input[str]] = None,
                   state: Optional[pulumi.Input[str]] = None,
                   vendor: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetModelsResult]
    func GetModels(ctx *Context, args *GetModelsArgs, opts ...InvokeOption) (*GetModelsResult, error)
    func GetModelsOutput(ctx *Context, args *GetModelsOutputArgs, opts ...InvokeOption) GetModelsResultOutput

    > Note: This function is named GetModels in the Go SDK.

    public static class GetModels 
    {
        public static Task<GetModelsResult> InvokeAsync(GetModelsArgs args, InvokeOptions? opts = null)
        public static Output<GetModelsResult> Invoke(GetModelsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetModelsResult> getModels(GetModelsArgs args, InvokeOptions options)
    public static Output<GetModelsResult> getModels(GetModelsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:GenerativeAi/getModels:getModels
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment in which to list resources.
    Capabilities List<string>
    A filter to return only resources their capability matches the given capability.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters List<GetModelsFilter>
    Id string
    The ID of the model.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    Vendor string
    A filter to return only resources that match the entire vendor given.
    CompartmentId string
    The OCID of the compartment in which to list resources.
    Capabilities []string
    A filter to return only resources their capability matches the given capability.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters []GetModelsFilter
    Id string
    The ID of the model.
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    Vendor string
    A filter to return only resources that match the entire vendor given.
    compartmentId String
    The OCID of the compartment in which to list resources.
    capabilities List<String>
    A filter to return only resources their capability matches the given capability.
    displayName String
    A filter to return only resources that match the given display name exactly.
    filters List<GetModelsFilter>
    id String
    The ID of the model.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    vendor String
    A filter to return only resources that match the entire vendor given.
    compartmentId string
    The OCID of the compartment in which to list resources.
    capabilities string[]
    A filter to return only resources their capability matches the given capability.
    displayName string
    A filter to return only resources that match the given display name exactly.
    filters GetModelsFilter[]
    id string
    The ID of the model.
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    vendor string
    A filter to return only resources that match the entire vendor given.
    compartment_id str
    The OCID of the compartment in which to list resources.
    capabilities Sequence[str]
    A filter to return only resources their capability matches the given capability.
    display_name str
    A filter to return only resources that match the given display name exactly.
    filters Sequence[GetModelsFilter]
    id str
    The ID of the model.
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    vendor str
    A filter to return only resources that match the entire vendor given.
    compartmentId String
    The OCID of the compartment in which to list resources.
    capabilities List<String>
    A filter to return only resources their capability matches the given capability.
    displayName String
    A filter to return only resources that match the given display name exactly.
    filters List<Property Map>
    id String
    The ID of the model.
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    vendor String
    A filter to return only resources that match the entire vendor given.

    getModels Result

    The following output properties are available:

    CompartmentId string
    ModelCollections List<GetModelsModelCollection>
    The list of model_collection.
    Capabilities List<string>
    DisplayName string
    Filters List<GetModelsFilter>
    Id string
    State string
    The lifecycle state of the model.
    Vendor string
    The provider of the base model.
    CompartmentId string
    ModelCollections []GetModelsModelCollection
    The list of model_collection.
    Capabilities []string
    DisplayName string
    Filters []GetModelsFilter
    Id string
    State string
    The lifecycle state of the model.
    Vendor string
    The provider of the base model.
    compartmentId String
    modelCollections List<GetModelsModelCollection>
    The list of model_collection.
    capabilities List<String>
    displayName String
    filters List<GetModelsFilter>
    id String
    state String
    The lifecycle state of the model.
    vendor String
    The provider of the base model.
    compartmentId string
    modelCollections GetModelsModelCollection[]
    The list of model_collection.
    capabilities string[]
    displayName string
    filters GetModelsFilter[]
    id string
    state string
    The lifecycle state of the model.
    vendor string
    The provider of the base model.
    compartment_id str
    model_collections Sequence[GetModelsModelCollection]
    The list of model_collection.
    capabilities Sequence[str]
    display_name str
    filters Sequence[GetModelsFilter]
    id str
    state str
    The lifecycle state of the model.
    vendor str
    The provider of the base model.
    compartmentId String
    modelCollections List<Property Map>
    The list of model_collection.
    capabilities List<String>
    displayName String
    filters List<Property Map>
    id String
    state String
    The lifecycle state of the model.
    vendor String
    The provider of the base model.

    Supporting Types

    GetModelsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetModelsModelCollection

    GetModelsModelCollectionItem

    BaseModelId string
    Capabilities List<string>
    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags Dictionary<string, string>
    Description string
    An optional description of the model.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FineTuneDetails List<GetModelsModelCollectionItemFineTuneDetail>
    FreeformTags Dictionary<string, string>
    Id string
    The ID of the model.
    IsLongTermSupported bool
    LifecycleDetails string
    ModelMetrics List<GetModelsModelCollectionItemModelMetric>
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags Dictionary<string, string>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    TimeDeprecated string
    TimeUpdated string
    Type string
    Vendor string
    A filter to return only resources that match the entire vendor given.
    Version string
    The version of the model.
    BaseModelId string
    Capabilities []string
    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags map[string]string
    Description string
    An optional description of the model.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FineTuneDetails []GetModelsModelCollectionItemFineTuneDetail
    FreeformTags map[string]string
    Id string
    The ID of the model.
    IsLongTermSupported bool
    LifecycleDetails string
    ModelMetrics []GetModelsModelCollectionItemModelMetric
    State string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    SystemTags map[string]string
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    TimeDeprecated string
    TimeUpdated string
    Type string
    Vendor string
    A filter to return only resources that match the entire vendor given.
    Version string
    The version of the model.
    baseModelId String
    capabilities List<String>
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<String,String>
    description String
    An optional description of the model.
    displayName String
    A filter to return only resources that match the given display name exactly.
    fineTuneDetails List<GetModelsModelCollectionItemFineTuneDetail>
    freeformTags Map<String,String>
    id String
    The ID of the model.
    isLongTermSupported Boolean
    lifecycleDetails String
    modelMetrics List<GetModelsModelCollectionItemModelMetric>
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String,String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    timeDeprecated String
    timeUpdated String
    type String
    vendor String
    A filter to return only resources that match the entire vendor given.
    version String
    The version of the model.
    baseModelId string
    capabilities string[]
    compartmentId string
    The OCID of the compartment in which to list resources.
    definedTags {[key: string]: string}
    description string
    An optional description of the model.
    displayName string
    A filter to return only resources that match the given display name exactly.
    fineTuneDetails GetModelsModelCollectionItemFineTuneDetail[]
    freeformTags {[key: string]: string}
    id string
    The ID of the model.
    isLongTermSupported boolean
    lifecycleDetails string
    modelMetrics GetModelsModelCollectionItemModelMetric[]
    state string
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags {[key: string]: string}
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    timeDeprecated string
    timeUpdated string
    type string
    vendor string
    A filter to return only resources that match the entire vendor given.
    version string
    The version of the model.
    base_model_id str
    capabilities Sequence[str]
    compartment_id str
    The OCID of the compartment in which to list resources.
    defined_tags Mapping[str, str]
    description str
    An optional description of the model.
    display_name str
    A filter to return only resources that match the given display name exactly.
    fine_tune_details Sequence[GetModelsModelCollectionItemFineTuneDetail]
    freeform_tags Mapping[str, str]
    id str
    The ID of the model.
    is_long_term_supported bool
    lifecycle_details str
    model_metrics Sequence[GetModelsModelCollectionItemModelMetric]
    state str
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    system_tags Mapping[str, str]
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    time_deprecated str
    time_updated str
    type str
    vendor str
    A filter to return only resources that match the entire vendor given.
    version str
    The version of the model.
    baseModelId String
    capabilities List<String>
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<String>
    description String
    An optional description of the model.
    displayName String
    A filter to return only resources that match the given display name exactly.
    fineTuneDetails List<Property Map>
    freeformTags Map<String>
    id String
    The ID of the model.
    isLongTermSupported Boolean
    lifecycleDetails String
    modelMetrics List<Property Map>
    state String
    A filter to return only resources their lifecycleState matches the given lifecycleState.
    systemTags Map<String>
    System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    timeDeprecated String
    timeUpdated String
    type String
    vendor String
    A filter to return only resources that match the entire vendor given.
    version String
    The version of the model.

    GetModelsModelCollectionItemFineTuneDetail

    GetModelsModelCollectionItemFineTuneDetailTrainingConfig

    GetModelsModelCollectionItemFineTuneDetailTrainingDataset

    Bucket string
    DatasetType string
    Namespace string
    Object string
    Bucket string
    DatasetType string
    Namespace string
    Object string
    bucket String
    datasetType String
    namespace String
    object String
    bucket string
    datasetType string
    namespace string
    object string
    bucket String
    datasetType String
    namespace String
    object String

    GetModelsModelCollectionItemModelMetric

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v3.16.0 published on Wednesday, Jan 28, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate