Skip to content

Commit 50c03ea

Browse files
author
Zoo (VP)
committed
feat(xai): add grok-build-0.1 model metadata
1 parent bac8adc commit 50c03ea

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎packages/types/src/providers/xai.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ export const xaiModels = {
4848
includedTools: ["search_replace"],
4949
excludedTools: ["apply_diff"],
5050
},
51+
"grok-build-0.1": {
52+
maxTokens: 65_536,
53+
contextWindow: 256_000,
54+
supportsImages: true,
55+
supportsPromptCache: true,
56+
inputPrice: 1.0,
57+
outputPrice: 2.0,
58+
cacheWritesPrice: 0.2,
59+
cacheReadsPrice: 0.2,
60+
description: "xAI's Grok Build 0.1 agentic coding model with 256K context window",
61+
includedTools: ["search_replace"],
62+
excludedTools: ["apply_diff"],
63+
},
5164
"grok-4-1-fast-reasoning": {
5265
maxTokens: 65_536,
5366
contextWindow: 2_000_000,

‎src/api/providers/__tests__/xai.spec.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ describe("XAIHandler", () => {
6969
expect(model.info).toEqual(xaiModels[testModelId])
7070
})
7171

72+
it("should return grok-build-0.1 when specified", () => {
73+
const testModelId = "grok-build-0.1"
74+
const handlerWithModel = new XAIHandler({ apiModelId: testModelId })
75+
const model = handlerWithModel.getModel()
76+
expect(model.id).toBe(testModelId)
77+
expect(model.info).toEqual(xaiModels[testModelId])
78+
})
79+
80+
it("should return default model for an unknown model id", () => {
81+
const handlerWithModel = new XAIHandler({ apiModelId: "grok-build-0.1-not-a-model" })
82+
const model = handlerWithModel.getModel()
83+
expect(model.id).toBe(xaiDefaultModelId)
84+
expect(model.info).toEqual(xaiModels[xaiDefaultModelId])
85+
})
86+
7287
it("should use Responses API (client.responses.create)", async () => {
7388
mockResponsesCreate.mockResolvedValueOnce(asyncStreamFrom([]))
7489

0 commit comments

Comments
 (0)