fix(provider): add OrcaRouter as a built-in provider#3623
Open
jinhaosong-source wants to merge 3 commits into
Open
fix(provider): add OrcaRouter as a built-in provider#3623jinhaosong-source wants to merge 3 commits into
jinhaosong-source wants to merge 3 commits into
Conversation
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
Add OrcaRouter as a built-in LLM provider. OrcaRouter is an OpenAI-compatible model routing gateway that fronts 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, xAI and others behind a single API key, with configurable routing strategies including an adaptive
orcarouter/autorouter. It also provides gateway-level security controls for AI agents.Disclosure: I'm an engineer on the OrcaRouter team.
Context
The OrcaRouter API is OpenAI-compatible (
https://api.orcarouter.ai/v1/chat/completionsandhttps://api.orcarouter.ai/v1/models), so this integration plugs into the existingOpenAIresponse type with no new transport code, following the same shape as the OpenRouter and Ambient entries. Because it is a thin base-URL entry, Forge sessions that use it also inherit OrcaRouter's gateway-level, zero-trust security controls for AI agents (scoped keys, guardrails, an agent firewall, and audit trails), and named routers such asorcarouter/autocan be driven by a routing DSL, YAML + CEL rules that select an upstream per request based on task type, difficulty, and agent session state, all with no client-side code changes.The models endpoint is driven live from the API, so the model catalog stays in sync without further code changes. The full catalog is listed at https://www.orcarouter.ai/models.
Changes
crates/forge_repo/src/provider/provider.jsonorca_routerprovider entry with OpenAI-compatible response typehttps://api.orcarouter.ai/v1/chat/completionshttps://api.orcarouter.ai/v1/models(fetched live)ORCAROUTER_API_KEY)crates/forge_domain/src/provider.rsProviderId::ORCA_ROUTERconstantbuilt_in_providers()"OrcaRouter"display-name mapping"orca_router"arm toFromStrtest_orca_router_from_str,test_orca_router_display_name,test_orca_router_in_built_in_providers) and extendedtest_provider_id_display_nameandtest_codex_in_built_in_providerscrates/forge_app/src/dto/openai/model.rsArchitecture.modalityandArchitecture.tokenizeroptional, and gaveTopProvider.is_moderateda serde default. OrcaRouter's/v1/modelsreturns anarchitectureobject carrying onlyinput_modalities/output_modalitiesand atop_providerwithoutis_moderated; the previous required fields made the whole model list fail to deserialize. None of the three fields is consumed anywhere, so this only loosens parsing, in the same spirit as the existing numeric/string pricing tolerance added for Chutesorcarouter_api_response.jsonfixture (taken from the live API response) andtest_orcarouter_api_response_format, mirroringtest_chutes_api_response_formatcrates/forge_repo/src/provider/provider_repo.rstest_orca_router_configverifying the entry loads with the expected endpoints, auth variable, and URL-driven model sourceREADME.mdHow to verify
forge provider loginand select OrcaRouter, then paste an API key from https://www.orcarouter.ai/console (keys start withsk-orca-)forge, pick a model such asopenai/gpt-4o-mini