feat(generators): add OrcaRouter generator - #2101
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
Conversation
Add a named OrcaRouter generator that mirrors the existing GroqChat OpenAI-compatible provider pattern, exposing OrcaRouter as a first-class --target_type. Uses the OpenAI-compatible API at https://api.orcarouter.ai/v1 with the ORCAROUTER_API_KEY environment variable. Includes docs (generators/orcarouter.rst + index entry), README usage, and tests (dedicated test file plus shared OpenAI-compatible coverage). Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
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
Adds OrcaRouter as a named, first-class generator (
--target_type orcarouter), mirroring the existingGroqChatOpenAI-compatible provider pattern.OrcaRouter is an OpenAI-compatible gateway that routes to a large catalogue of models. 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.
The new
garak.generators.orcarouter.OrcaRoutergenerator:https://api.orcarouter.ai/v1(OpenAI-compatible chat/completions)ORCAROUTER_API_KEYenvironment variable--target_name orcarouter/autofor model auto-routingGroqChat(single-generation chat only)Changes
garak/generators/orcarouter.py— new generator (mirrorsgroq.py)docs/source/generators/orcarouter.rst+docs/source/index_generators.rst— Sphinx docs entryREADME.md— add OrcaRouter to the supported-providers list and the "Intro to generators" sectiontests/generators/test_orcarouter.py— dedicated tests (mirrortest_groq.py)tests/generators/test_openai_compatible.py— addOrcaRouterto the shared OpenAI-compatible coveragetests/generators/test_generators.py— excludeorcarouterfrom the non-conversation-signature test (same asgroq)Why this isn't duplicating an existing PR
Searching
NVIDIA/garakfororcarouterin PRs/issues/code returns no existing work; this is the first OrcaRouter integration for garak.Verification
python -m pytest tests/generators/test_orcarouter.py tests/generators/test_openai_compatible.py tests/generators/test_generators.py tests/test_docs.py→ 821 passed, 6 skippedblack --checkon new files → cleanORCAROUTER_API_KEY:OrcaRouter(name="orcarouter/auto")._call_model(conversation, 1)→ HTTP 200, responseORCA-FULL-OK.generate(conversation, 1)→ HTTP 200, responseORCA-FULL-OKhttpx→ HTTP 200python -m garak --list_generatorsshowsorcarouter/orcarouter.OrcaRouterDisclosure: I'm an engineer on the OrcaRouter team.
This PR was written primarily with Claude Code (AI assistance).