Support Amazon Bedrock as a provider for OpenCode (via Converse through the AI Gateway)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- aws, python
- Domain
- ai, backend-api-design, cloud
Research direction
Start by tracing the existing Pi integration and the OpenCode provider declaration through launch-time configuration and the 30-minute token refresh. Check how @ai-sdk/amazon-bedrock and the per-model Databricks-Model-Provider-Service header are represented, then verify the generated config survives refresh and that opencode run returns Bedrock output through the gateway.
Written by the indexing model from the issue text.
Description
Request
Let OpenCode route to an Amazon Bedrock Model Provider Service (MPS) through the Databricks AI Gateway, the same way Pi does.
Approach
OpenCode declares providers by npm package. The @ai-sdk/amazon-bedrock provider, given a bearer apiKey (no AWS SigV4, no region) and a baseURL of {workspace}/ai-gateway, builds /model/{id}/converse-stream requests. That is the only dialect the gateway serves for the amazon_bedrock provider type, so it is the right fit. The Databricks-Model-Provider-Service header must ride per-model, since OpenCode overwrites provider-level headers.
The provider block also has to survive OpenCode's launch-time and 30-minute token refresh, which otherwise re-renders the config and drops it.
Verification
Confirmed end to end against a live gateway: OpenCode installs @ai-sdk/amazon-bedrock on first use, the generated config survives a token refresh, and opencode run returns real Bedrock output across Claude, Nova, GPT-family, Grok, and Qwen targets.
Notes
- Codex cannot use Bedrock through the gateway (Converse-only), tracked separately in #476.
- Per-model output-token caps are a known follow-up: some models reject a large
maxTokens(for example Nova's 10k limit).
- Dominant language
- Python
- Stars
- 108
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 239
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databricks/unity-gateway
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
databricks/unity-gateway#1042 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databricks/unity-gateway#1021 · 1 reaction ·
Maintainers usually reply within 1 day
-
feat(codex): support amazon_bedrock Model Provider Services that expose OpenAI-compatible modelsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
databricks/unity-gateway#454 ·
Maintainers usually reply within 1 day
-
ucode opencode ignores the user's own OpenCode configPossibly taken @larsmoan claimed this 47 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
databricks/unity-gateway#391 ·
Maintainers usually reply within 1 day
-
Support Custom $CLAUDE_CONFIG_DIRPossibly taken @eabrouwer3 claimed this 58 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
databricks/unity-gateway#342 ·
Maintainers usually reply within 1 day
All issues in databricks/unity-gateway
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lugassawan/swe-workbench#799 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vllm-project/vllm#61131 ·
Maintainers usually reply within 1 day
-
Non-string form field names raise AttributeError when files are attachedPossibly taken @nightcityblade claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubernetes-client/python#2735 ·
Maintainers usually reply within 1 day
-
desktop help wanted test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day