feat(provider): first-class qBraid provider with baked-in models + auth login#9
Open
Kenny-Heitritter wants to merge 2 commits into
Open
feat(provider): first-class qBraid provider with baked-in models + auth login#9Kenny-Heitritter wants to merge 2 commits into
Kenny-Heitritter wants to merge 2 commits into
Conversation
…th login - add QBRAID_MODELS_DEV catalog (Claude Haiku/Sonnet 4.6/Opus 4.8, Gemini 3.5 Flash/3.1 Pro), injected into models database so qbraid provider does not depend on external models.dev - add QBraidAuthPlugin (api-key login): opencode auth login -> qBraid -> paste qbr-at_ token - add CUSTOM_LOADERS.qbraid for QBRAID_API_KEY env autoload + stored-auth credential resolution - point qbraid SDK default baseURL to https://account.qbraid.com/api/ai/v1 - model IDs unprefixed (resolved server-side by AI proxy aliases)
- models.json + generate-models.ts: new model IDs (claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5, gemini-3.5-flash, gemini-3.1-pro) - correct Opus pricing 5/25, Sonnet 4.6 1M context - baseURL -> https://account.qbraid.com/api/ai/v1 - remove Grok (xAI) and stale gpt-4o entries from generator
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
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.
Makes
qbraida first-class opencode provider so users authenticate viaopencode auth loginand the model catalog is baked into the binary (no dependency on an external models.devapi.json).Changes
provider/qbraid-models.ts(new):QBRAID_MODELS_DEVcatalog — Claude 4.5 Haiku, Claude 4.6 Sonnet, Claude Opus 4.8, Gemini 3.5 Flash, Gemini 3.1 Pro. Pricing/limits mirror qbraid-apiMODEL_PRICING.api=https://account.qbraid.com/api/ai/v1,npm=@ai-sdk/qbraid.provider/provider.ts: injectqbraidinto the modelsdatabaseat state build (only if absent — config still overrides). AddCUSTOM_LOADERS.qbraidforQBRAID_API_KEYenv autoload + stored-auth credential resolution, passingapiKey/baseURLto the SDK.plugin/qbraid.ts(new) +plugin/index.ts:QBraidAuthPluginregistered inINTERNAL_PLUGINS.type: "api"login → prompts for a qBraid token (qbr-at_...), stored as standard API credential; loader wiresapiKey+baseURLinto the provider.provider/sdk/qbraid/index.ts: default baseURLapi.qbraid.com/ai/v1→account.qbraid.com/api/ai/v1.UX
opencode auth login→ qBraid → pasteqbr-at_...token.qbraid/claude-sonnet-4-6,qbraid/gemini-3.5-flash, etc.account.qbraid.com/api/ai/v1/chat/completionswithAuthorization: Bearer <token>→ existing qbraid-account proxy validates + bills.Model IDs are unprefixed; the proxy resolves them via
MODEL_ALIASES(see qBraid/qbraid-account#431).Notes
provider.qbraid.options.{baseURL,apiKey}) keeps working unchanged.Verification
bun run typecheck(tsgo --noEmit): 0 errors.bun test test/provider: 220 pass / 0 fail.