Skip to content
3 changes: 2 additions & 1 deletion core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => 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),
);
},
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions docs/customize/model-roles/chat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,20 @@ If you prefer to use a model from [OpenAI](../model-providers/top-level/openai),
</Tab>
</Tabs>

### 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.

<Tabs>
<Tab title="Hub">
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
</Tab>
<Tab title="YAML">
```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: <YOUR_XAI_API_KEY>
```
</Tab>
Expand Down
2 changes: 1 addition & 1 deletion extensions/cli/src/utils/modelCapability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down
28 changes: 28 additions & 0 deletions gui/src/pages/AddNewModel/configs/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions gui/src/pages/AddNewModel/configs/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 10 additions & 1 deletion packages/llm-info/src/providers/cometapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
16 changes: 15 additions & 1 deletion packages/llm-info/src/providers/xAI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading