Skip to main content
Version: v2.4.0

Oracle Cloud Infrastructure

Use this guide to configure OCI outside the client interface. For the interactive workflow, see OCI Configuration.

Prerequisites

To use API-key authentication, generate an API key and collect the configuration values OCI provides.

OCI CLI Configuration File

Depending on the runtime environment, either bare metal or a container, your local OCI CLI configuration file can configure the AI Optimizer for OCI access.

In addition to the standard configuration file entries, add these entries to enable OCI Generative AI services:

  • genai_region: the region for the OCI Generative AI service
  • genai_compartment_id: the compartment OCID for the OCI Generative AI service

Bare Metal

During startup, the AI Optimizer automatically looks for and consumes an OCI CLI configuration file for OCI access.

Container

When starting the container, volume-mount the configuration directory at /app/.oci.

For example:

podman run -v ~/.oci:/app/.oci -p 8501:8501 -it --rm ai-optimizer-aio

Environment Variables

OCI can also be configured with OCI CLI environment variables, including variables for OCI Generative AI.

Authentication Types

The following authentication types are supported through the AIO_OCI_CLI_AUTH variable or the authentication field in the configuration file:

ValueDescriptionUse Case
api_keyAPI key with user, fingerprint, tenancy, and private keyDefault; local development and service accounts
instance_principalInstance Principals security tokenOCI compute instances with dynamic group policies
resource_principalResource Principals signerOCI Functions and other resource-principal-enabled services
oke_workload_identityOKE workload identity resource principalPods running on Oracle Kubernetes Engine
security_tokenSecurity token from file with private keyOCI Cloud Shell and token-based authentication

Loading OCI GenAI Models at Startup

When a usable OCI profile already has a GenAI compartment OCID and region persisted—from a previous configuration, a configuration file, or environment variables—the AI Optimizer loads that region's models automatically at startup.

For the interactive alternative, see Loading OCI GenAI Models.