feat: add OrcaRouter as a named provider - #420
Conversation
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 SummaryAdds OrcaRouter as a named OpenAI-compatible provider with chat and embedding discovery, metadata hydration, capability handling, registry integration, and provider-picker UI.
Confidence Score: 4/5The 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
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]
|
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 prefixsk-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
src/providers/orcarouter.ts): OpenAI-compatible chat + embedding instances pointed athttps://api.orcarouter.ai/v1, model discovery viaGET /v1/models, and embedding discovery filtered bysupported_endpoint_types/name heuristics.ProviderTemplateId, added toPROVIDER_TEMPLATES, the template→definition switch, and re-exported fromsrc/providers/index.ts.OrcaRouterLogofor the provider picker; added to the picker order and logo map inProviderSetup.svelte.orcarouterModels.ts— model metadata cache + capability extraction.AgentManager.resolveVisionSupport.modelMetadataNormalizer.ts(context window, pricing, tool/vision/structured-output capabilities).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.orcarouter/autochat returns 200, andopenai/text-embedding-3-smallembeddings return 1536-dim vectors.Disclosure: I'm an engineer on the OrcaRouter team.