feat: add OrcaRouter as an RM provider in DeepScaler - #443
Open
martinzudergaming-a11y wants to merge 1 commit into
Open
feat: add OrcaRouter as an RM provider in DeepScaler#443martinzudergaming-a11y wants to merge 1 commit into
martinzudergaming-a11y wants to merge 1 commit into
Conversation
Add a named OrcaRouter provider to DeepScaler's outcome reward model (ORM) path, mirroring the existing OpenAI RM client. OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents (https://www.orcarouter.ai). It exposes a provider/model namespace across many models through a single endpoint, so the new call_orcarouter_rm_llm mirrors call_oai_rm_llm but points at https://api.orcarouter.ai/v1 with the ORCAROUTER_API_KEY env var. Co-Authored-By: Claude <noreply@anthropic.com>
|
martinzudergaming-a11y please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
Summary
DeepScaler's outcome-reward-model (ORM) path currently falls back to a single OpenAI client (
call_oai_rm_llm) when the Gemini ORM is unavailable. This PR adds OrcaRouter as a first-class, named RM provider so the ORM fallback can be routed through the OrcaRouter gateway.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 OrcaRouter as a first-class provider means DeepScaler 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.
Design
The new provider mirrors the existing OpenAI RM wiring exactly, staying fully parallel to
call_oai_rm_llm:gad/deepscaler/globals.py— addsORCAROUTER_API_BASEandORCAROUTER_RM_MODEL, the same wayOAI_RM_MODELalready configures the OpenAI RM. Key is read from theORCAROUTER_API_KEYenvironment variable, parallel to howcall_oai_rm_llmrelies onOPENAI_API_KEY.gad/deepscaler/utils.py— addscall_orcarouter_rm_llm, a byte-for-byte structural copy ofcall_oai_rm_llm(same retry/backoff, samechat.completions.createpayload) that points athttps://api.orcarouter.ai/v1.gad/deepscaler/rewards/math_reward.pyandgad/deepscaler/rewards/judge_reward.py— the ORM fallback chain becomes Gemini → OpenAI → OrcaRouter. The existing"[[YES]]"gate is preserved, and each fallback now guards against a non-string return before substring-matching.No dependency is added — the code uses the
openaipackage already required by DeepScaler.Verification
python -m py_compilepasses on all four modified files.PYTHONPATH=gad.call_orcarouter_rm_llmagainsthttps://api.orcarouter.ai/v1with theORCAROUTER_API_KEYenvironment variable — returned a valid completion ([[YES]]).I'm an engineer on the OrcaRouter team.
Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter