[GH-ISSUE #11012] Enable / disable thinking for openai-python #7260

Open
opened 2026-04-12 19:18:33 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @mailnoemail on GitHub (Jun 7, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11012

Originally assigned to: @ParthSareen on GitHub.

Please add support for think parameter when creating query using openai-python. For example you can use extra_body parameter to add think parameter.

Originally created by @mailnoemail on GitHub (Jun 7, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11012 Originally assigned to: @ParthSareen on GitHub. Please add support for **think** parameter when creating query using openai-python. For example you can use **extra_body** parameter to add **think** parameter.
GiteaMirror added the feature request label 2026-04-12 19:18:33 -05:00
Author
Owner
<!-- gh-comment-id:3019971941 --> @basnijholt commented on GitHub (Jun 30, 2025): xrefs: - https://github.com/ollama/ollama/issues/3645 - https://github.com/ollama/ollama/issues/2963
Author
Owner

@DouweM commented on GitHub (Jun 30, 2025):

I think this is just a matter of adding a think field to ChatCompletionsRequest here:

44b17d2bfa/openai/openai.go (L84)

And then to put this value into options like here:

44b17d2bfa/openai/openai.go (L483-L495)

OpenAI doesn't have a think field currently, but in case they add something later with a different name or behavior that we'll want to support, we could call it ollama_think for now.

<!-- gh-comment-id:3019980498 --> @DouweM commented on GitHub (Jun 30, 2025): I think this is just a matter of adding a `think` field to `ChatCompletionsRequest` here: https://github.com/ollama/ollama/blob/44b17d2bfa0073e012679152421c0b69671d380e/openai/openai.go#L84 And then to put this value into `options` like here: https://github.com/ollama/ollama/blob/44b17d2bfa0073e012679152421c0b69671d380e/openai/openai.go#L483-L495 OpenAI doesn't have a `think` field currently, but in case they add something later with a different name or behavior that we'll want to support, we could call it `ollama_think` for now.
Author
Owner

@basnijholt commented on GitHub (Jun 30, 2025):

Thanks @DouweM!

I've opened PR #11249 that implements options support for the OpenAI API endpoints. This adds support for think and keep_alive parameters and establishes a foundation for future parameter exposure. Would appreciate any feedback!

<!-- gh-comment-id:3021171083 --> @basnijholt commented on GitHub (Jun 30, 2025): Thanks @DouweM! I've opened [PR #11249](https://github.com/ollama/ollama/pull/11249/) that implements `options` support for the OpenAI API endpoints. This adds support for `think` and `keep_alive` parameters and establishes a foundation for future parameter exposure. Would appreciate any feedback!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#7260