Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

openai: don't scale temperature or frequency_penalty (#6514)

Yaroslavda915345d11b
diff --git a/openai/openai.go b/openai/openai.go
index a44996824..ea5402578 100644
--- a/openai/openai.go
+++ b/openai/openai.go
@@ -513,7 +513,7 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) {
}
if r.Temperature != nil {
- options["temperature"] = *r.Temperature * 2.0
+ options["temperature"] = *r.Temperature
} else {
options["temperature"] = 1.0
}
@@ -522,9 +522,9 @@ func fromCompleteRequest(r CompletionRequest) (api.GenerateRequest, error) {
options["seed"] = *r.Seed
}
- options["frequency_penalty"] = r.FrequencyPenalty * 2.0
+ options["frequency_penalty"] = r.FrequencyPenalty
- options["presence_penalty"] = r.PresencePenalty * 2.0
+ options["presence_penalty"] = r.PresencePenalty
if r.TopP != 0.0 {
options["top_p"] = r.TopP
diff --git a/openai/openai_test.go b/openai/openai_test.go
index b34f73c5c..25f570a1d 100644
--- a/openai/openai_test.go
+++ b/openai/openai_test.go
@@ -275,7 +275,7 @@ func TestCompletionsMiddleware(t *testing.T) {
Options: map[string]any{
"frequency_penalty": 0.0,
"presence_penalty": 0.0,
- "temperature": 1.6,
+ "temperature": 0.8,
"top_p": 1.0,
"stop": []any{"\n", "stop"},
},