Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
{
id: 'qwen3.7-plus',
name: 'Qwen3.7 Plus',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 1_000_000,
max_completion_tokens: 64_000,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
name: 'Seed-Code',
description:
"ByteDance's latest code model has been deeply optimized for agentic programming tasks.",
flags: ['recommended', 'vision'],
flags: ['recommended', 'vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 32768,
variants: REASONING_VARIANTS_BINARY,
Expand All @@ -32,6 +32,7 @@ export default {
name: 'Kimi-K2.5',
description:
'Open-source SoTA native multimodal model with text-only input (for now), stronger code/UI generation.',
flags: ['reasoning'],
context_length: 262144,
max_completion_tokens: 32768,
variants: REASONING_VARIANTS_BINARY,
Expand All @@ -41,6 +42,7 @@ export default {
name: 'GLM-5.1',
description:
'Z.AI’s latest flagship model, designed for long-horizon tasks. It can work continuously and autonomously on a single task for up to 8 hours.',
flags: ['reasoning'],
context_length: 204800,
max_completion_tokens: 131072,
variants: REASONING_VARIANTS_BINARY,
Expand All @@ -50,6 +52,7 @@ export default {
name: 'GLM-4.7',
description:
"Z.ai's latest flagship model, enhanced programming capabilities and more stable multi-step reasoning/execution.",
flags: ['reasoning'],
context_length: 204800,
max_completion_tokens: 131072,
variants: REASONING_VARIANTS_BINARY,
Expand All @@ -59,14 +62,15 @@ export default {
name: 'GPT-OSS-120B',
description:
"OpenAI's open-weight model, 117B parameters with 5.1B active parameters for production, general purpose, high reasoning use cases.",
flags: ['reasoning'],
context_length: 131072,
max_completion_tokens: 65536,
},
{
id: 'dola-seed-2.0-code',
name: 'Dola-Seed-2.0-Code',
description: 'An enhanced coding version of Seed 2.0, better suited for agentic coding.',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 131072,
variants: REASONING_VARIANTS_MINIMAL_LOW_MEDIUM_HIGH,
Expand All @@ -76,7 +80,7 @@ export default {
name: 'Dola-Seed-2.0-Pro',
description:
'Focused on long-chain reasoning and stability in complex task execution, designed for complex real-world business scenarios.',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 131072,
variants: REASONING_VARIANTS_MINIMAL_LOW_MEDIUM_HIGH,
Expand All @@ -86,7 +90,7 @@ export default {
name: 'Dola-Seed-2.0-Lite',
description:
'Balances generation quality and response speed, making it a strong general-purpose production model.',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 131072,
variants: REASONING_VARIANTS_MINIMAL_LOW_MEDIUM_HIGH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'moonshotai/Kimi-K2.6-TEE',
name: 'Kimi-K2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 65535,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'kimi-k2.6',
name: 'Kimi K2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 65535,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'moonshotai/Kimi-K2.6',
name: 'Kimi K2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 262144,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
{
id: 'kimi-for-coding',
name: 'Kimi for Coding',
flags: ['recommended', 'vision'],
flags: ['recommended', 'vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 32768,
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
{
id: 'moonshotai/kimi-k2.6',
name: 'kimi-k2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 65535,
},
Expand Down
8 changes: 6 additions & 2 deletions apps/web/src/lib/ai-gateway/providers/direct-byok/morph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,42 @@ export default {
{
id: 'morph-qwen35-397b',
name: 'Qwen 3.5 397B',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 131072,
},
{
id: 'morph-minimax27-230b',
name: 'MiniMax M2.7',
flags: ['reasoning'],
context_length: 196608,
max_completion_tokens: 196608,
},
{
id: 'morph-minimax3-428b',
name: 'MiniMax M3',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 256000,
max_completion_tokens: 256000,
},
{
id: 'morph-glm52-744b',
name: 'GLM-5.2',
flags: ['reasoning'],
context_length: 1048576,
max_completion_tokens: 1048576,
},
{
id: 'morph-qwen36-27b',
name: 'Qwen 3.6 27B',
flags: ['reasoning'],
context_length: 131072,
max_completion_tokens: 131072,
},
{
id: 'morph-dsv4flash',
name: 'DeepSeek V4 Flash',
flags: ['reasoning'],
context_length: 1048576,
max_completion_tokens: 1048576,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
{
id: 'moonshotai/Kimi-K2.6',
name: 'Kimi-K2.6',
flags: ['reasoning'],
context_length: 262144,
max_completion_tokens: 32000,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'kimi-k2.6:cloud',
name: 'kimi-k2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 262144,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
{
id: 'qwen3.7-plus',
name: 'Qwen3.7 Plus',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 1_000_000,
max_completion_tokens: 65_536,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'kimi/kimi-k2.6',
name: 'kimi-k2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 65535,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ describe('parseOpenAICompatibleProviderModels', () => {
context_length: 262144,
max_completion_tokens: 131072,
input_modalities: ['text', 'image'],
flags: ['reasoning'],
},
{
id: 'morph-minimax3-428b',
name: undefined,
context_length: 256000,
max_completion_tokens: undefined,
input_modalities: undefined,
flags: ['reasoning'],
},
]);
});
Expand All @@ -62,6 +64,7 @@ describe('parseModelsDevProviderModels', () => {
stable: {
id: 'stable',
name: 'provider/stable',
reasoning: true,
limit: { context: 128_000, output: 32_000 },
modalities: { input: ['text', 'image'], output: ['text'] },
},
Expand All @@ -72,6 +75,7 @@ describe('parseModelsDevProviderModels', () => {
beta: {
id: 'beta',
status: 'beta',
reasoning: false,
},
unknownStatus: {
id: 'unknown-status',
Expand All @@ -97,27 +101,31 @@ describe('parseModelsDevProviderModels', () => {
context_length: 128_000,
max_completion_tokens: 32_000,
input_modalities: ['text', 'image'],
flags: ['reasoning'],
},
{
id: 'alpha',
name: undefined,
context_length: undefined,
max_completion_tokens: undefined,
input_modalities: undefined,
flags: undefined,
},
{
id: 'beta',
name: undefined,
context_length: undefined,
max_completion_tokens: undefined,
input_modalities: undefined,
flags: undefined,
},
{
id: 'unknown-status',
name: undefined,
context_length: undefined,
max_completion_tokens: undefined,
input_modalities: undefined,
flags: undefined,
},
]);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as z from 'zod';
import { type DirectByokModel } from '@/lib/ai-gateway/providers/direct-byok/types';
import {
type DirectByokModel,
type DirectByokModelFlag,
} from '@/lib/ai-gateway/providers/direct-byok/types';
import type { DirectUserByokInferenceProviderId } from '@/lib/ai-gateway/providers/openrouter/inference-provider-id';
import { redisClient } from '@/lib/redis';
import { directByokModelsRedisKey } from '@/lib/redis-keys';
Expand Down Expand Up @@ -28,6 +31,7 @@ const OpenAICompatibleModelsResponseSchema = z.object({
const ModelsDevModelSchema = z.object({
id: z.string(),
name: z.string().optional(),
reasoning: z.boolean().optional(),
status: z.enum(['alpha', 'beta', 'deprecated']).optional().catch(undefined),
limit: z
.object({
Expand Down Expand Up @@ -57,6 +61,7 @@ type RawModel = {
context_length?: number;
max_completion_tokens?: number;
input_modalities?: ReadonlyArray<z.infer<typeof ModalitySchema>>;
flags?: ReadonlyArray<DirectByokModelFlag>;
};

type SyncContext = {
Expand Down Expand Up @@ -105,6 +110,7 @@ export function parseOpenAICompatibleProviderModels(entry: unknown): RawModel[]
context_length: model.context_length ?? model.max_model_len,
max_completion_tokens: model.max_output_length,
input_modalities: model.input_modalities,
flags: ['reasoning'],
}));
}

Expand All @@ -122,6 +128,7 @@ export function parseModelsDevProviderModels(entry: unknown): RawModel[] {
context_length: model.limit?.context,
max_completion_tokens: model.limit?.output,
input_modalities: model.modalities?.input,
flags: model.reasoning ? ['reasoning'] : undefined,
}));
}

Expand Down Expand Up @@ -208,14 +215,16 @@ async function syncProvider(fetcher: ProviderFetcher, ctx: SyncContext): Promise
for (const raw of fetched) {
const name = raw.name ?? shortenDisplayName(raw.id);
const context_length = raw.context_length ?? DEFAULT_CONTENT_LENGTH;
const flags = new Set(raw.flags);
if (raw.input_modalities?.includes('image')) flags.add('vision');
const max_completion_tokens = Math.min(
raw.max_completion_tokens ?? DEFAULT_MAX_COMPLETION_TOKENS,
context_length
);
models.push({
id: raw.id,
name,
flags: raw.input_modalities?.includes('image') ? ['vision'] : undefined,
flags: flags.size > 0 ? [...flags] : undefined,
context_length,
max_completion_tokens,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
{
id: 'hf:moonshotai/Kimi-K2.6',
name: 'Kimi-K2.6',
flags: ['vision'],
flags: ['vision', 'reasoning'],
context_length: 262144,
max_completion_tokens: 65535,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/ai-gateway/providers/direct-byok/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DirectByokProviderMetaId } from '@/lib/ai-gateway/providers/direct
import type { GatewayChatApiKind, TransformRequestContext } from '@/lib/ai-gateway/providers/types';
import type { CustomLlmProvider } from '@kilocode/db';

export const DirectByokModelFlagSchema = z.enum(['recommended', 'vision']);
export const DirectByokModelFlagSchema = z.enum(['recommended', 'vision', 'reasoning']);

export type DirectByokModelFlag = z.infer<typeof DirectByokModelFlagSchema>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
{
id: 'mimo-v2.5-pro',
name: 'MiMo-V2.5-Pro',
flags: ['reasoning'],
context_length: 1048576,
max_completion_tokens: 131072,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
{
id: 'mimo-v2.5-pro',
name: 'MiMo-V2.5-Pro',
flags: ['reasoning'],
context_length: 1048576,
max_completion_tokens: 131072,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default {
{
id: 'glm-5.2',
name: 'GLM-5.2',
flags: ['reasoning'],
context_length: 1000000,
max_completion_tokens: 131072,
},
Expand Down