fix(llm-parse): the local model list and pull send the saved api key to an ollama behind an auth proxy

The admin screen's model list (/api/tags) and pull (/api/pull) went out
without the Authorization header that the extraction and /api/show already
send, so an Ollama behind a Bearer proxy answered 401 and the list came back
as a 502. The controller now adds the key saved with the local provider, read
server side through LlmConfigResolver.readLocalServerAccess, and only when the
requested base URL reaches the same server root as the saved one, so another
address in the form never receives it.

A 401 or 403 now says whether the key was rejected or none is saved for that
address, and the admin form shows the server's reason instead of the axios
status line. A server without /api/tags (LM Studio, vLLM) is asked for its
OpenAI-compatible /v1/models instead, and the list body is read with a size
cap and checked before use.

Refs #2649
This commit is contained in:
Maurice
2026-10-12 21:04:23 +02:00
parent accad52ed5
commit 66e574fcc0
9 changed files with 332 additions and 25 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"src/nest/collab/collab.mcp.ts": 3,
"src/nest/collab/collab.rpc.ts": 2,
"src/nest/doc-sync/doc-sync-config.service.ts": 2,
"src/nest/llm-parse/llm-local.service.ts": 7,
"src/nest/llm-parse/llm-local.service.ts": 3,
"src/nest/maps/maps-url.resolver.ts": 2,
"src/nest/maps/providers/osm.client.ts": 4,
"src/nest/memories/immich.controller.ts": 6,