[GH-ISSUE #417] BUG #2 LocalAI with API KEY set can not pull model #235

Closed
opened 2026-02-22 18:18:28 -05:00 by yindo · 6 comments
Owner

Originally created by @lunamidori5 on GitHub (Dec 8, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/417

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). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/417 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.
yindo added the bug label 2026-02-22 18:18:28 -05:00
yindo closed this issue 2026-02-22 18:18:28 -05:00
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.

https://github.com/Mintplex-Labs/anything-llm/blob/8cc1455b721dfcea7e4f3b7d83787623f1054c91/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
yindo changed title from BUG #2 LocalAI with API KEY set can not pull model to [GH-ISSUE #417] BUG #2 LocalAI with API KEY set can not pull model 2026-06-05 14:34:12 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#235