Skip to content

Commit e9b3f7b

Browse files
scotty595claude
andcommitted
fix: set temperature to 0.0 for deterministic routing
Changed routing model temperature from 0.1 to 0.0 to ensure completely deterministic JSON output from LLM. This eliminates variability in the structured response format that was causing intermittent parsing errors. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b6648b3 commit e9b3f7b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/config/llm-models.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const MODEL_CONFIGS: Record<string, ModelConfig> = {
141141
provider: 'groq',
142142
baseUrl: 'https://api.groq.com/openai/v1/chat/completions',
143143
supportsJsonSchema: true,
144-
defaultTemperature: 0.1,
144+
defaultTemperature: 0.0,
145145
maxTokens: 1000,
146146
description: 'GPT OSS 20B via Groq. Good for structured output.',
147147
},
@@ -150,7 +150,7 @@ export const MODEL_CONFIGS: Record<string, ModelConfig> = {
150150
provider: 'groq',
151151
baseUrl: 'https://api.groq.com/openai/v1/chat/completions',
152152
supportsJsonSchema: true,
153-
defaultTemperature: 0.1,
153+
defaultTemperature: 0.0,
154154
maxTokens: 2000,
155155
description: 'GPT OSS 120B via Groq. Better reasoning and structured output.',
156156
},
@@ -189,7 +189,7 @@ export function getModelConfig(modelId: string): ModelConfig {
189189
provider,
190190
baseUrl,
191191
supportsJsonSchema,
192-
defaultTemperature: 0.1,
192+
defaultTemperature: 0.0,
193193
maxTokens: 1000,
194194
description: `Unknown model - inferred ${provider} provider`,
195195
};

src/services/drift/operations/classify-route/helpers/call-llm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async function callGroq(
153153

154154
// Only add temperature if model supports it
155155
if (supportsTemperature) {
156-
requestParams.temperature = defaultTemperature ?? 0.1;
156+
requestParams.temperature = defaultTemperature ?? 0.0;
157157
}
158158

159159
// Add strict JSON schema if supported, otherwise use json_object mode
@@ -252,7 +252,7 @@ async function callOpenAI(
252252

253253
// Only add temperature if model supports it
254254
if (supportsTemperature) {
255-
body.temperature = defaultTemperature ?? 0.1;
255+
body.temperature = defaultTemperature ?? 0.0;
256256
}
257257

258258
// Use routing-only or routing+facts schema based on flag

0 commit comments

Comments
 (0)