change default model and add reasoning mode

This commit is contained in:
Hayden Johnson 2025-04-08 12:39:09 -07:00
parent 24c6625f30
commit 01e6a3ef75

View file

@ -11,7 +11,8 @@ from pygments.formatters import TerminalFormatter
import os import os
server = 'localhost:11434' server = 'localhost:11434'
model = 'llama3.1:8b-instruct-q8_0' model = 'gemma3:12b'
reasoning_model='deepseek-r1:14b'
temp = 0.2 temp = 0.2
pattern = r'```[a-z]*\n[\s\S]*?\n```' pattern = r'```[a-z]*\n[\s\S]*?\n```'
@ -186,6 +187,8 @@ def chat(message, stream=True):
def chat2(args, user_input, stream=True): def chat2(args, user_input, stream=True):
global conversation global conversation
global model
global reasoning_model
command_result = parse_commands(user_input) command_result = parse_commands(user_input)
if command_result: if command_result:
if type(command_result) == bool: if type(command_result) == bool:
@ -194,8 +197,9 @@ def chat2(args, user_input, stream=True):
user_input = command_result user_input = command_result
print('\033[91m' + 'assistant' + '\033[0m: ', end='') print('\033[91m' + 'assistant' + '\033[0m: ', end='')
if args.reflect: if args.reasoning:
result = reflection_mode(user_input, stream) model = reasoning_model
result = chat(user_input, stream)
else: else:
result = chat(user_input, stream) result = chat(user_input, stream)
@ -242,7 +246,7 @@ def parse_args():
# Add the --host argument # Add the --host argument
parser.add_argument('--host', nargs='?', const=True, default=False, help='Specify host of ollama server') parser.add_argument('--host', nargs='?', const=True, default=False, help='Specify host of ollama server')
# Add the --reflect argument # Add the --reflect argument
parser.add_argument('--reflect', action='store_true', help='Use reflection prompting style to improve output. May be slower and not work with all models.') parser.add_argument('--reasoning', '-r', action='store_true', help='Use the default reasoning model deepseek-r1:14b')
# Parse the arguments # Parse the arguments
return parser.parse_args() return parser.parse_args()