Skip to content

refactor(browser): single OpenAI-compatible AI endpoint - #1259

Draft
joepio wants to merge 3 commits into
developfrom
cursor/openai-compatible-provider-be7f
Draft

refactor(browser): single OpenAI-compatible AI endpoint#1259
joepio wants to merge 3 commits into
developfrom
cursor/openai-compatible-provider-be7f

Conversation

@joepio

@joepio joepio commented Aug 6, 2026

Copy link
Copy Markdown
Member

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/completions works the same way.

What went away

  • AIProvider enum / per-provider switches
  • Separate OpenRouter & Ollama SDKs (@openrouter/ai-sdk-provider, ollama-ai-provider-v2)
  • Per-provider model selectors, availability hooks, and transport branches
  • Provider registry scaffolding from the previous revision of this PR

Net: ~1.3k lines removed vs the previous approach on this branch.

What stayed (thin UI only)

  • OpenRouter login button + credits when the base URL is OpenRouter
  • Migration from old openrouter-api-key / ollama-url / openai-compatible localStorage keys
  • Legacy { id, provider } model values still read; stored shape is now { id }

Verification

  • pnpm lint passes
  • vitest aiEndpoint.test.ts + useGenerativeData.test.ts: 11 tests pass
  • tsc --noEmit: no new errors (only pre-existing pairing.test.ts)

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 6, 2026 11:54
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>
@cursor cursor Bot changed the title feat(browser): generic OpenAI-compatible AI provider (supersedes #1258) refactor(browser): single OpenAI-compatible AI endpoint Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants