Skip to content

Feature request: Oracle Cloud Infrastructure (OCI) Generative AI client support #735

Description

@fede-kamel

Problem

Oracle Cloud Infrastructure offers Cohere models through its Generative AI service. Currently, the SDK supports AWS Bedrock as a cloud provider integration, but there is no equivalent support for OCI.

Enterprise customers using OCI need to build custom wrappers to use Cohere models through OCI endpoints, which is error-prone and difficult to maintain across SDK versions.

Proposed Solution

Add OciClient (V1) and OciClientV2 (V2) classes following the same architectural pattern as the existing BedrockClient:

from cohere import OciClient

client = OciClient(
    compartment_id="ocid1.compartment...",
    region="us-chicago-1"
)

# Works like the standard Cohere client
response = client.chat(
    model="command-r-plus",
    messages=[{"role": "user", "content": "Hello"}]
)

Capabilities

  • Full authentication support (config file, instance principal, resource principal, direct credentials)
  • Embed support (all v3 models)
  • Chat with streaming (Command R, Command A models)
  • V2 API support
  • Region-independent — uses display names instead of region-specific OCIDs
  • oci SDK as optional dependency (pip install cohere[oci])

Context

We work with Cohere models at Oracle through the OCI Generative AI service. Having official SDK support would benefit all OCI customers using Cohere models and bring parity with the existing Bedrock integration.

Implementation available in PR #718, with 14 integration tests passing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions