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
17 changes: 17 additions & 0 deletions apps/nestjs-backend/src/features/ai/ai.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { AiService } from './ai.service';

const openAIProviderName = 'custom-openai';
const openRouterProviderName = 'custom-openrouter';
const orcaRouterProviderName = 'custom-orcarouter';
const gptImage2Model = 'gpt-image-2';
const openRouterModel = `openai/${gptImage2Model}`;
const orcaRouterModel = `openai/${gptImage2Model}`;
const imageGenerationTag = 'image-generation';

const setBaseConfig = (service: AiService, isCloud: boolean) => {
Expand Down Expand Up @@ -66,6 +68,21 @@ describe('AiService.getModelTags', () => {

expect(tags).toEqual([]);
});

it('does not infer tags for OrcaRouter models without explicit config', async () => {
const tags = await service.getModelTags(
`${LLMProviderType.ORCAROUTER}@${orcaRouterModel}@${orcaRouterProviderName}`,
[
{
type: LLMProviderType.ORCAROUTER,
name: orcaRouterProviderName,
models: orcaRouterModel,
},
]
);

expect(tags).toEqual([]);
});
});

describe('AiService model mappings', () => {
Expand Down
4 changes: 4 additions & 0 deletions apps/nestjs-backend/src/features/ai/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export const modelProviders = {
[LLMProviderType.OLLAMA]: createOllama,
[LLMProviderType.AMAZONBEDROCK]: createAmazonBedrock,
[LLMProviderType.OPENROUTER]: createOpenRouter,
// OrcaRouter is an OpenAI-compatible meta-router; reuse the compatible wrapper
// (no dedicated SDK/dependency needed), same as the generic OpenAI-compatible type.
[LLMProviderType.ORCAROUTER]: createOpenAICompatibleWrapper,
[LLMProviderType.OPENAI_COMPATIBLE]: createOpenAICompatibleWrapper,
// AI_GATEWAY is handled separately in ai.service.ts using createGateway from 'ai'
} as const;
Expand All @@ -130,6 +133,7 @@ export const getAdaptedProviderOptions = (
}
case LLMProviderType.OLLAMA:
return { name, baseURL: originalBaseURL };
case LLMProviderType.ORCAROUTER:
case LLMProviderType.OPENAI_COMPATIBLE:
return { ...originalOptions, includeUsage: true };
case LLMProviderType.AI_GATEWAY:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Ollama,
AmazonBedrock,
OpenRouter,
OrcaRouter,
Zap,
// Gateway provider icons
Meta,
Expand Down Expand Up @@ -54,6 +55,7 @@ export const LLM_PROVIDER_ICONS = {
[LLMProviderType.OLLAMA]: Ollama,
[LLMProviderType.AMAZONBEDROCK]: AmazonBedrock,
[LLMProviderType.OPENROUTER]: OpenRouter,
[LLMProviderType.ORCAROUTER]: OrcaRouter,
[LLMProviderType.OPENAI_COMPATIBLE]: Openai,
[LLMProviderType.AI_GATEWAY]: Zap, // AI Gateway uses Zap icon
};
Expand Down Expand Up @@ -165,6 +167,13 @@ export const LLM_PROVIDERS = [
modelsPlaceholder: 'anthropic/claude-sonnet-4-6,google/gemini-2.5-flash',
Icon: LLM_PROVIDER_ICONS[LLMProviderType.OPENROUTER],
},
{
value: LLMProviderType.ORCAROUTER,
label: 'OrcaRouter',
baseUrlPlaceholder: 'https://api.orcarouter.ai/v1',
modelsPlaceholder: 'orcarouter/auto,openai/gpt-5.2,anthropic/claude-opus-4.8',
Icon: LLM_PROVIDER_ICONS[LLMProviderType.ORCAROUTER],
},
{
value: LLMProviderType.OPENAI_COMPATIBLE,
label: 'OpenAI Compatible',
Expand Down
24 changes: 24 additions & 0 deletions packages/icons/src/components/OrcaRouter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as React from 'react';
import type { SVGProps } from 'react';
const OrcaRouter = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
fill="none"
viewBox="0 0 24 24"
{...props}
>
<path
stroke="#94A3B8"
strokeWidth={1.5}
strokeLinecap="round"
d="M7 11.2 16.4 5.6M7.4 12H16.6M7 12.8 16.4 18.4"
/>
<circle cx="5" cy="12" r="2.6" fill="#94A3B8" />
<circle cx="18.8" cy="5" r="2.6" fill="#94A3B8" />
<circle cx="18.8" cy="12" r="2.6" fill="#94A3B8" />
<circle cx="18.8" cy="19" r="2.6" fill="#94A3B8" />
</svg>
);
export default OrcaRouter;
1 change: 1 addition & 0 deletions packages/icons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export { default as Object } from './components/Object';
export { default as Ollama } from './components/Ollama';
export { default as Openai } from './components/Openai';
export { default as OpenRouter } from './components/OpenRouter';
export { default as OrcaRouter } from './components/OrcaRouter';
export { default as PackageCheck } from './components/PackageCheck';
export { default as PaintBucket } from './components/PaintBucket';
export { default as Pencil } from './components/Pencil';
Expand Down
1 change: 1 addition & 0 deletions packages/openapi/src/admin/setting/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export enum LLMProviderType {
OLLAMA = 'ollama',
AMAZONBEDROCK = 'amazonBedrock',
OPENROUTER = 'openRouter',
ORCAROUTER = 'orcarouter',
OPENAI_COMPATIBLE = 'openaiCompatible',
// Vercel AI Gateway - unified model access via modelId
AI_GATEWAY = 'aiGateway',
Expand Down