Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/orcarouter-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@truefoundry/trueforge": minor
"@truefoundry/trueforge-core": minor
---

Add OrcaRouter as a first-class model provider: an OpenAI-compatible AI gateway covering model routing, failover, guardrails and agent tool governance behind one endpoint. Mirrors the existing well-known provider wiring (`buildLanguageModel` compatible-adapter case, manifest schema with a default base URL, and shipped catalog presets).
1 change: 1 addition & 0 deletions docs/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TrueForge works with the major model providers and any OpenAI-compatible endpoin
| `moonshot` | Moonshot AI (Kimi) |
| `zai` | Z.ai (GLM) |
| `alibaba` | Alibaba (Qwen) |
| `orcarouter` | [OrcaRouter](https://www.orcarouter.ai) — OpenAI-compatible AI gateway |
| `custom` | Any OpenAI-compatible endpoint — self-hosted models, gateways, proxies |

## Configuring a standard provider
Expand Down
8 changes: 5 additions & 3 deletions packages/trueforge-core/src/core/llm/VercelAILLM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const VERCEL_AI_PROVIDER_NAMES = [
'moonshot',
'alibaba',
'together',
'orcarouter',
'custom',
] as const;

Expand Down Expand Up @@ -121,9 +122,9 @@ function isFunctionToolCall<T extends { type: string }>(toolCall: T): toolCall i

/**
* Shared by every OpenAI-compatible provider, which differ only by endpoint. The provider type
* doubles as the `providerOptions` key. Fireworks, Together and Z AI stay here rather than on their
* own packages: those drop `json_schema`, and Fireworks also clamps efforts its models do accept.
* TODO: move Z AI to @ai-sdk/zai once https://github.com/vercel/ai/pull/17340 ships.
* doubles as the `providerOptions` key. Fireworks, Together, Z AI and OrcaRouter stay here rather
* than on their own packages: those drop `json_schema`, and Fireworks also clamps efforts its
* models do accept. TODO: move Z AI to @ai-sdk/zai once https://github.com/vercel/ai/pull/17340 ships.
*/
function compatibleModel(config: VercelAIProviderConfig): LanguageModel {
const { provider, model, apiKey, headers, baseUrl } = config;
Expand Down Expand Up @@ -195,6 +196,7 @@ export function buildLanguageModel(config: VercelAIProviderConfig): LanguageMode
case 'fireworks':
case 'zai':
case 'together':
case 'orcarouter':
case 'custom': {
return compatibleModel(config);
}
Expand Down
37 changes: 37 additions & 0 deletions packages/trueforge/catalog/model-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,40 @@ providers:
reasoning_efforts:
- high
- max
- type: orcarouter
models:
- model_id: orcarouter/auto
name: auto
properties:
reasoning_efforts:
- none
- low
- medium
- high
- model_id: orcarouter/fusion
name: fusion
properties:
context_length: 1000000
reasoning_efforts:
- none
- low
- medium
- high
- model_id: orcarouter/fusion-mini
name: fusion-mini
properties:
context_length: 1000000
reasoning_efforts:
- none
- low
- medium
- high
- model_id: orcarouter/fusion-flash
name: fusion-flash
properties:
context_length: 200000
reasoning_efforts:
- none
- low
- medium
- high
6 changes: 6 additions & 0 deletions packages/trueforge/src/schemas/modelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ const TogetherAIModelProviderSchema = wellKnownProviderSchema({
base_url: 'https://api.together.xyz/v1',
}).openapi('TogetherAIModelProvider');

const OrcaRouterModelProviderSchema = wellKnownProviderSchema({
type: 'orcarouter',
base_url: 'https://api.orcarouter.ai/v1',
}).openapi('OrcaRouterModelProvider');

const AlibabaModelProviderSchema = wellKnownProviderSchema({
type: 'alibaba',
base_url: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
Expand Down Expand Up @@ -165,6 +170,7 @@ const ModelProviderBodySchema = z
MoonshotModelProviderSchema,
TogetherAIModelProviderSchema,
AlibabaModelProviderSchema,
OrcaRouterModelProviderSchema,
CustomModelProviderSchema,
])
.superRefine(refineModelProviderManifest);
Expand Down