Skip to content

feat: add OrcaRouter as a first-class model provider - #7

Closed
lovejones2914-spec wants to merge 1 commit into
sapientinc:mainfrom
lovejones2914-spec:feat/orcarouter-provider
Closed

lovejones2914-spec wants to merge 1 commit into
sapientinc:mainfrom
lovejones2914-spec:feat/orcarouter-provider

Conversation

@lovejones2914-spec

Copy link
Copy Markdown
Contributor

Summary

Praxist calls itself "an autonomous research system for measurable, computer-executable research" — and it already supports routed model access through the OpenRouter provider, so a sustained run can point at an aggregator instead of a single vendor. This PR adds OrcaRouter as a first-class model_provider plugin, mirroring the existing OpenRouter wiring end-to-end. Anyone who runs Praxist with a supported API-backed profile can now pick the OrcaRouter profile and route the research loop's peers through OrcaRouter's OpenAI-compatible gateway — including the orcarouter/auto model that picks a live route per request — instead of treating it as an anonymous custom base URL.

Scope

  • Affected modules or public contracts:
    • New model_provider:orcarouter plugin (praxist/plugins/model_providers/orcarouter/) with api_format: orcarouter, default model orcarouter/auto, and the same */* compatible-model pattern OpenRouter uses.
    • ORCAROUTER_API_KEY wired through the same surfaces OpenRouter already occupies: credential discovery, PRAXIST_LLM_PROVIDER/--model-provider resolution in praxist start, setup profile orcarouter-api, and the research-loop provider env (freeze_provider_env / stage env) that translates it into the Anthropic-protocol ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN the Claude SDK runtime expects.
    • codex_sdk runtime: OrcaRouter joins DeepSeek and OpenRouter as a relay provider (codex-relay upstream https://api.orcarouter.ai/v1), including the reasoning.effort relay override and the lossless context-efficiency default.
    • Redaction of sk-orca- keys in run metadata, and env-read allowlist entries for the new ORCAROUTER_* reads.
  • Compatibility considerations: Additive. No existing provider behavior changes; OpenRouter and DeepSeek paths are untouched. OrcaRouter model names keep their vendor/model prefix exactly like OpenRouter, so operator configs already carrying a vendor/ prefix work against both aggregators.
  • Task-agnostic rationale: Provider selection stays at the operator boundary — no task-specific model is introduced into a generic provider plugin, per docs/guides/model-providers.md.

Verification

  • ruff check praxist/ tests/ — clean.
  • Full test suite: tests/ passes apart from four pre-existing environment-dependent files (test_dev_scripts.py, test_praxist_install_script.py, test_claude_delete_guard_contracts.py, test_agent_runtime_adapter_contracts.py, test_task_project_boundary.py) that fail identically on the unmodified baseline in this container because they require uv, codex, or a python-on-PATH.
  • Added focused tests: plugin manifest contract, provider normalization (orcarouter keeps vendor/model), freeze_provider_env base-URL mapping, CLI provider-resolution cascade, and setup-profile listing.
  • Live test (L3): with ORCAROUTER_API_KEY from the environment, the new provider path loaded, freeze_provider_env resolved ANTHROPIC_BASE_URL=https://api.orcarouter.ai, and a real chat completion against https://api.orcarouter.ai/v1 with orcarouter/auto returned HTTP 200 (routed to qwen3.6-flash). The key was never printed or committed.

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 Praxist 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.

Checklist

  • The change is focused and does not include unrelated generated files.
  • Tests cover the affected behavior.
  • Documentation, templates, examples, and skills were updated where needed.
  • No credentials, private task data, or research-run artifacts are included.
  • New dependencies and copied assets include their source and license terms.
  • I have read .github/CONTRIBUTING.md and the contribution terms in LICENSE.md.

I'm an engineer on the OrcaRouter team. Questions or a different shape you'd prefer — e.g. treating orcarouter as an openai_compatible variant instead of its own api_format — are welcome. Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

Mirror the OpenRouter integration so Praxist users can route through
OrcaRouter's OpenAI-compatible gateway directly:

- new model_provider:orcarouter plugin (api_format "orcarouter",
  default model "orcarouter/auto")
- wire ORCAROUTER_API_KEY through credential discovery, CLI provider
  resolution, setup profiles, and the research-loop provider env
- support OrcaRouter through the codex_sdk compatibility relay and
  Claude SDK base-url normalization
- treat orcarouter model names as vendor-prefixed like openrouter
- redact sk-orca- keys and document the provider in guides and skills

Co-Authored-By: Claude <noreply@anthropic.com>

@rajpratham1 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the change. This is a small and focused cleanup that removes the obsolete praxist/core/redaction.py entry from the Pyrefly excludes configuration. The change is straightforward and the PR checks are passing. LGTM. Approving.

@electrixoul

Copy link
Copy Markdown
Collaborator

Thank you @lovejones2914-spec for contributing the OrcaRouter integration.

We have preserved your functional commit and integrated it into the shared validation/model-provider-expansion branch alongside the other model-provider contributions. The combined branch reconciles the provider registry, setup profile, credential scoping, Claude/Codex runtime routing, model normalization, documentation, and offline provider-contract coverage. It passed the complete local suite (3,091 tests, 6 expected skips), the blocking local CI guardrails, unit/integration coverage, docs generation, and compile checks before being pushed.

Our maintainer workflow is documented here: https://github.com/sapientinc/PRAXIST/blob/main/docs/guides/contributing.md#what-happens-after-submission. The validation branch is now ready for the separately scheduled real-task experiment stage. If that stage confirms there is no cross-task regression, we will promote the validated work to main while retaining your authorship.

We are closing this source PR because its implementation has been transferred to the validation branch, not because the contribution was rejected. This discussion and attribution remain available.

@electrixoul electrixoul closed this Sep 3, 2026
@Glen-SP

Glen-SP commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Update: this shipped. Your OrcaRouter provider is now on main in 34e6de7,
merged via #200, with co-author credit. It resolved through Praxist's own provider
chain and returned 200 in live validation.

Thank you for your contribution, @lovejones2914-spec

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.

4 participants