Skip to content

feat: add OrcaRouter as a named provider - #420

Open
XiaoHuo888-hue wants to merge 1 commit into
s2b-dev:devfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

feat: add OrcaRouter as a named provider#420
XiaoHuo888-hue wants to merge 1 commit into
s2b-dev:devfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a first-class provider template, mirroring the existing OpenRouter integration.

OrcaRouter is an OpenAI-compatible gateway that routes to 200+ frontier models through a single endpoint (https://api.orcarouter.ai/v1, key prefix 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.

Changes

  • New provider definition (src/providers/orcarouter.ts): OpenAI-compatible chat + embedding instances pointed at https://api.orcarouter.ai/v1, model discovery via GET /v1/models, and embedding discovery filtered by supported_endpoint_types/name heuristics.
  • Registry wiring: registered as a ProviderTemplateId, added to PROVIDER_TEMPLATES, the template→definition switch, and re-exported from src/providers/index.ts.
  • UI: OrcaRouterLogo for the provider picker; added to the picker order and logo map in ProviderSetup.svelte.
  • Capability/metadata plumbing (mirrors OpenRouter):
    • orcarouterModels.ts — model metadata cache + capability extraction.
    • Vision detection in AgentManager.resolveVisionSupport.
    • Model metadata hydration in modelMetadataNormalizer.ts (context window, pricing, tool/vision/structured-output capabilities).
    • Embedding batch size (100), native-PDF capability, vendor classification, and embedding max-input-tokens default.
  • Tests (test/providers/orcarouter.test.ts): 5 tests covering template registration, definition shape, missing-key validation, and chat-instance construction.

Testing

  • bun run check (svelte-check): 0 errors, 0 warnings.
  • bun run test: 1569 passed (1564 baseline + 5 new).
  • bun run lint: unchanged from baseline (20 pre-existing diagnostics, none in new code).
  • bun run build: production build succeeds.
  • L3 live test against the OrcaRouter API with a real key: orcarouter/auto chat returns 200, and openai/text-embedding-3-small embeddings return 1536-dim vectors.

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

Adds OrcaRouter (https://www.orcarouter.ai) as a first-class provider
template, mirroring the existing OpenRouter integration. OrcaRouter is an
OpenAI-compatible gateway routing to 200+ frontier models through a single
endpoint, and also runs gateway-level, zero-trust security for AI agents on
the same endpoint.

Changes:
- New orcarouter provider definition (chat + embeddings + model discovery)
- Register template in provider registry / ProviderTemplateId union
- Add OrcaRouterLogo for the provider picker grid
- Wire model metadata hydration, embedding batch size, vision detection,
  vendor classification, and native-PDF capability
- Add orcarouter.test.ts (5 tests)

Verified: svelte-check clean, 1569 vitest tests pass (5 new), biome lint
unchanged from baseline, production build succeeds, and L3 live-tested
chat + embeddings against the OrcaRouter API.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown

Greptile Summary

Adds OrcaRouter as a named OpenAI-compatible provider with chat and embedding discovery, metadata hydration, capability handling, registry integration, and provider-picker UI.

  • Adds authenticated OrcaRouter chat and embedding instances plus model-catalog caching.
  • Integrates OrcaRouter into model metadata, vision/PDF handling, vendor classification, and vector-store defaults.
  • Adds provider registration and construction tests.
  • Leaves the cloud-data FAQ’s provider list out of sync with the new cloud provider.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking documentation correction needed so users understand that OrcaRouter is also a cloud provider.

The provider integration has no established blocking defect, but the updated documentation now gives an incomplete answer about which providers can transmit eligible vault content to the cloud.

Files Needing Attention: README.md

Important Files Changed

Filename Overview
src/providers/orcarouter.ts Defines OrcaRouter authentication, chat and embedding clients, and model-discovery behavior.
src/providers/orcarouterModels.ts Adds a cached model catalog and derives OrcaRouter capabilities from catalog metadata.
src/lib/modelMetadataNormalizer.ts Hydrates OrcaRouter names, context limits, pricing, and capability metadata.
src/hooks/useAvailableModels.svelte.ts Loads OrcaRouter metadata and incorporates it into reactive chat and embedding model options.
src/providers/index.ts Registers, constructs, and exports the new provider template.
README.md Advertises OrcaRouter but leaves the cloud-data FAQ provider enumeration incomplete.
test/providers/orcarouter.test.ts Covers template registration, provider shape, missing-key validation, and chat-client construction.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Picker[Provider picker] --> Registry[Provider registry]
    Registry --> Orca[OrcaRouter provider]
    Orca --> Catalog[OrcaRouter models API]
    Catalog --> Discovery[Chat and embedding discovery]
    Catalog --> Metadata[Capability and pricing metadata]
    Orca --> Chat[OpenAI-compatible chat]
    Orca --> Embeddings[OpenAI-compatible embeddings]
    Embeddings --> VectorStore[Vector store indexing]
Loading

Comments Outside Diff (1)

  1. README.md, line 107 (link)

    P2 Cloud-provider FAQ omits OrcaRouter

    The FAQ names only OpenAI, Anthropic, and OpenRouter as cloud providers even though this change adds OrcaRouter, so users can incorrectly infer that eligible vault content sent through OrcaRouter remains local.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: README.md
    Line: 107
    
    Comment:
    **Cloud-provider FAQ omits OrcaRouter**
    
    The FAQ names only OpenAI, Anthropic, and OpenRouter as cloud providers even though this change adds OrcaRouter, so users can incorrectly infer that eligible vault content sent through OrcaRouter remains local.
    
    
    
    ---
    
    For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Claude Code

Fix all with Greploop Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
README.md:107
**Cloud-provider FAQ omits OrcaRouter**

The FAQ names only OpenAI, Anthropic, and OpenRouter as cloud providers even though this change adds OrcaRouter, so users can incorrectly infer that eligible vault content sent through OrcaRouter remains local.

```suggestion
Only if you choose a cloud AI provider (OpenAI, Anthropic, OpenRouter, or OrcaRouter) **and** the notes involved are not marked private. Search and graph features run entirely locally. With Ollama, everything stays on your machine. And even with a cloud provider configured, the built-in privacy controls let you mark notes or folders as private — those are blocked from being read, embedded, or sent to any untrusted (cloud) provider.
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat: add OrcaRouter as a named provider" | Re-trigger Greptile

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