refactor(browser): single OpenAI-compatible AI endpoint - #1259
Draft
joepio wants to merge 3 commits into
Draft
Conversation
Add one configurable openai-compatible provider (base URL + API key) with presets for OrcaRouter, OpenAI and Groq, instead of a named third vendor. Share createLanguageModel and model-value helpers so gateways do not fan out across transport, settings and the chat ComboBox. Co-authored-by: Joep Meindertsma <joep@ontola.io>
Co-authored-by: Joep Meindertsma <joep@ontola.io>
Replace the OpenRouter / Ollama / openai-compatible provider split with one base URL + API key. Presets fill common gateways; chat and generative features share createEndpointModel. Drop the OpenRouter and Ollama SDKs. Co-authored-by: Joep Meindertsma <joep@ontola.io>
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.
Related Issues
Supersedes #1258 (named OrcaRouter provider). Replaces the earlier multi-provider registry approach on this branch with something smaller.
Summary
One endpoint: base URL + optional API key →
@ai-sdk/openai-compatible.Presets fill the URL for OpenRouter, Ollama (
http://localhost:11434/v1), OrcaRouter, Groq, and OpenAI. Anything else that speaks/v1/chat/completionsworks the same way.What went away
AIProviderenum / per-provider switches@openrouter/ai-sdk-provider,ollama-ai-provider-v2)Net: ~1.3k lines removed vs the previous approach on this branch.
What stayed (thin UI only)
openrouter-api-key/ollama-url/ openai-compatible localStorage keys{ id, provider }model values still read; stored shape is now{ id }Verification
pnpm lintpassesvitestaiEndpoint.test.ts+useGenerativeData.test.ts: 11 tests passtsc --noEmit: no new errors (only pre-existingpairing.test.ts)Checklist