feat(providers): add OrcaRouter provider - #2384
Open
JinhaoSong322 wants to merge 1 commit into
Open
Conversation
Add a named OrcaRouter provider to rig-core, mirroring the existing OpenAI-compatible gateway providers (groq, together, venice). OrcaRouter is an OpenAI-compatible gateway that aggregates thousands of AI models behind one endpoint at https://api.orcarouter.ai/v1. 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 integration drives completions through the shared GenericCompletionModel via OpenAICompatibleProvider (base URL https://api.orcarouter.ai/v1, default model orcarouter/auto, model listing via GET /models, ORCAROUTER_API_KEY env var), with live smoke tests for completion, streaming, tools, and model listing, and registers the provider's wire family and cache-suite status with the layout guards. Verified with cargo build/test/clippy/fmt on the pinned 1.94.0 toolchain; the live smoke tests pass against the real OrcaRouter API. Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
Contributor
|
@JinhaoSong322 Hey there, since you are part of the OrcaRouter team, please provide me with an API key/ credits, so that I can properly test and implement OrcaRouter support for Rig. Email me at stephen@playgrounds.network |
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 a named OrcaRouter provider to rig-core, mirroring the existing OpenAI-compatible gateway providers (
groq,together,venice). OrcaRouter is an OpenAI-compatible gateway that aggregates thousands of AI models behind one endpoint athttps://api.orcarouter.ai/v1. 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.Changes
crates/rig-core/src/providers/orcarouter.rs— new provider module implementingOpenAICompatibleProvider:https://api.orcarouter.ai/v1, default modelorcarouter/autoGenericCompletionModel/ OpenAI Chat Completions pathGET /modelsmodel listing via the shared listerORCAROUTER_API_KEYenv var forClient::from_env()crates/rig-core/src/providers/mod.rs— register the module and list it in the provider doctests/orcarouter.rs+tests/providers/orcarouter/— live smoke tests (ignored, requireORCAROUTER_API_KEY) for completion, streaming, tools, and model listingtests/cassette_cache_prefix.rs/tests/core/provider_layout.rs— register the provider with the layout guards (OpenAI Chat Completions wire family; cache suite not yet recorded)Verification
cargo test -p rig-core --lib— 1552 passed, 0 failedcargo test -p rig— 203 passed; the only failure is the pre-existing environment-dependentllamacpp::cassette::loaders::loaders_smoke(reproduces on a clean tree; its cassette scrubsREDACTED_PATHwhich cannot match a local checkout path)cargo clippy -p rig-core --all-targets— cleancargo fmt --check— cleanRelated
Closes #2383
Disclosure: I'm an engineer on the OrcaRouter team.