feat: add OrcaRouter as a named LLM provider adapter - #2243
feat: add OrcaRouter as a named LLM provider adapter#2243XiaoHuo888-hue wants to merge 2 commits into
Conversation
Adds OrcaRouter as a branded OpenAI-compatible LLM adapter, mirroring the existing NVIDIA Build adapter: users pick a model and supply an OrcaRouter API key, and the endpoint (https://api.orcarouter.ai/v1) is preconfigured and overridable. - base1.py: OrcaRouterLLMParameters reusing the shared branded OpenAI-compatible validation helper - llm1/orcarouter.py: OrcaRouterLLMAdapter + schema + icon - llm1/__init__.py: export the new adapter - tests: registration, model prefixing, api_base default/override, and schema checks for the OrcaRouter adapter Co-Authored-By: Claude <noreply@anthropic.com>
|
|
for more information, see https://pre-commit.ci
|
|
| Filename | Overview |
|---|---|
| unstract/sdk1/src/unstract/sdk1/adapters/base1.py | Adds OrcaRouter parameters through the existing branded OpenAI-compatible validation path, preserving endpoint overrides and repeated-validation behavior. |
| unstract/sdk1/src/unstract/sdk1/adapters/llm1/init.py | Exports the new adapter while remaining compatible with the category's import-time registration mechanism. |
| unstract/sdk1/src/unstract/sdk1/adapters/llm1/orcarouter.py | Defines unique OrcaRouter metadata, provider identity, adapter type, and icon path following established LLM adapter conventions. |
| unstract/sdk1/src/unstract/sdk1/adapters/llm1/static/orcarouter.json | Adds a configuration schema consistent with the existing branded OpenAI-compatible adapter schema pattern. |
| unstract/sdk1/tests/test_branded_openai_adapters.py | Extends coverage for registration, model prefixing, endpoint fallback and override behavior, and schema defaults. |
Sequence Diagram
sequenceDiagram
participant User
participant UI as Adapter Settings
participant SDK as OrcaRouter Adapter
participant LiteLLM
participant OrcaRouter
User->>UI: Configure model and API key
UI->>SDK: Submit adapter metadata
SDK->>SDK: Apply default API base and custom_openai prefix
SDK->>LiteLLM: Send validated completion parameters
LiteLLM->>OrcaRouter: OpenAI-compatible request
OrcaRouter-->>LiteLLM: Completion response
LiteLLM-->>User: Return completion
Reviews (1): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile



Summary
Adds OrcaRouter as a named LLM provider. OrcaRouter is an OpenAI-compatible model routing gateway that exposes 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax, xAI and others behind a single endpoint and API key, with gateway-level security controls for AI agents.
I'm an engineer on the OrcaRouter team.
What this changes
unstract/sdk1/src/unstract/sdk1/adapters/llm1/orcarouter.py: theOrcaRouterLLMAdapteradapter class (provider idorcarouter, base URLhttps://api.orcarouter.ai/v1)unstract/sdk1/src/unstract/sdk1/adapters/base1.py:OrcaRouterLLMParameters, reusing the shared branded OpenAI-compatible validation helper so the endpoint is preconfigured but overridableunstract/sdk1/src/unstract/sdk1/adapters/llm1/static/orcarouter.json: the adapter form schema (model + API key, reasoning toggle)unstract/sdk1/src/unstract/sdk1/adapters/llm1/__init__.py: exports the new adapterfrontend/public/icons/adapter-icons/OrcaRouter.png: adapter logounstract/sdk1/tests/test_branded_openai_adapters.py: unit tests for registration, model prefixing, api_base default/override, and schemaWhy a separate provider rather than the OpenAI-compatible escape hatch
This mirrors how OpenRouter and NVIDIA Build are wired in this repo — branded adapters with the endpoint preconfigured, so the model picker, docs and config reference stay consistent. OrcaRouter routes through the same
custom_openai/path LiteLLM already uses for NVIDIA Build, with the OrcaRouter base URL pinned as the default.How to use it
sk-orca-).deepseek/deepseek-v4-flashoropenai/gpt-5.5.Verification
pytest unstract/sdk1/tests/test_branded_openai_adapters.py→ 59 passed (including the 5 new OrcaRouter cases; 9 deselected require the fullllama-indexstack not present in the local env)ruff checkon the changed files → no new findings (2 pre-existing import-sort notes on pristinemain)custom_openai/deepseek/deepseek-v4-flash+https://api.orcarouter.ai/v1) with a realsk-orca-key → HTTP 200, valid completion content returned