Skip to content

Commit e094d53

Browse files
committed
fix: use static temperature 1 for gpt-5 models
1 parent 12aea6a commit e094d53

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

skynet/modules/ttt/llm_selector.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,17 @@ def select(
7070
if processor == Processors.OPENAI:
7171
log.info(f'Forwarding inference to OpenAI for customer {customer_id}')
7272

73+
model_name = options.get('metadata').get('model')
74+
75+
# gpt-5 family does not support temperature other than 1 anymore
76+
model_temp = 1 if model_name.startswith('gpt-5') else temperature
77+
7378
return ChatOpenAI(
7479
api_key=options.get('secret'),
7580
max_completion_tokens=max_completion_tokens,
76-
model_name=options.get('metadata').get('model'),
81+
model_name=model_name,
7782
streaming=stream,
78-
temperature=temperature,
83+
temperature=model_temp,
7984
)
8085
elif processor == Processors.AZURE:
8186
log.info(f'Forwarding inference to Azure-OpenAI for customer {customer_id}')

0 commit comments

Comments
 (0)