-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Summary
When using the DeepSeek provider (AI SDK path), the outgoing request body shows temperature: 0 even though the intended DeepSeek default is DEEP_SEEK_DEFAULT_TEMPERATURE = 0.3.
Root Cause
getModelParams()has a default parameterdefaultTemperature = 0(model-params.ts).DeepSeekHandler.getModel()callsgetModelParams({ format: "openai", ... })without passingdefaultTemperature, so the computedtemperaturebecomes0via:customTemperature ?? model.defaultTemperature ?? defaultTemperature(model-params.ts)- which resolves to
undefined ?? undefined ?? 0=>0.
- The DeepSeek AI SDK request options then use:
temperature: this.options.modelTemperature ?? temperature ?? DEEP_SEEK_DEFAULT_TEMPERATURE(deepseek.ts)- Since
temperatureis0(not nullish), it wins andDEEP_SEEK_DEFAULT_TEMPERATUREis never reached.
Expected
If the user did not configure a temperature, DeepSeek requests should default to 0.3 as per DEEP_SEEK_DEFAULT_TEMPERATURE.
Actual
DeepSeek AI SDK requests default to 0 unless the user explicitly sets a temperature.
Suggested Fix (pick one)
Option A (targeted; minimal blast radius)
Pass defaultTemperature: DEEP_SEEK_DEFAULT_TEMPERATURE into getModelParams from DeepSeekHandler.getModel().
Option B (broader behavior change)
Change getModelParams default from 0 to undefined and update call sites/tests.
Option C (explicit defaults)
Change getModelParams default to undefined, then make each provider pass an explicit defaultTemperature matching its intended behavior.
Notes
This was discovered while fixing DeepSeek reasoning round-tripping; not part of that patch scope.