Parameters setting like temperature do not work with responses api
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2k
- Forks
- 291
- Avg merge
- 30m
- Merged PRs (30d)
- 3
Description
It seems setting stuff like temperature does not work properly. When set it gets ignored and passed to localai with other settings instead.
{{
"input": [
{
"role": "user",
"content": "This is a test prompt."
}
],
"model": "MyAgent",
"temperature": 1.0,
"frequency_penalty": 0.0,
"presence_penalty": 0.0,
"repeat_penalty": 1.0,
"top_p": 0.95,
"top_k": 64,
"microstat": 0,
"microstat_eta": 0.2,
"microstat_tau": 4.0
}}
When viewed in localai with debug flag it shows me this:
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "stream": false,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "cache_prompt": false,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "n_predict": -1,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "top_k": 40,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "top_p": 0.949999988079071,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "typical_p": 1.0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "temperature": 0.8999999761581421,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "repeat_last_n": 0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "repeat_penalty": 0.0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "frequency_penalty": 0.0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "presence_penalty": 0.0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "mirostat": 0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "mirostat_tau": 5.0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "mirostat_eta": 0.10000000149011612,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "n_keep": 0,
9:05AM DBG GRPC(gemma-3-12b-it-127.0.0.1:52164): stdout "seed": 48382911,
As you can see stuff like top_k is getting ignored, even temperature is not set to 1.0
I found these settings somewhere claiming that they'd be good for gemma-3 but I am unable to test them by sending them via prompt. It should work though, since openai also defines the property "temperature" to set it with each call. If I send a prompt directly to localai via chat completions api it does work with temperature so the bug seems to be in responses api.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Responses API request handling and compare how generation parameters are forwarded with the chat completions API path. Reproduce the request using temperature, top_k, and the other listed settings, then verify that the values received by LocalAI match the request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100