shell_gpt icon indicating copy to clipboard operation
shell_gpt copied to clipboard

Using o4-mini complains of bad "temperature" value in API

Open SohamG opened this issue 8 months ago • 4 comments

Wanted to upgrade to o4-mini, but apparently the API for o4-mini only accepts "1.0" for the temperature field. I didn't have much success in setting this on the terminal, and didn't find a well documented .sgptrc variable I could set.

SohamG avatar Apr 21 '25 01:04 SohamG

As a workaround for now, you can indeed set --temperature=1.0 on the command line, e.g

sgpt "Say hello, world" --temperature 1.0 --model o4-mini

maxregan avatar Apr 25 '25 20:04 maxregan

I ran into this same issue, but I'm using the _sgpt_zsh bindkey integration. I had to redefine it to be something like this. Would be nice if the .sgptrc config could set a default TEMPERATURE value so avoid this. Or just ideally if it was aware of which models don't support temperature, but that's a bigger project.

function _sgpt_zsh() {
...
    local SGPT_EXTRAS=(--temperature=1.0 --no-functions)
...
    BUFFER="$(sgpt --shell $SGPT_EXTRAS <<< "$_sgpt_prev_cmd")"
...
}

(passing --no-functions is also required for o4-mini to work)

varenc avatar May 01 '25 23:05 varenc

There is no way to just set the temperature to 0.7, for example? It's just about the o4-mini, or all the reasoning models don't support custom temperature.

sam-siavoshian avatar May 29 '25 03:05 sam-siavoshian

As an FYI, this also affects the new GPT5 models released today.

dan-nicholls avatar Aug 08 '25 06:08 dan-nicholls