Skip to content

feat: add OrcaRouter as a named OpenAI-compatible model provider - #3509

Open
XiaoHuo888-hue wants to merge 1 commit into
inkeep:mainfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

feat: add OrcaRouter as a named OpenAI-compatible model provider#3509
XiaoHuo888-hue wants to merge 1 commit into
inkeep:mainfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a first-class named model provider, alongside the existing nim, openrouter, and custom OpenAI-compatible providers.

Use the orcarouter/ prefix (e.g. orcarouter/auto, orcarouter/fusion) to route through the OrcaRouter gateway — a smart routing gateway that fronts many upstream model providers behind one OpenAI-compatible endpoint. Implemented by mirroring the existing nim provider pattern exactly (a named createOpenAICompatible default instance + a configurable case), so it is additive and low-risk.

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

  • packages/agents-core/src/utils/model-factory.ts — new orcarouterDefault provider instance (https://api.orcarouter.ai/v1); orcarouter case in createProvider and in the default-instance switch; orcarouter added to BUILT_IN_PROVIDERS; provider-enumeration error messages updated.
  • packages/agents-core/src/__tests__/utils/model-factory.test.tsparseModelString coverage for orcarouter/.
  • agents-api/src/__tests__/run/agents/ModelFactory.test.ts — parse + create coverage for OrcaRouter gateway models.
  • agents-manage-ui/src/components/agent/sidepane/nodes/model-selector.tsx — OrcaRouter entry in the model picker (prefix display, selector item, labels/placeholder, prefix handling).
  • agents-docs/content/typescript-sdk/models.mdx — provider table row.
  • .env.exampleORCAROUTER_API_KEY.
  • .changeset/fine-gold-cougar.md — patch changeset for @inkeep/agents-core and @inkeep/agents-manage-ui.

Tests

1. Unit tests

agents-core:

 ✓ packages/agents-core/src/__tests__/utils/model-factory.test.ts (49 tests)
 ✓ src/utils/__tests__/usage-cost-middleware.test.ts (60 tests)

agents-api:

 ✓ src/__tests__/run/agents/ModelFactory.test.ts (69 tests)

2. Format + lint (Biome) — clean on all changed files, root format:check (2655 files) clean.

3. Typecheck@inkeep/agents-core and @inkeep/agents-manage-ui both pass tsc --noEmit.

4. Live end-to-end against OrcaRouter

Driven through ModelFactory.createModel('orcarouter/...') using the AI SDK's generateText with a live gateway key:

OK  orcarouter/auto -> modelId=orcarouter/auto provider=orcarouter.chat text="ORCA-LIVE-OK"
OK  orcarouter/fusion -> modelId=orcarouter/fusion provider=orcarouter.chat text="ORCA-LIVE-OK"
OK  orcarouter/fusion-flash -> modelId=orcarouter/fusion-flash provider=orcarouter.chat text="ORCA-LIVE-OK"

Risk / compatibility

  • Additive only. No existing provider behavior changes.
  • Same shape as the existing nim named OpenAI-compatible provider.
  • No new dependencies (@ai-sdk/openai-compatible is already used by nim/custom).

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

Adds OrcaRouter (orcarouter/) as a first-class model provider alongside the
existing nim/openrouter/custom OpenAI-compatible providers.

- ModelFactory: orcarouterDefault createOpenAICompatible instance,
  configurable case, BUILT_IN_PROVIDERS entry, and updated error messages
- Model selector UI: OrcaRouter entry with prefix display and model ID input
- Docs: provider table row in models.mdx
- .env.example: ORCAROUTER_API_KEY
- Tests: parse + createModel coverage in agents-core and agents-api
- Changeset: @inkeep/agents-core + @inkeep/agents-manage-ui patch

Verified: unit tests pass, biome clean, live-tested against
https://api.orcarouter.ai/v1 (orcarouter/auto, fusion, fusion-flash all OK).
Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
@itoqa

itoqa Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ Ito did not review this pull request because the PR author doesn't have an Ito seat.

An admin can assign one in Ito team settings.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13096f8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@inkeep/agents-core Patch
@inkeep/agents-manage-ui Patch
@inkeep/agents-work-apps Patch
@inkeep/ai-sdk-provider Patch
@inkeep/create-agents Patch
@inkeep/agents-api Patch
@inkeep/agents-cli Patch
@inkeep/agents-email Patch
@inkeep/agents-mcp Patch
@inkeep/agents-sdk Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

What happens next:

  • A maintainer will review your PR.
  • If you don't hear back within a few business days, please comment here to nudge our team.
  • This repository is maintained through an internal mirror. When your change is accepted, this PR will close automatically. Don't be alarmed when it closes — that's how it merges, and your authorship is preserved.

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.

1 participant