diff --git a/core/llm/toolSupport.ts b/core/llm/toolSupport.ts index a101779b979..daf82b6d448 100644 --- a/core/llm/toolSupport.ts +++ b/core/llm/toolSupport.ts @@ -120,7 +120,7 @@ export const PROVIDER_TOOL_SUPPORT: Record boolean> = }, xAI: (model) => { const lowerCaseModel = model.toLowerCase(); - return ["grok-3", "grok-4", "grok-code"].some((val) => + return ["grok-3", "grok-4", "grok-4-1", "grok-code"].some((val) => lowerCaseModel.includes(val), ); }, @@ -396,6 +396,7 @@ export function isRecommendedAgentModel(modelName: string): boolean { [/claude/, /sonnet/, /3\.7|3-7|-4/], [/claude/, /opus/, /-4/], [/grok-code/], + [/grok-4-1|grok-4\.1/], [/claude/, /4-5/], ]; for (const combo of recs) { diff --git a/docs/customize/model-roles/chat.mdx b/docs/customize/model-roles/chat.mdx index ee175829fc1..ff6cc3b7f1b 100644 --- a/docs/customize/model-roles/chat.mdx +++ b/docs/customize/model-roles/chat.mdx @@ -95,20 +95,20 @@ If you prefer to use a model from [OpenAI](../model-providers/top-level/openai), -### Grok-2 from xAI +### Grok-4 from xAI -If you prefer to use a model from [xAI](../model-providers/more/xAI), then we recommend Grok-2. +If you prefer to use a model from [xAI](../model-providers/more/xAI), then we recommend Grok-4. - Add the [xAI Grok-2 block](https://hub.continue.dev/xai/grok-2) from the hub + Add the [xAI Grok-4.1 block](https://hub.continue.dev/xai/grok-4-1-fast-non-reasoning) from the hub ```yaml title="config.yaml" models: - - name: Grok-2 + - name: Grok-4.1 provider: xAI - model: grok-2-latest + model: grok-4-1-fast-non-reasoning apiKey: ``` diff --git a/extensions/cli/src/utils/modelCapability.ts b/extensions/cli/src/utils/modelCapability.ts index 1dca2417f82..a827da0ce4d 100644 --- a/extensions/cli/src/utils/modelCapability.ts +++ b/extensions/cli/src/utils/modelCapability.ts @@ -10,7 +10,7 @@ export function isModelCapable( const normalizedName = name.toLowerCase(); const normalizedModel = model ? model.toLowerCase() : ""; - const patterns = [/gemini/, /claude/, /gpt/, /o\d/, /kimi/, /qwen/]; + const patterns = [/gemini/, /claude/, /gpt/, /o\d/, /kimi/, /qwen/, /grok/]; // If either name OR model matches any of the patterns, consider it capable if (patterns.some((pattern) => pattern.test(normalizedName))) { diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index c9e0c049f56..228b8657470 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1908,6 +1908,34 @@ export const models: { [key: string]: ModelPackage } = { providerOptions: ["xAI"], isOpenSource: false, }, + grok41FastReasoning: { + title: "Grok 4.1 Fast Reasoning", + description: + "xAI's upgraded reasoning model offering strong performance in complex tasks.", + refUrl: "https://docs.x.ai/docs/models/grok-4-1-fast-reasoning", + params: { + title: "Grok 4.1 Fast Reasoning", + model: "grok-4-1-fast-reasoning", + contextLength: 2_000_000, + }, + icon: "xAI.png", + providerOptions: ["xAI"], + isOpenSource: false, + }, + grok41FastNonReasoning: { + title: "Grok 4.1 Fast Non-Reasoning", + description: + "xAI's upgraded non-reasoning model optimized for speed and efficiency.", + refUrl: "https://docs.x.ai/docs/models/grok-4-1-fast-non-reasoning", + params: { + title: "Grok 4.1 Fast Non-Reasoning", + model: "grok-4-1-fast-non-reasoning", + contextLength: 2_000_000, + }, + icon: "xAI.png", + providerOptions: ["xAI"], + isOpenSource: false, + }, grok4: { title: "Grok 4", description: diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index f988ff80563..cbbbacff2b7 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -624,6 +624,8 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n models.grokCodeFast1, models.grok4FastReasoning, models.grok4FastNonReasoning, + models.grok41FastReasoning, + models.grok41FastNonReasoning, models.grok4, models.grok3, models.grok3Mini, diff --git a/packages/llm-info/src/providers/cometapi.ts b/packages/llm-info/src/providers/cometapi.ts index 441f5bd75b8..e7b41e75e71 100644 --- a/packages/llm-info/src/providers/cometapi.ts +++ b/packages/llm-info/src/providers/cometapi.ts @@ -173,10 +173,19 @@ export const CometAPI: ModelProvider = { }, // Grok Series + { + model: "grok-4-1-fast-reasoning", + displayName: "Grok 4.1 Fast Reasoning", + contextLength: 256000, + maxCompletionTokens: 4096, + description: + "Latest Grok model with faster and improved reasoning and conversational abilities.", + recommendedFor: ["chat"], + }, { model: "grok-4-0709", displayName: "Grok 4 (07-09)", - contextLength: 128000, + contextLength: 256000, maxCompletionTokens: 4096, description: "Latest Grok model with improved reasoning and conversational abilities.", diff --git a/packages/llm-info/src/providers/xAI.ts b/packages/llm-info/src/providers/xAI.ts index 17ec83fa79c..d0b7173e486 100644 --- a/packages/llm-info/src/providers/xAI.ts +++ b/packages/llm-info/src/providers/xAI.ts @@ -52,7 +52,21 @@ export const xAI: ModelProvider = { displayName: "Grok 4 Fast", contextLength: 256000, recommendedFor: ["chat"], - regex: /grok-4/, + regex: /^grok-4$/, + }, + { + model: "grok-4-1-fast-reasoning", + displayName: "Grok 4.1 Fast Reasoning", + contextLength: 256000, + recommendedFor: ["chat"], + regex: /grok-4-1-fast-reasoning/, + }, + { + model: "grok-4-1-fast-non-reasoning", + displayName: "Grok 4.1 Fast Non Reasoning", + contextLength: 256000, + recommendedFor: ["chat"], + regex: /grok-4-1-fast-non-reasoning/, }, { model: "grok-code-fast-1",