Skip to content

Add OrcaRouter model support#320

Open
xilema2 wants to merge 1 commit into
inngest:mainfrom
xilema2:orcarouter-model-support
Open

Add OrcaRouter model support#320
xilema2 wants to merge 1 commit into
inngest:mainfrom
xilema2:orcarouter-model-support

Conversation

@xilema2
Copy link
Copy Markdown

@xilema2 xilema2 commented May 29, 2026

Summary

Adds an orcarouter() model helper for OrcaRouter, an OpenAI-compatible LLM router that exposes 150+ upstream models behind a single endpoint, plus an adaptive orcarouter/auto router that picks an upstream per request.

Because OrcaRouter is OpenAI-compatible, the helper is a thin wrapper around the existing openai model: it reuses the openai-chat adapter and only changes the default base URL (https://api.orcarouter.ai/v1) and the API key environment variable (ORCAROUTER_API_KEY). This mirrors how grok is built on top of openai.

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

Usage

import { createAgent, orcarouter } from "@inngest/agent-kit";

const agent = createAgent({
  name: "Code writer",
  system: "You are an expert TypeScript programmer.",
  // `orcarouter/auto` lets OrcaRouter pick the best upstream per request.
  model: orcarouter({ model: "orcarouter/auto" }),
});
The API key is read from ORCAROUTER_API_KEY by default, or can be passed explicitly via apiKey. Any of OrcaRouter's model IDs can be passed as a free-form string; orcarouter/auto uses the adaptive router configured in your routing console.

Changes
New orcarouter() helper (packages/agent-kit/src/orcarouter.ts), re-exported from models.ts.
Reuses the existing openai-chat adapter  no new adapter/format needed.
Pins authKey to the resolved OrcaRouter key so it never silently falls back to OPENAI_API_KEY.
Docs: new OrcaRouter reference page, Models concept page tab + env var list, sidebar entry.
Changeset (minor).
Testing
pnpm --filter @inngest/agent-kit type-check  passes
pnpm --filter @inngest/agent-kit test  passes (72 tests, incl. 7 new OrcaRouter tests covering format, base URL, API-key resolution, and onCall parameter merging)
pnpm --filter @inngest/agent-kit build  passes

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: e4fc41b

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

This PR includes changesets to release 1 package
Name Type
@inngest/agent-kit Minor

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

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