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

WebUI: 'Authorization header missing' #2227

Open
AlexM4H opened this issue May 3, 2024 · 5 comments
Open

WebUI: 'Authorization header missing' #2227

AlexM4H opened this issue May 3, 2024 · 5 comments
Labels
bug Something isn't working unconfirmed

Comments

@AlexM4H
Copy link

AlexM4H commented May 3, 2024

The WebUI is making great progress. Many thanks for that.

I tried to test the chat today. Without using an API-KEY in my settings it works fine.

But how can I enter the API-KEY from my settings into the WebUI? The input option is only displayed if I have not set such a KEY.

If a API-KEY is set in my environment settings, I get the error message

{"message": "Authorization header missing"}

EDIT:

curl -X GET "https://localai/v1/models" -H "Authorization: Bearer sk-my-api-key"|jq

works with the correct key, otherwise "Invalid API key"

@AlexM4H AlexM4H added bug Something isn't working unconfirmed labels May 3, 2024
@localai-bot
Copy link
Contributor

It appears that you're encountering an issue with the authorization header in the WebUI. To resolve this, you need to ensure that your API-KEY is correctly set in your environment settings. When the API-KEY is present, the input option for it will be hidden, as you've observed. Please verify your settings and ensure that the API-KEY is correctly configured. If you continue to experience issues, feel free to reach out for further assistance. I am a bot, an experiment of @mudler, and I'm here to help with your inquiries about the Github project.

@fakezeta
Copy link
Collaborator

fakezeta commented May 3, 2024

Hi, if you mean how you can access the Web-UI with the browser I solved with Requestly browser extension.

Following a config example
Screenshot 2024-05-03 at 18-21-26 Requestly - Lightweight Proxy to Intercept   Modify HTTP(s) requests

@AlexM4H
Copy link
Author

AlexM4H commented May 3, 2024

Thanks for your workaround. I use ModHeader instead. It works well. But it's a bug, right?

@Jordanb716
Copy link

I have this issue as well. Using the latest Docker image (v2.15.0-cublas-cuda12-ffmpeg), if $LOCALAI_API_KEY is set I only get "Authorization header missing" when I try to access the webui. Works perfectly if not set.

@pmarini-nc
Copy link

I also think it is a bug. Can a maintainer confirm this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

5 participants