-
Notifications
You must be signed in to change notification settings - Fork 85
Description
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
ociSDK 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.