Configuration

Details
This page shows version v0.0.0 (dev). The current version can be found here.

The Oracle AI Optimizer and Toolkit (the AI Optimizer) can be configured using environment files (.env.*) to pre-configure settings at startup. This is optional — the application will start and function without any environment file, but features like RAG, settings persistence, and the Testbed require access to a “CORE” database.

How It Works

On startup, the AI Optimizer loads variables from a .env.{AIO_ENV} file located in the src/ directory. The AIO_ENV environment variable determines which file is loaded, defaulting to dev if not set.

AIO_ENV ValueFile Loaded
dev (default)src/.env.dev
prdsrc/.env.prd
customsrc/.env.{custom}

Variables set in the .env.* file will not overwrite existing environment variables. This means exported environment variables and container ENV directives always take precedence.

Precedence

The AI Optimizer follows this precedence order (highest to lowest):

  1. Exported environment variables (e.g. export AIO_DB_USERNAME=demo)
  2. Variables in the .env.* file
  3. Config file values (e.g. ~/.oci/config)
  4. Application defaults

Getting Started

To create an environment file, copy the provided example:

cp src/.env.example src/.env.dev

Edit src/.env.dev and uncomment/set the values you need.

No configuration required

The AI Optimizer will start without any .env.* file or environment variables set. However, to persist settings across restarts and to enable features like RAG and the Testbed, at a minimum a database should be configured.

Available Variables

The following variables can be set in the .env.* file. All variables use the AIO_ prefix.

Authentication

VariableDescriptionDefault
AIO_API_KEYAPI key for authenticating requests to the API Server. If not set, a key is auto-generated at startup and can be obtained from the API Server page.(auto-generated)

Database

Database variables configure the CORE database connection. For more details, see Database Configuration.

VariableDescription
AIO_DB_USERNAMEDatabase username
AIO_DB_PASSWORDDatabase password
AIO_DB_DSNConnection string or TNS alias
AIO_DB_WALLET_PASSWORD(Optional) Wallet password for mTLS
AIO_DB_POOL_SIZEConnection pool size (default: 5)

Logging

VariableDescriptionDefault
AIO_LOG_LEVELPython logging levelINFO

Server

VariableDescriptionDefault
AIO_SERVER_URLURL the client uses to reach the API Server(auto-detected)
AIO_SERVER_URL_PREFIXURL path prefix for the API Server (e.g. /optimizer)(none)
AIO_SERVER_PORTAPI Server listen port8000
AIO_SERVER_SSLEnable TLS for the API Serverfalse
AIO_SERVER_SSL_CERT_FILEPath to TLS certificate (PEM). If SSL is enabled without this, a self-signed certificate is generated.(none)
AIO_SERVER_SSL_KEY_FILEPath to TLS private key (PEM)(none)

Client

VariableDescriptionDefault
AIO_CLIENT_ADDRESSClient listen addresslocalhost
AIO_CLIENT_URL_PREFIXURL path prefix for the Client(none)
AIO_CLIENT_PORTClient listen port8501
AIO_CLIENT_COOKIE_SECRETSecret for client session cookies(none)
AIO_CLIENT_SSLEnable TLS for the Clientfalse
AIO_CLIENT_SSL_CERT_FILEPath to TLS certificate (PEM)(none)
AIO_CLIENT_SSL_KEY_FILEPath to TLS private key (PEM)(none)

OCI CLI Overrides

These override the DEFAULT OCI profile. For more details, see OCI Configuration.

VariableDescription
AIO_OCI_CLI_AUTHAuth type (e.g. api_key, instance_principal)
AIO_OCI_CLI_TENANCYTenancy OCID
AIO_OCI_CLI_REGIONOCI region
AIO_OCI_CLI_USERUser OCID
AIO_OCI_CLI_FINGERPRINTAPI key fingerprint
AIO_OCI_CLI_KEY_FILEPath to private key (PEM)
AIO_OCI_CLI_KEY_CONTENTInline private key content
AIO_OCI_CLI_PASSPHRASEPrivate key passphrase
AIO_OCI_CLI_SECURITY_TOKEN_FILEPath to security token file

OCI GenAI

VariableDescription
AIO_GENAI_COMPARTMENT_IDCompartment OCID for OCI GenAI inference
AIO_GENAI_REGIONRegion for the OCI GenAI service endpoint

Model Overrides

These set API keys or URLs to automatically enable models at startup.

VariableDescription
AIO_COHERE_API_KEYCohere API key
AIO_OPENAI_API_KEYOpenAI API key
AIO_PPLX_API_KEYPerplexity AI API key
AIO_ON_PREM_OLLAMA_URLOllama API URL (e.g. http://127.0.0.1:11434)
AIO_ON_PREM_HF_URLHuggingFace TEI URL (e.g. http://127.0.0.1:8080)
AIO_ON_PREM_VLLM_URLvLLM API URL (e.g. http://localhost:8000/v1)