Skip to content

Commit add231b

Browse files
authored
Merge pull request #26 from MiniMax-AI/feat/openrouter-provider
feat: add OpenRouter as LLM provider
2 parents 8f99090 + 19c6742 commit add231b

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

apps/webuiapps/src/components/ChatPanel/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ const SettingsModal: React.FC<{
12901290
<option value="minimax">MiniMax</option>
12911291
<option value="z.ai">Z.ai</option>
12921292
<option value="kimi">Kimi</option>
1293+
<option value="openrouter">OpenRouter</option>
12931294
</select>
12941295
</div>
12951296

apps/webuiapps/src/lib/__tests__/llmClient.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ describe('getDefaultProviderConfig()', () => {
135135
expect(cfg.model).toBe('kimi-k2-5');
136136
});
137137

138+
it('returns correct defaults for openrouter', () => {
139+
const cfg = getDefaultProviderConfig('openrouter');
140+
expect(cfg.provider).toBe('openrouter');
141+
expect(cfg.baseUrl).toBe('https://openrouter.ai/api/v1');
142+
expect(cfg.model).toBe('minimax/MiniMax-M2.5');
143+
});
144+
138145
it('returns consistent values for the same provider', () => {
139146
const a = getDefaultProviderConfig('openai');
140147
const b = getDefaultProviderConfig('openai');

apps/webuiapps/src/lib/llmModels.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
export type LLMProvider = 'openai' | 'anthropic' | 'deepseek' | 'minimax' | 'z.ai' | 'kimi';
1+
export type LLMProvider =
2+
| 'openai'
3+
| 'anthropic'
4+
| 'deepseek'
5+
| 'minimax'
6+
| 'z.ai'
7+
| 'kimi'
8+
| 'openrouter';
29

310
export type ModelCategory = 'flagship' | 'general' | 'coding' | 'lightweight' | 'thinking';
411

@@ -116,6 +123,23 @@ export const LLM_PROVIDER_CONFIGS: Record<LLMProvider, ProviderModelConfig> = {
116123
{ id: 'kimi-k2-turbo', name: 'Kimi K2 Turbo', category: 'general' },
117124
],
118125
},
126+
127+
openrouter: {
128+
displayName: 'OpenRouter',
129+
baseUrl: 'https://openrouter.ai/api/v1',
130+
defaultModel: 'minimax/MiniMax-M2.5',
131+
models: [
132+
{ id: 'minimax/MiniMax-M2.5', name: 'MiniMax M2.5', category: 'flagship' },
133+
{ id: 'minimax/MiniMax-M2.5-highspeed', name: 'MiniMax M2.5 Highspeed', category: 'general' },
134+
{ id: 'minimax/MiniMax-M2.7', name: 'MiniMax M2.7', category: 'flagship' },
135+
{ id: 'minimax/MiniMax-M2.7-highspeed', name: 'MiniMax M2.7 Highspeed', category: 'general' },
136+
{ id: 'minimax/MiniMax-M2.1', name: 'MiniMax M2.1', category: 'coding' },
137+
{ id: 'anthropic/claude-sonnet-4-6', name: 'Claude Sonnet 4.6', category: 'general' },
138+
{ id: 'openai/gpt-5.4', name: 'GPT-5.4', category: 'flagship' },
139+
{ id: 'deepseek/deepseek-chat', name: 'DeepSeek Chat', category: 'general' },
140+
{ id: 'google/gemini-2.5-pro', name: 'Gemini 2.5 Pro', category: 'flagship' },
141+
],
142+
},
119143
};
120144

121145
export const PROVIDER_MODELS: Record<LLMProvider, string[]> = Object.fromEntries(

0 commit comments

Comments
 (0)