mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
feat: add grok-4-fast model to xAI provider
- Added grok-4-fast model configuration to xaiModels in packages/types/src/providers/xai.ts - Added test case to verify grok-4-fast model selection works correctly - Model includes 2M context window and 30K max tokens support Fixes #8474
This commit is contained in:
parent
8622d93f59
commit
a02a0e7db9
2 changed files with 20 additions and 0 deletions
|
|
@ -28,6 +28,15 @@ export const xaiModels = {
|
|||
cacheReadsPrice: 0.75,
|
||||
description: "xAI's Grok-4 model with 256K context window",
|
||||
},
|
||||
"grok-4-fast": {
|
||||
maxTokens: 30_000,
|
||||
contextWindow: 2_000_000,
|
||||
supportsImages: false,
|
||||
supportsPromptCache: false,
|
||||
inputPrice: 1.0,
|
||||
outputPrice: 5.0,
|
||||
description: "xAI's Grok-4 Fast model with 2M context window and SOTA cost-efficiency",
|
||||
},
|
||||
"grok-3": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 131072,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,17 @@ describe("XAIHandler", () => {
|
|||
expect(model.info).toEqual(xaiModels[testModelId])
|
||||
})
|
||||
|
||||
test("should return grok-4-fast model when specified", () => {
|
||||
const testModelId = "grok-4-fast"
|
||||
const handlerWithModel = new XAIHandler({ apiModelId: testModelId })
|
||||
const model = handlerWithModel.getModel()
|
||||
|
||||
expect(model.id).toBe(testModelId)
|
||||
expect(model.info).toEqual(xaiModels[testModelId])
|
||||
expect(model.info.contextWindow).toBe(2_000_000)
|
||||
expect(model.info.maxTokens).toBe(30_000)
|
||||
})
|
||||
|
||||
it("should include reasoning_effort parameter for mini models", async () => {
|
||||
const miniModelHandler = new XAIHandler({
|
||||
apiModelId: "grok-3-mini",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue