Skip to content

Add OrcaRouter as a named AI provider - #212

Open
XiaoHuo888-hue wants to merge 1 commit into
bramses:masterfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

Add OrcaRouter as a named AI provider#212
XiaoHuo888-hue wants to merge 1 commit into
bramses:masterfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Scope

Adds a dedicated OrcaRouter provider rather than relying on the generic OpenAI-compatible endpoint, mirroring how this repo already treats OpenRouter-style aggregators. Named routers such as orcarouter/auto pick an upstream per request. OrcaRouter is an OpenAI-compatible gateway that exposes 150+ models behind one API key, and it also provides gateway-level security controls for AI agents.

The provider is wired end-to-end following the existing Z.AI/OpenRouter pattern:

  • orcarouter service constant + model prefix (orcarouter@orcarouter/auto)
  • DEFAULT_ORCAROUTER_CONFIG (https://api.orcarouter.ai)
  • API-key, URL, and default settings in Config.ts (credential-backed, no plaintext-only storage)
  • New OrcaRouterAdapter — OpenAI-compatible /v1 path with model discovery from /v1/models
  • PROVIDER_DEFINITIONS entry with an ownedSecretId (secret-storage migration included automatically)
  • Schema-driven settings UI rows + numeric range, provider detection in ProviderHelpers

I'm an engineer on the OrcaRouter team.

Compatibility and privacy

  • Existing settings/frontmatter keys remain compatible — new keys merge through DEFAULT_SETTINGS with safe empty defaults; no migration needed.
  • Provider/model routing behavior is covered — orcarouter@orcarouter/auto resolves to the new adapter; registry, URL-suffix, and credential tests updated.
  • Tool approval and result-selection flows are preserved — no tool-calling paths touched.
  • No API keys, prompts, note contents, generated bundles, or local files are included.

Validation

  • npm run format:check
  • npm run lint
  • npm run typecheck
  • npm test -- --runInBand (193 passed)
  • npm run build

Manual checks

  • Model discovery: https://api.orcarouter.ai/v1/models returns 192 models including orcarouter/auto (verified live).
  • Desktop/mobile Obsidian interaction not exercised in CI; local build, typecheck, lint, and unit suite are green.

Wire OrcaRouter end-to-end following the Z.AI/OpenRouter provider pattern:
- new orcarouter service constant and model prefix (orcarouter@orcarouter/auto)
- DEFAULT_ORCAROUTER_CONFIG and settings model (API key, URL, defaults)
- OrcaRouterAdapter with /v1 path and /v1/models discovery
- PROVIDER_DEFINITIONS entry with ownedSecretId for secret storage
- settings schema rows, provider detection, docs, and tests

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant