Skip to content

Commit dbcec3d

Browse files
authored
💄 style: add Grok Code Fast 1 model (#8982)
* ✨ feat: add Grok Code Fast 1 model * 🐛 fix(xai): comment out unsupported settings for reasoningEffort parameter
1 parent 85f9ca5 commit dbcec3d

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/model-runtime/src/xai/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface XAIModelCard {
66
id: string;
77
}
88

9-
export const GrokReasoningModels = new Set(['grok-3-mini', 'grok-4']);
9+
export const GrokReasoningModels = new Set(['grok-3-mini', 'grok-4', 'grok-code']);
1010

1111
export const isGrokReasoningModel = (model: string) =>
1212
Array.from(GrokReasoningModels).some((id) => model.includes(id));

src/config/aiModels/xai.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
22

33
// https://docs.x.ai/docs/models
44
const xaiChatModels: AIChatModelCard[] = [
5+
{
6+
abilities: {
7+
functionCall: true,
8+
reasoning: true,
9+
},
10+
contextWindowTokens: 256_000,
11+
description:
12+
'我们很高兴推出 grok-code-fast-1,这是一款快速且经济高效的推理模型,在代理编码方面表现出色。',
13+
displayName: 'Grok Code Fast 1',
14+
enabled: true,
15+
id: 'grok-code-fast-1',
16+
pricing: {
17+
units: [
18+
{ name: 'textInput_cacheRead', rate: 0.02, strategy: 'fixed', unit: 'millionTokens' },
19+
{ name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
20+
{ name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
21+
],
22+
},
23+
releasedAt: '2025-08-28',
24+
// settings: {
25+
// reasoning_effort is not supported by grok-code. Specifying reasoning_effort parameter will get an error response.
26+
// extendParams: ['reasoningEffort'],
27+
// },
28+
type: 'chat',
29+
},
530
{
631
abilities: {
732
functionCall: true,

0 commit comments

Comments
 (0)