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

feat: grok model updates
This commit is contained in:
Dallin Romney 2025-09-24 17:42:34 -07:00 • committed by GitHub
commit df59dcc80c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 176 additions and 31 deletions

View file

@ -7,14 +7,6 @@ class xAI extends OpenAI {
static defaultOptions: Partial<LLMOptions> = {
apiBase: "https://api.x.ai/v1/",
};
private static MODEL_IDS: { [name: string]: string } = {
"grok-beta": "grok-beta", // Future names might not line up
};
protected _convertModelName(model: string) {
return xAI.MODEL_IDS[model] || this.model;
}
}
export default xAI;

View file

@ -280,6 +280,23 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
});
});
describe("xAI", () => {
const supportsFn = PROVIDER_TOOL_SUPPORT["xAI"];
it("should return true for Grok-3 models", () => {
expect(supportsFn("grok-3")).toBe(true);
expect(supportsFn("grok-3-mini")).toBe(true);
expect(supportsFn("grok-3-fast")).toBe(true);
});
it("should return true for Grok-4 models", () => {
expect(supportsFn("grok-4")).toBe(true);
expect(supportsFn("grok-4-fast-non-reasoning")).toBe(true);
expect(supportsFn("grok-4-fast-reasoning")).toBe(true);
expect(supportsFn("Grok-4-Fast")).toBe(true);
});
});
describe("novita", () => {
const supportsFn = PROVIDER_TOOL_SUPPORT["novita"];

View file

@ -110,6 +110,10 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
}
return ["claude", "gemini"].some((val) => lowerCaseModel.includes(val));
},
xAI: (model) => {
const lowerCaseModel = model.toLowerCase();
return ["grok-3", "grok-4"].some((val) => lowerCaseModel.includes(val));
},
bedrock: (model) => {
if (
[

View file

@ -65,10 +65,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus
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)
4. Click `Reload config` in the agent selector in the Continue IDE extension
[Grok 4](https://hub.continue.dev/xai/grok-4) from xAI
[Grok Code Fast 1](https://hub.continue.dev/xai/grok-code-fast-1) from xAI
1. Get your API key from [xAI](https://console.x.ai/)
2. Add [Grok 4](https://hub.continue.dev/xai/grok-4) to an agent on Continue Hub
2. Add [Grok Code Fast 1](https://hub.continue.dev/xai/grok-code-fast-1) to an agent on Continue Hub
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)
4. Click `Reload config` in the agent selector in the Continue IDE extension

View file

@ -210,9 +210,14 @@ This matrix shows which models support tool use and image input capabilities. Co
### xAI
| Model | Tool Use | Image Input | Context Window |
| :----- | -------- | ----------- | -------------- |
| Grok 4 | Yes | Yes | 128k |
| Model | Tool Use | Image Input | Context Window |
| :------------------------ | -------- | ----------- | -------------- |
| Grok Code Fast 1 | Yes | Yes | 256k |
| Grok 4 Fast Reasoning | Yes | Yes | 2M |
| Grok 4 Fast Non-Reasoning | Yes | Yes | 2M |
| Grok 4 | Yes | Yes | 256k |
| Grok 3 | Yes | Yes | 131k |
| Grok 3 Mini | Yes | Yes | 131k |
### Moonshot AI

View file

@ -3,13 +3,9 @@ title: xAI
slug: ../xai
---
<Tip>
**Discover xAI models [here](https://hub.continue.dev/xai)**
</Tip>
<Tip>**Discover xAI models [here](https://hub.continue.dev/xai)**</Tip>
<Info>
Get an API key from the [xAI Console](https://console.x.ai/)
</Info>
<Info>Get an API key from the [xAI Console](https://console.x.ai/)</Info>
## Configuration
@ -29,7 +25,7 @@ slug: ../xai
"models": [
{
"title": "<MODEL_NAME>",
"provider": "anthropic",
"provider": "xai",
"model": "<MODEL_ID>",
"apiKey": "<YOUR_XAI_API_KEY>"
}
@ -40,5 +36,6 @@ slug: ../xai
</Tabs>
<Info>
**Check out a more advanced configuration [here](https://hub.continue.dev/xai/grok-4?view=config)**
</Info>
**Check out a more advanced configuration
[here](https://hub.continue.dev/xai/grok-code-fast-1?view=config)**
</Info>

View file

@ -1585,14 +1585,83 @@ export const models: { [key: string]: ModelPackage } = {
providerOptions: ["scaleway", "nebius", "ovhcloud", "ncompass"],
isOpenSource: true,
},
grokBeta: {
title: "Grok Beta",
description: "Generative artificial intelligence chatbot developed by xAI.",
refUrl: "",
grokCodeFast1: {
title: "Grok Code Fast 1",
description:
"A speedy and economical reasoning model that excels at agentic coding",
refUrl: "https://docs.x.ai/docs/models/grok-code-fast-1",
params: {
title: "Grok Beta",
model: "grok-beta",
contextLength: 128_000,
title: "Grok Code Fast 1",
model: "grok-code-fast-1",
contextLength: 256000,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],
isOpenSource: false,
},
grok4FastReasoning: {
title: "Grok 4 Fast Reasoning",
description: "xAI's latest advancement in cost-efficient reasoning models",
refUrl: "https://docs.x.ai/docs/models/grok-4-fast-reasoning",
params: {
title: "Grok 4 Fast Reasoning",
model: "grok-4-fast-reasoning",
contextLength: 2_000_000,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],
isOpenSource: false,
},
grok4FastNonReasoning: {
title: "Grok 4 Fast Non-Reasoning",
description: "xAI's latest advancement in cost-efficient models",
refUrl: "https://docs.x.ai/docs/models/grok-4-fast-non-reasoning",
params: {
title: "Grok 4 Fast Non-Reasoning",
model: "grok-4-fast-non-reasoning",
contextLength: 2_000_000,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],
isOpenSource: false,
},
grok4: {
title: "Grok 4",
description:
"xAI's latest and greatest flagship model, offering strong performance in natural language, math and reasoning.",
refUrl: "https://docs.x.ai/docs/models/grok-4",
params: {
title: "Grok 4",
model: "grok-4",
contextLength: 256_000,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],
isOpenSource: false,
},
grok3: {
title: "Grok 3",
description:
"Excels at enterprise use cases like data extraction, coding, and text summarization",
refUrl: "https://docs.x.ai/docs/models/grok-3",
params: {
title: "Grok 3",
model: "grok-3",
contextLength: 131_072,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],
isOpenSource: false,
},
grok3Mini: {
title: "Grok 3 Mini",
description:
"A lightweight model that thinks before responding. Fast, smart, and great for logic-based tasks that do not require deep domain knowledge.",
refUrl: "https://docs.x.ai/docs/models/grok-3-mini",
params: {
title: "Grok 3 Mini",
model: "grok-3-mini",
contextLength: 131_072,
},
icon: "xAI.png",
providerOptions: ["xAI", "askSage"],

View file

@ -622,7 +622,14 @@ Select the \`GPT-4o\` model below to complete your provider configuration, but n
required: true,
},
],
packages: [models.grokBeta],
packages: [
models.grokCodeFast1,
models.grok4FastReasoning,
models.grok4FastNonReasoning,
models.grok4,
models.grok3,
models.grok3Mini,
],
apiKeyUrl: "https://console.x.ai/",
},
lemonade: {

View file

@ -1,6 +1,6 @@
{
"name": "@continuedev/llm-info",
"version": "1.0.9",
"version": "1.0.10",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -7,6 +7,60 @@ export const xAI: ModelProvider = {
displayName: "Grok Beta",
contextLength: 128000,
recommendedFor: ["chat"],
regex: /grok-beta/,
},
{
model: "grok-2",
displayName: "Grok 2",
contextLength: 131072,
recommendedFor: ["chat"],
regex: /grok-2/,
},
{
model: "grok-3-mini",
displayName: "Grok 3 Mini",
contextLength: 131072,
maxCompletionTokens: 8000,
recommendedFor: ["chat"],
regex: /grok-3-mini/,
},
{
model: "grok-3",
displayName: "Grok 3",
contextLength: 131072,
recommendedFor: ["chat"],
regex: /grok-3/,
},
{
model: "grok-4-fast-reasoning",
displayName: "Grok 4 Fast Reasoning",
contextLength: 2000000,
maxCompletionTokens: 30000,
recommendedFor: ["chat"],
regex: /grok-4-fast-reasoning/,
},
{
model: "grok-4-fast-non-reasoning",
displayName: "Grok 4 Fast Non-Reasoning",
contextLength: 2000000,
maxCompletionTokens: 30000,
recommendedFor: ["chat"],
regex: /grok-4-fast-non-reasoning/,
},
{
model: "grok-4",
displayName: "Grok 4 Fast",
contextLength: 256000,
recommendedFor: ["chat"],
regex: /grok-4/,
},
{
model: "grok-code-fast-1",
displayName: "Grok Code Fast 1",
contextLength: 256000,
maxCompletionTokens: 10000,
recommendedFor: ["chat"],
regex: /grok-code-fast-1/,
},
],
id: "xAI",