Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LM Studio #207

Closed
kokuAI6 opened this issue Oct 23, 2023 · 5 comments
Closed

LM Studio #207

kokuAI6 opened this issue Oct 23, 2023 · 5 comments

Comments

@kokuAI6
Copy link

kokuAI6 commented Oct 23, 2023

Any guidance on setting up with LM Studio API ?

@diskreet90
Copy link

#27 there's some tips on there that got it working for me. Using mistral 7b, it's alright but ChatGPT def does better

@dahifi
Copy link
Contributor

dahifi commented Nov 5, 2023

The TLDR is

export OPENAI_API_KEY="sk-dummy1234"
export OPENAI_API_BASE="http://localhost:1234/v1"

@yashkite
Copy link

In Windows PowerShell, you can set environment variables using the following commands:

$env:OPENAI_API_KEY="sk-dummy1234"
$env:OPENAI_API_BASE="http://localhost:1234/v1"

This sets the OPENAI_API_KEY and OPENAI_API_BASE environment variables with the specified values. Note that there are no spaces around the equal sign, and the values are enclosed in double quotes.

Keep in mind that these changes will only persist for the duration of your PowerShell session. If you want to make them permanent, you might consider adding them to your user or system environment variables.

If you are using Command Prompt instead of PowerShell, you can use the set command:

set OPENAI_API_KEY=sk-dummy1234
set OPENAI_API_BASE=http://localhost:1234/v1

Again, note that there are no spaces around the equal sign. Environment variable changes made in Command Prompt will also only persist for the duration of that session.

@dade6
Copy link

dade6 commented Jan 17, 2024

set OPENAI_API_KEY=sk-dummy1234
set OPENAI_API_BASE=http://localhost:1234/v1

Again, note that there are no spaces around the equal sign. Environment variable changes made in Command Prompt will also only persist for the duration of that session.

Hi @yashkite, if i do like you suggested I get this error:
File "C:\ProgramData\anaconda3\envs\ChatDev_conda_env\lib\site-packages\openai_base_client.py", line 877, in _request
raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-dummy1234. You can find your API key at https://platform.openai.com account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Can you please help me?

@ShirakuraKeishi
Copy link

Hi @dade6 !
You may have already solved this problem, but I decided to comment for the benefit of newbies like me.
You need to rewrite the variable names slightly as follows.
set BASE_URL=http://localhost:1234/v1
I found a hint of the solution #312 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants