feat(providers): add OrcaRouter as a first-class model provider - #2779
Open
JinhaoSong322 wants to merge 1 commit into
Open
feat(providers): add OrcaRouter as a first-class model provider#2779JinhaoSong322 wants to merge 1 commit into
JinhaoSong322 wants to merge 1 commit into
Conversation
Add OrcaRouter as a named OpenAI-compatible gateway provider, mirroring the existing openai/groq/cerebras wiring: - protocol: register orcarouter in ModelProviderSchema, add OrcaRouterModelId/ OrcaRouterModelName schemas (gateway aliases like orcarouter/auto and vendor-prefixed models like orcarouter/deepseek/deepseek-v4-pro) - extension: route orcarouter through createOpenAI at https://api.orcarouter.ai/v1 via the Responses API, with a chat-completions fallback for stop sequences - evals + integrations facade: read ORCAROUTER_API_KEY for orcarouter models - docs: add OrcaRouter to the first-class providers reference - regenerate protocol JSON, Python, and Go clients; add tests + changeset Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
🦋 Changeset detectedLatest commit: 4e2bef0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
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.
why
OrcaRouter is an OpenAI-compatible gateway that fronts hundreds of frontier and open-weight models behind a single
sk-orca-key. Adding it as a named first-class provider lets Stagehand users target the gateway with the sameprovider/modelsyntax as the existing OpenAI, Anthropic, Google, Groq, and Cerebras providers — including gateway routing aliases likeorcarouter/autoand vendor-prefixed models likeorcarouter/deepseek/deepseek-v4-pro.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.
what changed
orcarouterinModelProviderSchema; addOrcaRouterModelId/OrcaRouterModelNameschemas covering the gateway routing aliases and a curated set of vendor-prefixed models; regeneratestagehand.v4.json, the Python models, and the Go clientorcarouter/*throughcreateOpenAIathttps://api.orcarouter.ai/v1via the Responses API (chat-completions fallback whenstopSequencesare set), sending the full gateway-qualified model nameORCAROUTER_API_KEYfororcarouter/models in the init harness and env snapshotORCAROUTER_API_KEYwhenSTAGEHAND_MODEL_NAMEuses anorcarouter/prefixtest plan
just checkpasses (fmt, lint, typecheck, generated-code drift, go vet)pnpm exec turbo run test:unitpasses (all packages)createAiSdkLanguageModel/getAISDKLanguageModelwith a realORCAROUTER_API_KEYagainsthttps://api.orcarouter.ai/v1returns"ORCA-OK"over both the Responses API and the chat-completions pathDisclosure: I'm an engineer on the OrcaRouter team.
Summary by cubic
Adds OrcaRouter as a first-class model provider so users can select
orcarouter/*models via the same provider/model syntax. Previously only OpenAI, Anthropic, Google, Groq, and Cerebras were accepted; now OrcaRouter models validate and route through the OpenAI Responses API, with chat-completions used when stop sequences are set.orcaroutertoModelProvider, defineOrcaRouterModelId/Name, regeneratestagehand.v4.jsonand the Python/Go SDKs; validation now includes gateway aliases (for example,orcarouter/auto) and vendor-prefixed models.https://api.orcarouter.ai/v1; default baseURL applies when unset; enable strict JSON schema; fallback to chat-completions whenstopSequencesare present.ORCAROUTER_API_KEY; resolve it automatically whenSTAGEHAND_MODEL_NAMEstarts withorcarouter/; env snapshot and TUI reflect the new key.ORCAROUTER_API_KEYand choose a validated model name such asorcarouter/autoororcarouter/deepseek/deepseek-v4-pro. No changes required for existing providers.Written for commit 4e2bef0. Summary will update on new commits.