Elffuss BraidHub

kikocis/continue public

Merge pull request #7925 from continuedev/dallin/grok-model-updates

feat: grok model updates
Changeseta081e4024e80abb90264e1d5a4f8d1d1e71d14134348bcff983121afc04470b4
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-24 17:42 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-24 17:42 -07:00
Parentsa95c52aaa678, 88c3ae41cf22

Browse the files at this changeset

10 files changed

modified core/llm/llms/xAI.ts +0 −8
@@ -7,14 +7,6 @@
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;
modified core/llm/toolSupport.test.ts +17 −0
@@ -280,6 +280,23 @@
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
modified core/llm/toolSupport.ts +4 −0
@@ -110,6 +110,10 @@
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 [
modified docs/customization/models.mdx +2 −2
@@ -65,10 +65,10 @@
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
modified docs/customize/deep-dives/model-capabilities.mdx +8 −3
@@ -210,9 +210,14 @@
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
modified docs/customize/model-providers/more/xAI.mdx +6 −9
@@ -3,13 +3,9 @@
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 @@
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 @@
4036 </Tabs>
4137
4238 <Info>
43- **Check out a more advanced configuration [here](https://hub.continue.dev/xai/grok-4?view=config)**
44-</Info>
No newline at the end of the file
39+ **Check out a more advanced configuration
40+ [here](https://hub.continue.dev/xai/grok-code-fast-1?view=config)**
41+</Info>
modified gui/src/pages/AddNewModel/configs/models.ts +77 −8
@@ -1585,14 +1585,83 @@
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: "",
1592- params: {
1593- title: "Grok Beta",
1594- model: "grok-beta",
1595- contextLength: 128_000,
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",
1593+ params: {
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"],
modified gui/src/pages/AddNewModel/configs/providers.ts +8 −1
@@ -622,7 +622,14 @@
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: {
modified packages/llm-info/package.json +1 −1
@@ -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",
modified packages/llm-info/src/providers/xAI.ts +54 −0
@@ -7,6 +7,60 @@
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",