-
Notifications
You must be signed in to change notification settings - Fork 5.6k
feat: add Unbound as a provider #7584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vigneshsubbiah16
wants to merge
9
commits into
anomalyco:dev
Choose a base branch
from
websentry-ai:feat/add-unbound-provider
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: add Unbound as a provider #7584
vigneshsubbiah16
wants to merge
9
commits into
anomalyco:dev
from
websentry-ai:feat/add-unbound-provider
+538
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add Unbound Security (https://getunbound.ai) as a first-class provider for secure, compliant AI access through their AI Gateway. Changes: - Add Unbound provider definition with OpenAI-compatible API support - Add custom loader that dynamically fetches available models from the gateway - Add Unbound icon SVG - Update provider icon types Configuration: - Set UNBOUND_API_KEY environment variable, or - Use /connect command to authenticate, or - Configure in opencode.json: { "provider": { "unbound": { "options": { "apiKey": "your-key", "baseURL": "https://api.getunbound.ai/v1" } } } } Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
- Use model.parameters.context_window and model.parameters.max_tokens - Parse pricing data from model.pricing object - Use conservative default of 4096 for max_tokens fallback Co-Authored-By: Claude Opus 4.5 <[email protected]>
Based on Roo-Code implementation reference: - Add X-Unbound-Metadata header with app label for analytics tracking - Support both nested (model.parameters) and flat field structures - Detect prompt caching support from API response - Support both snake_case and camelCase field names from API Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Cache Config.get() to avoid redundant async calls (performance) - Add logging when models API returns non-OK response (debuggability) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Simplify custom loader with cleaner patterns (38 lines reduced) - Use nullish coalescing (??) consistently - Cache Config.get() to avoid redundant async calls - Add 10 unit tests covering: - Loading from env variable and config - Custom baseURL configuration - Model fetching and parsing - Pricing data parsing - X-Unbound-Metadata header - API failure fallback - Env variable precedence - disabled_providers support Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #7594
Adds Unbound as a provider to opencode. Docs: https://docs.getunbound.ai/
Changes:
/modelsendpointX-Unbound-Metadataheader for analyticsConfiguration:
export UNBOUND_API_KEY=your-api-keyVerification:
opencode modelslists Unbound modelsPost Merge: Add opencode support to the Unbound docs.