File tree Expand file tree Collapse file tree
apps/web/src/lib/ai-gateway/providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { isKimiModel } from '@/lib/ai-gateway/providers/moonshotai';
44import { isOpenAiModel } from '@/lib/ai-gateway/providers/openai' ;
55import { isAlibabaDirectModel } from '@/lib/ai-gateway/providers/qwen' ;
66import { 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' ;
88import { isGlmModel } from '@/lib/ai-gateway/providers/zai' ;
99import 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
Original file line number Diff line number Diff 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+
2731export function applyXaiModelSettings (
2832 requestToMutate : GatewayRequest ,
2933 extraHeaders : Record < string , string >
You can’t perform that action at this time.
0 commit comments