Skip to content

feat: add OrcaRouter as a named embedding provider - #205

Merged
nullure merged 1 commit into
CaviraOSS:mainfrom
JinhaoSong322:add-orcarouter-provider
Aug 20, 2026
Merged

feat: add OrcaRouter as a named embedding provider#205
nullure merged 1 commit into
CaviraOSS:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

Copy link
Copy Markdown

📋 Description

Add OrcaRouter as a first-class, named embedding provider, mirroring the existing siray/minimax OpenAI-compatible adapter pattern.

OrcaRouter is an OpenAI-compatible AI gateway at https://api.orcarouter.ai/v1 (API keys start with sk-orca-). It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

Python SDK (openmemory-py)

  • New OrcaRouterAdapter (chat + single/batch embeddings via the OpenAI-compatible API)
  • Env config: ORCAROUTER_API_KEY, OM_ORCAROUTER_BASE_URL (default https://api.orcarouter.ai/v1), OM_ORCAROUTER_MODEL, OM_ORCAROUTER_EMBEDDING_MODEL
  • emb_dispatch() routes the orcarouter provider

JS SDK / server (openmemory-js)

  • env exposes orcarouter settings (base URL defaults to https://api.orcarouter.ai/v1)
  • emb_orcarouter() / emb_batch_orcarouter() for single and batch embeddings
  • get_model() resolves per-sector defaults from models.yml
  • getEmbeddingInfo() reports orcarouter config; simple-mode batch path enabled

Dashboard

  • Settings page lists orcarouter in the embedding provider select and adds OrcaRouter base URL / model override / API key fields
  • Settings API masks ORCAROUTER_API_KEY

Config / docs

  • models.yml per-sector orcarouter defaults
  • .env.example, docs/mcp.md, README.md updated

🔄 Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 📚 Documentation update
  • 🧪 Test updates

🧪 Testing

  • I have tested this change locally
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Python: tests/test_orcarouter.py (18 unit tests) + existing test_minimax.py / test_omnibus.py all pass (27 passed, 3 skipped — identical to a clean upstream checkout). JS: full vitest suite passes (9 files / 47 tests). Live test against the OrcaRouter API (/v1/chat/completions + /v1/embeddings) returns HTTP 200 with the real key.

🔍 Code Review Checklist

  • Code follows the project's coding standards
  • Self-review of the code has been performed
  • Code is properly commented, particularly in hard-to-understand areas
  • Changes generate no new warnings
  • Any dependent changes have been merged and published

📚 Related Issues

N/A

🚀 Deployment Notes

No deployment changes required. Users opt in by setting OM_EMBEDDINGS=orcarouter and ORCAROUTER_API_KEY.

📋 Additional Context

Disclosure: I'm an engineer on the OrcaRouter team.

Add OrcaRouter (https://api.orcarouter.ai/v1) as a first-class embedding
provider, mirroring the existing siray/minimax OpenAI-compatible adapter
pattern.

Python SDK:
- New OrcaRouterAdapter (chat + embeddings via OpenAI-compatible API)
- Env config: ORCAROUTER_API_KEY, OM_ORCAROUTER_BASE_URL,
  OM_ORCAROUTER_MODEL, OM_ORCAROUTER_EMBEDDING_MODEL
- emb_dispatch() handles the orcarouter provider

JS SDK / server:
- env.cfg exposes orcarouter settings (base URL defaults to
  https://api.orcarouter.ai/v1)
- emb_orcarouter() + emb_batch_orcarouter() for single/batch embeddings
- get_model() resolves per-sector defaults from models.yml
- getEmbeddingInfo() reports orcarouter config

Dashboard:
- Settings page lists orcarouter in the embedding provider select and
  adds OrcaRouter base URL / model override / API key fields
- Settings API masks ORCAROUTER_API_KEY

Docs/config:
- models.yml per-sector orcarouter defaults
- .env.example, docs/mcp.md, README updated
- Unit tests for the adapter (Python) and provider wiring (JS)

Verified: Python 18+1 unit tests pass, JS 47 tests pass, live chat and
embeddings against the OrcaRouter API return HTTP 200.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>

@nullure nullure left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nullure
nullure merged commit 7a5e7c8 into CaviraOSS:main Aug 20, 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