Skip to content

feat: add OrcaRouter as an RM provider in DeepScaler - #443

Open
martinzudergaming-a11y wants to merge 1 commit into
microsoft:mainfrom
martinzudergaming-a11y:feat/orcarouter-rm-provider
Open

martinzudergaming-a11y wants to merge 1 commit into
microsoft:mainfrom
martinzudergaming-a11y:feat/orcarouter-rm-provider

Conversation

@martinzudergaming-a11y

Copy link
Copy Markdown

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 — adds ORCAROUTER_API_BASE and ORCAROUTER_RM_MODEL, the same way OAI_RM_MODEL already configures the OpenAI RM. Key is read from the ORCAROUTER_API_KEY environment variable, parallel to how call_oai_rm_llm relies on OPENAI_API_KEY.
  • gad/deepscaler/utils.py — adds call_orcarouter_rm_llm, a byte-for-byte structural copy of call_oai_rm_llm (same retry/backoff, same chat.completions.create payload) that points at https://api.orcarouter.ai/v1.
  • gad/deepscaler/rewards/math_reward.py and gad/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 openai package already required by DeepScaler.

Verification

  • python -m py_compile passes on all four modified files.
  • All four modules import cleanly with PYTHONPATH=gad.
  • Live-tested call_orcarouter_rm_llm against https://api.orcarouter.ai/v1 with the ORCAROUTER_API_KEY environment variable — returned a valid completion ([[YES]]).
  • Unit-style behavior test confirms the fallback chain reaches OrcaRouter only when Gemini and OpenAI both fail, and that OrcaRouter is never called when an earlier provider succeeds.

I'm an engineer on the OrcaRouter team.

Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

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

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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