open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

When using LM studio, user is prompted to enter their OpenAI API key when this value isn't needed

Open MikeBirdTech opened this issue 1 year ago • 5 comments

Describe the bug

The change in --local mode now requires users to launch OI with interpreter --api_base http://localhost:1234/v1 if they want to use LM Studio. When they run this command, they are prompted to enter their OpenAI API key. Pressing enter without typing any value allows OI to work with LM Studio successfully. However, the user should not be prompted to enter their OpenAI API key when they are using a local model.

Reproduce

  1. Disable OPENAI_API_KEY environment variable
  2. Run interpreter --api_base http://localhost:1234/v1
  3. Observe OI asking for OpenAI API key

Expected behavior

Running interpreter --api_base http://localhost:1234/v1 should work without prompting user for their OpenAI API key.

Screenshots

Screenshot 2024-03-13 at 11 41 50 AM

Open Interpreter version

0.2.2

Python version

3.11.3

Operating System name and version

MacOS 14.3

Additional context

No response

MikeBirdTech avatar Mar 13 '24 15:03 MikeBirdTech

I want to take a stab at this

lorenzejay avatar Mar 16 '24 21:03 lorenzejay

It's all yours @lorenzejay ! Thanks for stepping up 💪

Let us know if you need a hand with anything

MikeBirdTech avatar Mar 17 '24 01:03 MikeBirdTech

So this is my thoughts on this:

if interpreter.llm.api_base: we can assume this won't need an openAI API, so in validate_llm_settings, we can remove prompting for openai api key

lorenzejay avatar Mar 18 '24 21:03 lorenzejay

expected behavior? @MikeBirdTech open-interpreter

lorenzejay avatar Mar 18 '24 21:03 lorenzejay

when you don't use --api_base

open-interpreter-2

lorenzejay avatar Mar 18 '24 21:03 lorenzejay