Skip to content

Commit 987f59b

Browse files
committed
API base with non-openai providers
1 parent f6f9dd2 commit 987f59b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

interpreter/core/llm/llm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def run(self, messages):
187187
params["api_key"] = self.api_key
188188
if self.api_base:
189189
params["api_base"] = self.api_base
190-
params["custom_llm_provider"] = "openai"
191190
if self.api_version:
192191
params["api_version"] = self.api_version
193192
if self.max_tokens:

interpreter/terminal_interface/start_terminal_interface.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ def start_terminal_interface(interpreter):
218218
"nargs": "?", # This means you can pass in nothing if you want
219219
},
220220
{"name": "profiles", "help_text": "opens profiles directory", "type": bool},
221-
{"name": "local_models", "help_text": "opens local models directory", "type": bool},
221+
{
222+
"name": "local_models",
223+
"help_text": "opens local models directory",
224+
"type": bool,
225+
},
222226
{
223227
"name": "conversations",
224228
"help_text": "list conversations to resume",
@@ -304,7 +308,7 @@ def start_terminal_interface(interpreter):
304308
if args.profiles:
305309
open_storage_dir("profiles")
306310
return
307-
311+
308312
if args.local_models:
309313
open_storage_dir("models")
310314
return
@@ -381,8 +385,7 @@ def start_terminal_interface(interpreter):
381385
except:
382386
# Doesn't matter
383387
pass
384-
385-
388+
386389
if interpreter.llm.api_base:
387390
if (
388391
not interpreter.llm.model.lower().startswith("openai/")
@@ -391,12 +394,11 @@ def start_terminal_interface(interpreter):
391394
and not interpreter.llm.model.lower().startswith("jan")
392395
and not interpreter.llm.model.lower().startswith("local")
393396
):
394-
interpreter.llm.model = "openai/" + interpreter.llm.model
397+
interpreter.llm.model = "openai/" + interpreter.llm.model
395398
elif interpreter.llm.model.lower().startswith("jan/"):
396399
# Strip jan/ from the model name
397400
interpreter.llm.model = interpreter.llm.model[4:]
398401

399-
400402
# If --conversations is used, run conversation_navigator
401403
if args.conversations:
402404
conversation_navigator(interpreter)

0 commit comments

Comments
 (0)