BUG #2 LocalAI with API KEY set can not pull model #237

Closed
opened 2026-02-28 04:37:50 -05:00 by deekerman · 6 comments
Owner

Originally created by @lunamidori5 on GitHub (Dec 8, 2023).

Originally assigned to: @timothycarambat on GitHub.

API KEY is not getting passed when AnythingLLM requests models from LocalAI when a API KEY is set. Returns a 401.

Originally created by @lunamidori5 on GitHub (Dec 8, 2023). Originally assigned to: @timothycarambat on GitHub. API KEY is not getting passed when AnythingLLM requests models from LocalAI when a API KEY is set. Returns a 401.
deekerman 2026-02-28 04:37:50 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@timothycarambat commented on GitHub (Dec 8, 2023):

Given that the API using the OpenAi basePath overwrite, I dont see anything wrong with the implementation here. Obviously getting a 401 means that the API key is expected by LocalAI, but AnythingLLM should be appending it here.

github.com/Mintplex-Labs/anything-llm@8cc1455b72/server/utils/AiProviders/localAi/index.js (L9C4-L16)

@timothycarambat commented on GitHub (Dec 8, 2023): Given that the API using the OpenAi `basePath` overwrite, I dont see anything wrong with the implementation here. Obviously getting a 401 means that the API key is expected by LocalAI, but AnythingLLM should be appending it here. https://github.com/Mintplex-Labs/anything-llm/blob/8cc1455b721dfcea7e4f3b7d83787623f1054c91/server/utils/AiProviders/localAi/index.js#L9C4-L16
Author
Owner

@lunamidori5 commented on GitHub (Dec 8, 2023):

@timothycarambat its not sending the API KEY with both model and embedding requests

2:48AM DBG [WatchDog] Watchdog checks for idle connections
[172.23.0.1]:46020 401 - GET /v1/models
2:49AM DBG [WatchDog] Watchdog checks for idle connections
2:49AM DBG [WatchDog] Watchdog checks for idle connections
2:50AM DBG [WatchDog] Watchdog checks for idle connections
[172.23.0.1]:46020 401 - POST /v1/embeddings
[172.23.0.1]:46020 401 - POST /v1/embeddings
2:50AM DBG [WatchDog] Watchdog checks for idle connections
[172.23.0.1]:46020 401 - POST /v1/embeddings
2:51AM DBG [WatchDog] Watchdog checks for idle connections
@lunamidori5 commented on GitHub (Dec 8, 2023): @timothycarambat its not sending the API KEY with both model and embedding requests ``` 2:48AM DBG [WatchDog] Watchdog checks for idle connections [172.23.0.1]:46020 401 - GET /v1/models 2:49AM DBG [WatchDog] Watchdog checks for idle connections 2:49AM DBG [WatchDog] Watchdog checks for idle connections 2:50AM DBG [WatchDog] Watchdog checks for idle connections [172.23.0.1]:46020 401 - POST /v1/embeddings [172.23.0.1]:46020 401 - POST /v1/embeddings 2:50AM DBG [WatchDog] Watchdog checks for idle connections [172.23.0.1]:46020 401 - POST /v1/embeddings 2:51AM DBG [WatchDog] Watchdog checks for idle connections ```
Author
Owner

@lunamidori5 commented on GitHub (Dec 8, 2023):

Fixed the error with the embeds by copy and paste the code from the localai index file to the embeding index file
index.txt

@lunamidori5 commented on GitHub (Dec 8, 2023): Fixed the error with the embeds by copy and paste the code from the localai index file to the embeding index file [index.txt](https://github.com/Mintplex-Labs/anything-llm/files/13622505/index.txt)
Author
Owner

@timothycarambat commented on GitHub (Dec 9, 2023):

Oh so just the API key is missing on the embedding and is not being inherited in the embedding file. Will update this right now then.

@timothycarambat commented on GitHub (Dec 9, 2023): Oh so just the API key is missing on the embedding and is not being inherited in the embedding file. Will update this right now then.
Author
Owner

@timothycarambat commented on GitHub (Dec 9, 2023):

Task: Update API key auth and UI for LocalAI embedding as the LLM model only use the API key currently.

@timothycarambat commented on GitHub (Dec 9, 2023): Task: Update API key auth and UI for LocalAI embedding as the LLM model only use the API key currently.
Author
Owner

@lunamidori5 commented on GitHub (Dec 9, 2023):

@timothycarambat dont forget models <3 deeply sorry for having to make yall do this

@lunamidori5 commented on GitHub (Dec 9, 2023): @timothycarambat dont forget models <3 deeply sorry for having to make yall do this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anything-llm#237
No description provided.