[GH-ISSUE #12004] Chat completion API throws errors for reasoning_effort set to false (gpt-oss) and 'minimal' level is not supported #7970

Closed
opened 2026-04-12 20:09:19 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @Cdany2001 on GitHub (Aug 21, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12004

What is the issue?

I'm running gpt-oss:20b and I encountered the following problems:

  • the OpenAI endpoint supports values such as minimal/low/medium/high but the Ollama version of the endpoint seems to not be fully compatible and it allows only the last 3 levels + the possibility to set it to true or false (Ollama response: "message": "invalid think value: \"minimal\" (must be \"high\", \"medium\", \"low\", true, or false)" )
  • when attempting to set it to false via the API request i get this error:
    { "error": { "message": "json: cannot unmarshal bool into Go struct field ChatCompletionRequest.reasoning_effort of type string", "type": "invalid_request_error", "param": null, "code": null } }
    To disable the thinking, are there other fields from the request that I should populate instead?

Relevant log output


OS

Linux, Docker

GPU

Nvidia

CPU

Intel

Ollama version

0.11.6

Originally created by @Cdany2001 on GitHub (Aug 21, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12004 ### What is the issue? I'm running gpt-oss:20b and I encountered the following problems: - the OpenAI endpoint supports values such as [minimal/low/medium/high](https://platform.openai.com/docs/api-reference/chat/create#chat_create-reasoning_effort) but the Ollama version of the endpoint seems to not be fully compatible and it allows only the last 3 levels + the possibility to set it to true or false `(Ollama response: "message": "invalid think value: \"minimal\" (must be \"high\", \"medium\", \"low\", true, or false)" )` - when attempting to set it to false via the API request i get this error: `{ "error": { "message": "json: cannot unmarshal bool into Go struct field ChatCompletionRequest.reasoning_effort of type string", "type": "invalid_request_error", "param": null, "code": null } }` To disable the thinking, are there other fields from the request that I should populate instead? ### Relevant log output ```shell ``` ### OS Linux, Docker ### GPU Nvidia ### CPU Intel ### Ollama version 0.11.6
GiteaMirror added the bug label 2026-04-12 20:09:19 -05:00
Author
Owner

@Cdany2001 commented on GitHub (Aug 28, 2025):

I'll close this since:

  • yes the OpenAI endpoints allow "minimal" as a rasoning_effort value, but it is not supported by Gpt-Oss
  • from the code, I see that the message that states that the think value can be a bool is coming from a class that funnels in different attributes from different models/parameters, while the error that I received when i attempted to set it to false was coming from a class that was higher in the hierarchy and described how the chat completion request should look like (and so allowing only strings) => tbh, an improvement of the error describing the allowed values would be welcomed
<!-- gh-comment-id:3233660393 --> @Cdany2001 commented on GitHub (Aug 28, 2025): I'll close this since: - yes the OpenAI endpoints allow "minimal" as a rasoning_effort value, but it is not supported by Gpt-Oss - from the code, I see that the message that states that the think value can be a bool is coming from a class that funnels in different attributes from different models/parameters, while the error that I received when i attempted to set it to false was coming from a class that was higher in the hierarchy and described how the chat completion request should look like (and so allowing only strings) => tbh, an improvement of the error describing the allowed values would be welcomed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7970