Repository navigation
feat: add OrcaRouter as a named backend - #183
Open
zsanig22-dotcom wants to merge 1 commit into
Open
zsanig22-dotcom wants to merge 1 commit into
zsanig22-dotcom wants to merge 1 commit into
Conversation
Add `orcarouter` as a first-class backend mirroring the existing `openrouter` wiring: it dispatches to OpenAIClient with a default base_url of https://api.orcarouter.ai/v1 and auto-loads ORCAROUTER_API_KEY when no api_key is passed. Also updates the ClientBackend literal, README, and the docs (backends, api reference, and getting-started).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
RLM's whole pitch is swapping
llm.completion(prompt, model)for a recursiverlm.completion(prompt, model)that can programmatically examine, decompose, and recursively call itself over near-infinite contexts. When you're chaining sub-LM calls that way, every hop goes through your model provider — and the way you reach those models shouldn't force you to pick a single vendor or a bare custombase_url.This PR adds
orcarouteras a first-class backend, mirroring how the existingopenrouterbackend is wired inrlm/clients/__init__.pyandrlm/clients/openai.py.What's included
rlm/clients/__init__.py: neworcarouterbranch inget_client()that dispatches toOpenAIClientwithbase_urldefaulting tohttps://api.orcarouter.ai/v1— exactly the same pattern as theopenrouterandvercelbranches.rlm/clients/openai.py: auto-loadsORCAROUTER_API_KEYwhenapi_keyis omitted andbase_urlmatches the OrcaRouter endpoint, so the key is picked up from the environment likeOPENROUTER_API_KEY.rlm/core/types.py:"orcarouter"added to theClientBackendliteral.docs/api/rlm.md(backend literal + kwargs table),docs/getting-started.md, and the docs site'sbackendsandapipages.tests/test_imports.pyasserting theorcarouterbackend resolves toOpenAIClientwith the correct base URL.Usage looks like the existing OpenRouter snippet:
Why OrcaRouter
OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding
orcarouteras a first-class provider means RLM users can use that stack directly, without treating OrcaRouter as an anonymous custom base URL. 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.Verification
ruff check .andruff format --check .pass (0.14.10).pytest tests/ --ignore=tests/repl/test_modal_repl.py --ignore=tests/clients/— 251 passed, including the newtest_orcarouter_backend_dispatch.https://api.orcarouter.ai/v1through the new backend path:client.completion("Reply with exactly: ORCAOK")returnedORCAOK(200, token usage tracked).Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
I'm an engineer on the OrcaRouter team.