[GH-ISSUE #14726] Set thinking level to Off using Python package #56035

Closed
opened 2026-04-29 10:10:08 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @haseebsultankhan on GitHub (Mar 9, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14726

as through ollama cli , we can easily configure /set nothink for the thinking models.
there should also be a feature to disable when calling ollama through python or api to set the thinking level to none

from ollama import chat

def heading(text):
print(text)
print('=' * len(text))

messages = [
{'role': 'user', 'content': 'What is 10 + 23?'},
]

gpt-oss supports 'low', 'medium', 'high'

levels = ['low', 'medium', 'high']
for i, level in enumerate(levels):
response = chat('gpt-oss:20b', messages=messages, think=level)

heading(f'Thinking ({level})')
print(response.message.thinking)
print('\n')
heading('Response')
print(response.message.content)
print('\n')
if i < len(levels) - 1:
print('-' * 20)
print('\n')

it should be

levels = ['none , 'low', 'medium', 'high']

Originally created by @haseebsultankhan on GitHub (Mar 9, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14726 as through ollama cli , we can easily configure /set nothink for the thinking models. there should also be a feature to disable when calling ollama through python or api to set the thinking level to none from ollama import chat def heading(text): print(text) print('=' * len(text)) messages = [ {'role': 'user', 'content': 'What is 10 + 23?'}, ] # gpt-oss supports 'low', 'medium', 'high' levels = ['low', 'medium', 'high'] for i, level in enumerate(levels): response = chat('gpt-oss:20b', messages=messages, think=level) heading(f'Thinking ({level})') print(response.message.thinking) print('\n') heading('Response') print(response.message.content) print('\n') if i < len(levels) - 1: print('-' * 20) print('\n') it should be levels = ['none , 'low', 'medium', 'high']
GiteaMirror added the feature request label 2026-04-29 10:10:08 -05:00
Author
Owner

@rick-github commented on GitHub (Mar 9, 2026):

Set think=false.

<!-- gh-comment-id:4021879788 --> @rick-github commented on GitHub (Mar 9, 2026): Set `think=false`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#56035