Skip to content

Commit df59dcc

Browse files
authored
Merge pull request #7925 from continuedev/dallin/grok-model-updates
feat: grok model updates
2 parents ead28c7 + f8cfba0 commit df59dcc

File tree

10 files changed

+176
-31
lines changed

10 files changed

+176
-31
lines changed

core/llm/llms/xAI.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ class xAI extends OpenAI {
77
static defaultOptions: Partial<LLMOptions> = {
88
apiBase: "https://api.x.ai/v1/",
99
};
10-
11-
private static MODEL_IDS: { [name: string]: string } = {
12-
"grok-beta": "grok-beta", // Future names might not line up
13-
};
14-
15-
protected _convertModelName(model: string) {
16-
return xAI.MODEL_IDS[model] || this.model;
17-
}
1810
}
1911

2012
export default xAI;

core/llm/toolSupport.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,23 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
280280
});
281281
});
282282

283+
describe("xAI", () => {
284+
const supportsFn = PROVIDER_TOOL_SUPPORT["xAI"];
285+
286+
it("should return true for Grok-3 models", () => {
287+
expect(supportsFn("grok-3")).toBe(true);
288+
expect(supportsFn("grok-3-mini")).toBe(true);
289+
expect(supportsFn("grok-3-fast")).toBe(true);
290+
});
291+
292+
it("should return true for Grok-4 models", () => {
293+
expect(supportsFn("grok-4")).toBe(true);
294+
expect(supportsFn("grok-4-fast-non-reasoning")).toBe(true);
295+
expect(supportsFn("grok-4-fast-reasoning")).toBe(true);
296+
expect(supportsFn("Grok-4-Fast")).toBe(true);
297+
});
298+
});
299+
283300
describe("novita", () => {
284301
const supportsFn = PROVIDER_TOOL_SUPPORT["novita"];
285302

core/llm/toolSupport.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
110110
}
111111
return ["claude", "gemini"].some((val) => lowerCaseModel.includes(val));
112112
},
113+
xAI: (model) => {
114+
const lowerCaseModel = model.toLowerCase();
115+
return ["grok-3", "grok-4"].some((val) => lowerCaseModel.includes(val));
116+
},
113117
bedrock: (model) => {
114118
if (
115119
[

docs/customization/models.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus
6565
3. Add `GEMINI_API_KEY` as a [User Secret](https://docs.continue.dev/hub/secrets/secret-types#user-secrets) on Continue Hub [here](https://hub.continue.dev/settings/secrets)
6666
4. Click `Reload config` in the agent selector in the Continue IDE extension
6767

68-
[Grok 4](https://hub.continue.dev/xai/grok-4) from xAI
68+
[Grok Code Fast 1](https://hub.continue.dev/xai/grok-code-fast-1) from xAI
6969

7070
1. Get your API key from [xAI](https://console.x.ai/)
71-
2. Add [Grok 4](https://hub.continue.dev/xai/grok-4) to an agent on Continue Hub
71+
2. Add [Grok Code Fast 1](https://hub.continue.dev/xai/grok-code-fast-1) to an agent on Continue Hub
7272
3. Add `XAI_API_KEY` as a [User Secret](https://docs.continue.dev/hub/secrets/secret-types#user-secrets) on Continue Hub [here](https://hub.continue.dev/settings/secrets)
7373
4. Click `Reload config` in the agent selector in the Continue IDE extension
7474

docs/customize/deep-dives/model-capabilities.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,14 @@ This matrix shows which models support tool use and image input capabilities. Co
210210

211211
### xAI
212212

213-
| Model | Tool Use | Image Input | Context Window |
214-
| :----- | -------- | ----------- | -------------- |
215-
| Grok 4 | Yes | Yes | 128k |
213+
| Model | Tool Use | Image Input | Context Window |
214+
| :------------------------ | -------- | ----------- | -------------- |
215+
| Grok Code Fast 1 | Yes | Yes | 256k |
216+
| Grok 4 Fast Reasoning | Yes | Yes | 2M |
217+
| Grok 4 Fast Non-Reasoning | Yes | Yes | 2M |
218+
| Grok 4 | Yes | Yes | 256k |
219+
| Grok 3 | Yes | Yes | 131k |
220+
| Grok 3 Mini | Yes | Yes | 131k |
216221

217222
### Moonshot AI
218223

docs/customize/model-providers/more/xAI.mdx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@ title: xAI
33
slug: ../xai
44
---
55

6-
<Tip>
7-
**Discover xAI models [here](https://hub.continue.dev/xai)**
8-
</Tip>
6+
<Tip>**Discover xAI models [here](https://hub.continue.dev/xai)**</Tip>
97

10-
<Info>
11-
Get an API key from the [xAI Console](https://console.x.ai/)
12-
</Info>
8+
<Info>Get an API key from the [xAI Console](https://console.x.ai/)</Info>
139

1410
## Configuration
1511

@@ -29,7 +25,7 @@ slug: ../xai
2925
"models": [
3026
{
3127
"title": "<MODEL_NAME>",
32-
"provider": "anthropic",
28+
"provider": "xai",
3329
"model": "<MODEL_ID>",
3430
"apiKey": "<YOUR_XAI_API_KEY>"
3531
}
@@ -40,5 +36,6 @@ slug: ../xai
4036
</Tabs>
4137

4238
<Info>
43-
**Check out a more advanced configuration [here](https://hub.continue.dev/xai/grok-4?view=config)**
44-
</Info>
39+
**Check out a more advanced configuration
40+
[here](https://hub.continue.dev/xai/grok-code-fast-1?view=config)**
41+
</Info>

gui/src/pages/AddNewModel/configs/models.ts

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,14 +1585,83 @@ export const models: { [key: string]: ModelPackage } = {
15851585
providerOptions: ["scaleway", "nebius", "ovhcloud", "ncompass"],
15861586
isOpenSource: true,
15871587
},
1588-
grokBeta: {
1589-
title: "Grok Beta",
1590-
description: "Generative artificial intelligence chatbot developed by xAI.",
1591-
refUrl: "",
1588+
grokCodeFast1: {
1589+
title: "Grok Code Fast 1",
1590+
description:
1591+
"A speedy and economical reasoning model that excels at agentic coding",
1592+
refUrl: "https://docs.x.ai/docs/models/grok-code-fast-1",
15921593
params: {
1593-
title: "Grok Beta",
1594-
model: "grok-beta",
1595-
contextLength: 128_000,
1594+
title: "Grok Code Fast 1",
1595+
model: "grok-code-fast-1",
1596+
contextLength: 256000,
1597+
},
1598+
icon: "xAI.png",
1599+
providerOptions: ["xAI", "askSage"],
1600+
isOpenSource: false,
1601+
},
1602+
grok4FastReasoning: {
1603+
title: "Grok 4 Fast Reasoning",
1604+
description: "xAI's latest advancement in cost-efficient reasoning models",
1605+
refUrl: "https://docs.x.ai/docs/models/grok-4-fast-reasoning",
1606+
params: {
1607+
title: "Grok 4 Fast Reasoning",
1608+
model: "grok-4-fast-reasoning",
1609+
contextLength: 2_000_000,
1610+
},
1611+
icon: "xAI.png",
1612+
providerOptions: ["xAI", "askSage"],
1613+
isOpenSource: false,
1614+
},
1615+
grok4FastNonReasoning: {
1616+
title: "Grok 4 Fast Non-Reasoning",
1617+
description: "xAI's latest advancement in cost-efficient models",
1618+
refUrl: "https://docs.x.ai/docs/models/grok-4-fast-non-reasoning",
1619+
params: {
1620+
title: "Grok 4 Fast Non-Reasoning",
1621+
model: "grok-4-fast-non-reasoning",
1622+
contextLength: 2_000_000,
1623+
},
1624+
icon: "xAI.png",
1625+
providerOptions: ["xAI", "askSage"],
1626+
isOpenSource: false,
1627+
},
1628+
grok4: {
1629+
title: "Grok 4",
1630+
description:
1631+
"xAI's latest and greatest flagship model, offering strong performance in natural language, math and reasoning.",
1632+
refUrl: "https://docs.x.ai/docs/models/grok-4",
1633+
params: {
1634+
title: "Grok 4",
1635+
model: "grok-4",
1636+
contextLength: 256_000,
1637+
},
1638+
icon: "xAI.png",
1639+
providerOptions: ["xAI", "askSage"],
1640+
isOpenSource: false,
1641+
},
1642+
grok3: {
1643+
title: "Grok 3",
1644+
description:
1645+
"Excels at enterprise use cases like data extraction, coding, and text summarization",
1646+
refUrl: "https://docs.x.ai/docs/models/grok-3",
1647+
params: {
1648+
title: "Grok 3",
1649+
model: "grok-3",
1650+
contextLength: 131_072,
1651+
},
1652+
icon: "xAI.png",
1653+
providerOptions: ["xAI", "askSage"],
1654+
isOpenSource: false,
1655+
},
1656+
grok3Mini: {
1657+
title: "Grok 3 Mini",
1658+
description:
1659+
"A lightweight model that thinks before responding. Fast, smart, and great for logic-based tasks that do not require deep domain knowledge.",
1660+
refUrl: "https://docs.x.ai/docs/models/grok-3-mini",
1661+
params: {
1662+
title: "Grok 3 Mini",
1663+
model: "grok-3-mini",
1664+
contextLength: 131_072,
15961665
},
15971666
icon: "xAI.png",
15981667
providerOptions: ["xAI", "askSage"],

gui/src/pages/AddNewModel/configs/providers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,14 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
622622
required: true,
623623
},
624624
],
625-
packages: [models.grokBeta],
625+
packages: [
626+
models.grokCodeFast1,
627+
models.grok4FastReasoning,
628+
models.grok4FastNonReasoning,
629+
models.grok4,
630+
models.grok3,
631+
models.grok3Mini,
632+
],
626633
apiKeyUrl: "https://console.x.ai/",
627634
},
628635
lemonade: {

packages/llm-info/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@continuedev/llm-info",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/llm-info/src/providers/xAI.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,60 @@ export const xAI: ModelProvider = {
77
displayName: "Grok Beta",
88
contextLength: 128000,
99
recommendedFor: ["chat"],
10+
regex: /grok-beta/,
11+
},
12+
{
13+
model: "grok-2",
14+
displayName: "Grok 2",
15+
contextLength: 131072,
16+
recommendedFor: ["chat"],
17+
regex: /grok-2/,
18+
},
19+
{
20+
model: "grok-3-mini",
21+
displayName: "Grok 3 Mini",
22+
contextLength: 131072,
23+
maxCompletionTokens: 8000,
24+
recommendedFor: ["chat"],
25+
regex: /grok-3-mini/,
26+
},
27+
{
28+
model: "grok-3",
29+
displayName: "Grok 3",
30+
contextLength: 131072,
31+
recommendedFor: ["chat"],
32+
regex: /grok-3/,
33+
},
34+
{
35+
model: "grok-4-fast-reasoning",
36+
displayName: "Grok 4 Fast Reasoning",
37+
contextLength: 2000000,
38+
maxCompletionTokens: 30000,
39+
recommendedFor: ["chat"],
40+
regex: /grok-4-fast-reasoning/,
41+
},
42+
{
43+
model: "grok-4-fast-non-reasoning",
44+
displayName: "Grok 4 Fast Non-Reasoning",
45+
contextLength: 2000000,
46+
maxCompletionTokens: 30000,
47+
recommendedFor: ["chat"],
48+
regex: /grok-4-fast-non-reasoning/,
49+
},
50+
{
51+
model: "grok-4",
52+
displayName: "Grok 4 Fast",
53+
contextLength: 256000,
54+
recommendedFor: ["chat"],
55+
regex: /grok-4/,
56+
},
57+
{
58+
model: "grok-code-fast-1",
59+
displayName: "Grok Code Fast 1",
60+
contextLength: 256000,
61+
maxCompletionTokens: 10000,
62+
recommendedFor: ["chat"],
63+
regex: /grok-code-fast-1/,
1064
},
1165
],
1266
id: "xAI",

0 commit comments

Comments
 (0)