Skip to content

feat(providers): add OrcaRouter provider - #2384

Open
JinhaoSong322 wants to merge 1 commit into
0xPlaygrounds:mainfrom
JinhaoSong322:add-orcarouter-provider
Open

feat(providers): add OrcaRouter provider#2384
JinhaoSong322 wants to merge 1 commit into
0xPlaygrounds:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

Copy link
Copy Markdown

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

Changes

  • crates/rig-core/src/providers/orcarouter.rs — new provider module implementing OpenAICompatibleProvider:
    • base URL https://api.orcarouter.ai/v1, default model orcarouter/auto
    • completions through the shared GenericCompletionModel / OpenAI Chat Completions path
    • GET /models model listing via the shared lister
    • ORCAROUTER_API_KEY env var for Client::from_env()
  • crates/rig-core/src/providers/mod.rs — register the module and list it in the provider doc
  • tests/orcarouter.rs + tests/providers/orcarouter/ — live smoke tests (ignored, require ORCAROUTER_API_KEY) for completion, streaming, tools, and model listing
  • tests/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 failed
  • cargo test -p rig — 203 passed; the only failure is the pre-existing environment-dependent llamacpp::cassette::loaders::loaders_smoke (reproduces on a clean tree; its cassette scrubs REDACTED_PATH which cannot match a local checkout path)
  • cargo clippy -p rig-core --all-targets — clean
  • cargo fmt --check — clean
  • Live smoke tests against the real OrcaRouter API — all 5 pass (completion, streaming, streaming tools, tools roundtrip, model listing) on the pinned 1.94.0 toolchain

Related

Closes #2383

Disclosure: I'm an engineer on the OrcaRouter team.

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>
@gold-silver-copper

Copy link
Copy Markdown
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

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.

feat(providers): add OrcaRouter provider

2 participants