Skip to main content
This doc will help you get started with Oracle Cloud Infrastructure (OCI) Generative AI chat models. OCI Generative AI is a fully managed service providing state-of-the-art, customizable large language models covering a wide range of use cases through a single API. Access ready-to-use pretrained models or create and host fine-tuned custom models on dedicated AI clusters. For detailed documentation, see the OCI Generative AI documentation and API reference.

Overview

Integration details

Model features

Setup

Installation

Credentials

Set up authentication with the OCI CLI (creates ~/.oci/config):
For other auth methods (session tokens, instance principals), see OCI SDK authentication.

Instantiation

Key parameters:
  • model_id - The model to use (see available models)
  • service_endpoint - Regional endpoint (us-chicago-1, eu-frankfurt-1, etc.)
  • compartment_id - Your OCI compartment OCID
  • model_kwargs - Model settings like temperature, max_tokens

Invocation

Multi-turn conversations maintain context across messages:

Streaming

Get responses as they’re generated:

Async

Process multiple requests concurrently for better throughput:

Tool Calling

Give models access to APIs, databases, and custom functions:
Complete tool execution loop - execute the tool and return results:
Parallel tool execution (Llama 4+) for concurrent API calls:

Structured Output

Parse unstructured text into typed data structures for processing:
Use for log parsing, invoice extraction, or data classification pipelines.

Vision & Multimodal

Process images for data extraction, analysis, and automation:
Use cases: Diagram analysis, receipt/invoice parsing, chart data extraction, document processing Vision models: Llama 3.2 Vision (11B, 90B), Gemini 2.0/2.5, Grok 4, Cohere Command A

Gemini Multimodal (PDF, Video, Audio)

Process documents, videos, and audio with Gemini models:
Video/Audio analysis:
Supported formats: PDF, MP4/MOV video, MP3/WAV audio (Gemini 2.0/2.5 only)

Configuration

Control model behavior with model_kwargs:

Available Models

See the OCI model catalog for the complete list and regional availability.

API Reference

For detailed documentation of all ChatOCIGenAI features and configurations, head to the API reference.