From dfceed875121019c59b9a51d06c9801fc8a5500b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=C2=B7Dong?= <98630204+GeorgeDong32@users.noreply.github.com> Date: Sun, 27 Jul 2025 01:18:11 +0800 Subject: [PATCH] feat(models): add Grok 4 model and update reasoning regex (#8545) * feat(models): add Grok 4 model and update reasoning regex * feat(models): add grok-4 to vision model --- src/renderer/src/config/models.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/config/models.ts b/src/renderer/src/config/models.ts index aa124002ad..398d9f1b55 100644 --- a/src/renderer/src/config/models.ts +++ b/src/renderer/src/config/models.ts @@ -172,6 +172,7 @@ const visionAllowedModels = [ 'qvq', 'internvl2', 'grok-vision-beta', + 'grok-4(?:-[\\w-]+)?', 'pixtral', 'gpt-4(?:-[\\w-]+)', 'gpt-4.1(?:-[\\w-]+)?', @@ -217,7 +218,7 @@ export const TEXT_TO_IMAGE_REGEX = /flux|diffusion|stabilityai|sd-|dall|cogview| // Reasoning models export const REASONING_REGEX = - /^(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bglm-zero-preview\b.*|.*\bgrok-3-mini(?:-[\w-]+)?\b.*)$/i + /^(o\d+(?:-[\w-]+)?|.*\b(?:reasoning|reasoner|thinking)\b.*|.*-[rR]\d+.*|.*\bqwq(?:-[\w-]+)?\b.*|.*\bhunyuan-t1(?:-[\w-]+)?\b.*|.*\bglm-zero-preview\b.*|.*\bgrok-(?:3-mini|4)(?:-[\w-]+)?\b.*)$/i // Embedding models export const EMBEDDING_REGEX = @@ -1552,6 +1553,12 @@ export const SYSTEM_MODELS: Record = { } ], grok: [ + { + id: 'grok-4', + provider: 'grok', + name: 'Grok 4', + group: 'Grok' + }, { id: 'grok-3', provider: 'grok',