I'm trying to use LM Studio as an OpenAI-compatible backend, but the application still requires an API key for OpenAI, even though I'm setting the OPENAI_BASE_URL to the LM Studio URL.
Steps to reproduce:
-
Set environment variables as follows:
OPENAI_BASE_URL=http://localhost:1234/v1
-
Run the application without setting OPENAI_API_KEY (since LM Studio doesn’t require one).
Expected behavior:
The app should connect to LM Studio successfully without needing an OpenAI API key.
Actual behavior:
The application immediately fails with the following error message in the log:
level=fatal msg="Please set the OPENAI_API_KEY environment variable for OpenAI provider."
Additional context:
Even when providing a dummy API key, the same error occurs.
It seems the application enforces OPENAI_API_KEY presence regardless of the base URL or provider.
I'm trying to use LM Studio as an OpenAI-compatible backend, but the application still requires an API key for OpenAI, even though I'm setting the OPENAI_BASE_URL to the LM Studio URL.
Steps to reproduce:
Set environment variables as follows:
OPENAI_BASE_URL=http://localhost:1234/v1Run the application without setting OPENAI_API_KEY (since LM Studio doesn’t require one).
Expected behavior:
The app should connect to LM Studio successfully without needing an OpenAI API key.
Actual behavior:
The application immediately fails with the following error message in the log:
level=fatal msg="Please set the OPENAI_API_KEY environment variable for OpenAI provider."Additional context:
Even when providing a dummy API key, the same error occurs.
It seems the application enforces OPENAI_API_KEY presence regardless of the base URL or provider.