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
40 changes: 21 additions & 19 deletions apps/web/src/lib/ai-gateway/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,30 @@ import {
KILO_AUTO_FRONTIER_MODEL,
} from '@/lib/ai-gateway/auto-model';
import {
CLAUDE_OPUS_CURRENT_MODEL_ID,
CLAUDE_OPUS_4_8_STEALTH_MODEL_ID,
CLAUDE_OPUS_STEALTH_MODEL_ID,
CLAUDE_SONNET_STEALTH_MODEL_ID,
CLAUDE_OPUS_4_6_STEALTH_MODEL_ID,
claude_opus_4_8_stealth_model,
claude_opus_4_7_stealth_model,
claude_sonnet_4_6_stealth_model,
claude_opus_4_6_stealth_model,
claude_sonnet_clawsetup_model,
CLAUDE_SONNET_CURRENT_MODEL_ID,
CLAUDE_OPUS_CURRENT_MODEL_ID,
} from '@/lib/ai-gateway/providers/anthropic.constants';
import { seed_20_code_free_model } from '@/lib/ai-gateway/providers/seed';
import type { KiloExclusiveModel } from '@/lib/ai-gateway/providers/kilo-exclusive-model';
import { MINIMAX_CURRENT_MODEL_ID } from '@/lib/ai-gateway/providers/minimax';
import { KIMI_CURRENT_MODEL_ID } from '@/lib/ai-gateway/providers/moonshotai';
import {
GEMINI_PRO_CURRENT_MODEL_ID,
gemma_4_26b_a4b_it_free_model,
} from '@/lib/ai-gateway/providers/google';
import { gemma_4_26b_a4b_it_free_model } from '@/lib/ai-gateway/providers/google';
import { QWEN37_PLUS_MODEL_ID, qwen36_plus_stealth_model } from '@/lib/ai-gateway/providers/qwen';
import { stepfun_37_flash_free_model } from '@/lib/ai-gateway/providers/stepfun';
import { isGrokModel } from '@/lib/ai-gateway/providers/xai';
import { isClaudeModel } from '@/lib/ai-gateway/providers/anthropic.constants';
import { GPT_CURRENT_MODEL_ID, isOpenAiModel } from '@/lib/ai-gateway/providers/openai';
import { GLM_CURRENT_MODEL_ID } from '@/lib/ai-gateway/providers/zai';
import { deepseekDiscountedModels } from '@/lib/ai-gateway/providers/deepseek';
import {
deepseek_v4_pro_discounted_model,
deepseekDiscountedModels,
} from '@/lib/ai-gateway/providers/deepseek';
import { type ProviderId } from '@/lib/ai-gateway/providers/types';

export const PRIMARY_DEFAULT_MODEL = CLAUDE_SONNET_CURRENT_MODEL_ID;
Expand All @@ -51,20 +48,25 @@ export const preferredModels = [
KILO_AUTO_BALANCED_MODEL.id,
KILO_AUTO_EFFICIENT_MODEL.id,
KILO_AUTO_FREE_MODEL.id,

...autoFreeModels,
CLAUDE_OPUS_CURRENT_MODEL_ID,
CLAUDE_OPUS_4_8_STEALTH_MODEL_ID,
CLAUDE_OPUS_STEALTH_MODEL_ID,
CLAUDE_SONNET_STEALTH_MODEL_ID,
CLAUDE_OPUS_4_6_STEALTH_MODEL_ID,
KIMI_CURRENT_MODEL_ID,

CLAUDE_SONNET_CURRENT_MODEL_ID,
claude_opus_4_8_stealth_model.status === 'public'
? CLAUDE_OPUS_4_8_STEALTH_MODEL_ID
: CLAUDE_OPUS_CURRENT_MODEL_ID,
GPT_CURRENT_MODEL_ID,
GEMINI_PRO_CURRENT_MODEL_ID,
MINIMAX_CURRENT_MODEL_ID,
QWEN37_PLUS_MODEL_ID,
qwen36_plus_stealth_model.public_id,
'openai/gpt-5.6-terra',
Comment thread
chrarnoldus marked this conversation as resolved.

deepseek_v4_pro_discounted_model.status === 'public'
? deepseek_v4_pro_discounted_model.public_id
: 'deepseek/deepseek-v4-pro',
GLM_CURRENT_MODEL_ID,
KIMI_CURRENT_MODEL_ID,
MINIMAX_CURRENT_MODEL_ID,
qwen36_plus_stealth_model.status === 'public'
? qwen36_plus_stealth_model.public_id
: QWEN37_PLUS_MODEL_ID,
];

export function isPdfSupportingModel(model: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/ai-gateway/providers/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function isDeepseekModel(model: string) {
return model.includes('deepseek');
}

const deepseek_v4_pro_discounted_model: KiloExclusiveModel = {
export const deepseek_v4_pro_discounted_model: KiloExclusiveModel = {
public_id: 'deepseek/deepseek-v4-pro:discounted',
internal_id: 'deepseek/deepseek-v4-pro',
display_name: 'DeepSeek: DeepSeek V4 Pro (>80% off)',
Expand Down
7 changes: 1 addition & 6 deletions apps/web/src/tests/openrouter-models-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import { GPT_CURRENT_MODEL_ID } from '@/lib/ai-gateway/providers/openai';

describe('OpenRouter Models Config', () => {
test('preferred models should contain expected models', () => {
const expectedModels = [
'google/gemini-3.1-pro-preview',
CLAUDE_SONNET_CURRENT_MODEL_ID,
GPT_CURRENT_MODEL_ID,
'z-ai/glm-5.2',
];
const expectedModels = [CLAUDE_SONNET_CURRENT_MODEL_ID, GPT_CURRENT_MODEL_ID, 'z-ai/glm-5.2'];

expectedModels.forEach(model => {
expect(preferredModels).toContain(model);
Expand Down