Skip to content

Commit d20e44b

Browse files
authored
Grok 4.3 reasoning cannot be toggled (#2993)
1 parent 9de217e commit d20e44b

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

apps/web/src/lib/ai-gateway/providers/model-settings.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isKimiModel } from '@/lib/ai-gateway/providers/moonshotai';
44
import { isOpenAiModel } from '@/lib/ai-gateway/providers/openai';
55
import { isAlibabaDirectModel } from '@/lib/ai-gateway/providers/qwen';
66
import { seed_20_code_free_model } from '@/lib/ai-gateway/providers/seed';
7-
import { isGrok4Model, isGrokModel } from '@/lib/ai-gateway/providers/xai';
7+
import { isGrokModel, isGrokToggleableReasoningModel } from '@/lib/ai-gateway/providers/xai';
88
import { isGlmModel } from '@/lib/ai-gateway/providers/zai';
99
import type {
1010
CustomLlmProvider,
@@ -66,6 +66,7 @@ export function getModelVariants(model: string): OpenCodeSettings['variants'] {
6666
if (
6767
isKimiModel(model) ||
6868
isGlmModel(model) ||
69+
isGrokToggleableReasoningModel(model) ||
6970
isAlibabaDirectModel(model) ||
7071
isGemmaModel(model)
7172
) {
@@ -87,12 +88,6 @@ export function getModelVariants(model: string): OpenCodeSettings['variants'] {
8788
high: { reasoning: { enabled: true, effort: 'high' } },
8889
};
8990
}
90-
if (isGrok4Model(model)) {
91-
return {
92-
'non-reasoning': { reasoning: { enabled: false, effort: 'none' } },
93-
reasoning: { reasoning: { enabled: true, effort: 'medium' } },
94-
};
95-
}
9691
return undefined;
9792
}
9893

apps/web/src/lib/ai-gateway/providers/xai.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export function isGrok4Model(model: string) {
2424
return model.includes('grok-4');
2525
}
2626

27+
export function isGrokToggleableReasoningModel(model: string) {
28+
return model.includes('grok-4.1') || model.includes('grok-4.2');
29+
}
30+
2731
export function applyXaiModelSettings(
2832
requestToMutate: GatewayRequest,
2933
extraHeaders: Record<string, string>

0 commit comments

Comments
 (0)