opencode-oci-provider
v0.3.0
Published
OCI GenAI provider for OpenCode with setup wizard (AI SDK V2 compatible)
Downloads
15
Maintainers
Readme
██████╗ ██████╗ ███████╗███╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
██╔═══██╗██╔══██╗██╔════╝████╗ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝
██║ ██║██████╔╝█████╗ ██╔██╗ ██║██║ ██║ ██║██║ ██║█████╗
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║██║ ██║ ██║██║ ██║██╔══╝
╚██████╔╝██║ ███████╗██║ ╚████║╚██████╗╚██████╔╝██████╔╝███████╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
██████╗ ██████╗██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗██╗██████╗ ███████╗██████╗
██╔═══██╗██╔════╝██║ ██╔══██╗██╔══██╗██╔═══██╗██║ ██║██║██╔══██╗██╔════╝██╔══██╗
██║ ██║██║ ██║ ██████╔╝██████╔╝██║ ██║██║ ██║██║██║ ██║█████╗ ██████╔╝
██║ ██║██║ ██║ ██╔═══╝ ██╔══██╗██║ ██║╚██╗ ██╔╝██║██║ ██║██╔══╝ ██╔══██╗
╚██████╔╝╚██████╗██║ ██║ ██║ ██║╚██████╔╝ ╚████╔╝ ██║██████╔╝███████╗██║ ██║
╚═════╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝OCI GenAI provider for OpenCode with interactive setup wizard
⚠️ Independent Community Project — This project has no official affiliation with Oracle Corporation or the OpenCode team. It is a community-built integration that enables OpenCode to work with OCI GenAI services.
Quick Start
1. Run Setup Wizard
npx opencode-oci-provider
# or after installation:
opencode-oci-setupThe wizard will:
- Detect your OCI config profiles
- Let you select a region (with xAI availability indicators)
- Configure compartment ID
- Choose between On-Demand or Dedicated AI Cluster
- Select a model or endpoint
- Test the configuration
- Generate
opencode.jsonand.env.oci-genaifiles
2. Use with OpenCode
After setup, your opencode.json will be configured. Start OpenCode:
opencodeManual Configuration
If you prefer manual setup:
Environment Variables
export OCI_REGION=us-chicago-1
export OCI_COMPARTMENT_ID=ocid1.compartment.oc1..xxxxx
export OCI_CONFIG_PROFILE=DEFAULT
# For dedicated mode:
# export OCI_GENAI_ENDPOINT_ID=ocid1.generativeaiendpoint.oc1..xxxxxopencode.json
{
"provider": {
"oci": {
"npm": "opencode-oci-provider",
"name": "Oracle Cloud Infrastructure",
"options": {
"region": "us-chicago-1",
"compartmentId": "${OCI_COMPARTMENT_ID}"
},
"models": {
"cohere.command-r-plus-08-2024": {
"name": "Cohere Command R+",
"type": "chat"
}
}
}
}
}Available Models
On-Demand Models
| Provider | Model ID | Notes |
|----------|----------|-------|
| Cohere | cohere.command-a-03-2025 | Latest Cohere model |
| Cohere | cohere.command-a-reasoning-08-2025 | With reasoning |
| Cohere | cohere.command-r-plus-08-2024 | Balanced quality |
| Google | google.gemini-2.5-flash | Fast, multimodal |
| Google | google.gemini-2.5-pro | Best Google quality |
| xAI | xai.grok-4-1-fast-reasoning | US regions only, with reasoning |
| xAI | xai.grok-4-1-fast-non-reasoning | US regions only, fastest |
| xAI | xai.grok-code-fast-1 | US regions only, coding-focused |
| Meta | meta.llama-3.3-70b-instruct | Latest Llama |
| Meta | meta.llama-3.1-405b-instruct | Largest Llama |
| OpenAI | openai.gpt-oss-120b | OpenAI compatible |
Region Availability
- US regions (us-chicago-1, us-ashburn-1, us-phoenix-1, us-sanjose-1): All providers including xAI
- Other regions: Cohere, Google, Meta (no xAI)
Dedicated AI Clusters
For production workloads, you can use Dedicated AI Clusters:
- Create a cluster in the OCI Console
- Create an endpoint on the cluster
- Run
opencode-oci-setupand select "Dedicated AI Cluster" - Choose your cluster and endpoint
Prerequisites
- OCI CLI configured (
~/.oci/config) - Node.js 18+
- OCI compartment with GenAI access
Troubleshooting
"Missing compartment ID"
Set OCI_COMPARTMENT_ID environment variable or pass it in options.
"Authentication failed"
Verify your OCI CLI is configured: oci iam region list
"Model not available in region"
xAI models are only available in US regions (us-chicago-1, us-ashburn-1, us-phoenix-1, us-sanjose-1). Use Cohere, Google, or Meta models in other regions.
xAI Grok Reasoning
xAI Grok models control reasoning through model variant selection, not API parameters:
xai.grok-4-1-fast-reasoning— With extended thinkingxai.grok-4-1-fast-non-reasoning— Standard (faster)xai.grok-3-mini/xai.grok-3-mini-fast— Compact models that think before responding
Legal
Independent Project — This is a community project with no affiliation to Oracle Corporation or the OpenCode team. "OCI" and "Oracle Cloud Infrastructure" refer to compatibility with Oracle's services, not endorsement by Oracle. "OpenCode" refers to compatibility with the OpenCode CLI tool.
License — MIT
Disclaimer — This software is provided "as is" without warranty. The authors and Oracle Corporation bear no liability for damages arising from its use. You are responsible for compliance with all applicable laws and Oracle's terms of service.
Created by Alexander Cedergren
