LocalAI/core/http/endpoints/localai
LocalAI [bot] a39e025d64
fix(nodes): make per-node backend install async via gallery job queue (#9928)
* feat(galleryop): add TargetNodeID to ManagementOp for single-node installs

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* feat(galleryop): add NodeScopedKey helpers for per-node opcache rows

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* refactor(galleryop): use strings.Cut for NodeScopedKey parsing, reject empty nodeID

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* feat(nodes): scope DistributedBackendManager.InstallBackend to single node via TargetNodeID

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* feat(http): make /api/nodes/:id/backends/install async via gallery service job queue

The handler previously called unloader.InstallBackend synchronously and
blocked the browser for up to 3 minutes waiting on the NATS reply. It now
enqueues a TargetNodeID-scoped ManagementOp on BackendGalleryChannel and
returns HTTP 202 + jobID immediately, matching /api/backends/install/:id.

The opcache key is built via NodeScopedKey(nodeID, backend) so concurrent
installs of the same backend across different nodes do not stomp each
other. galleryService/opcache/appConfig are threaded through
RegisterNodeAdminRoutes for this.

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* refactor(http): log malformed backend_galleries override and stop test drain goroutine

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* feat(api): expose nodeID for node-scoped backend ops in /api/operations

Node-scoped backend installs land in opcache under "node:<nodeID>:<backend>"
keys. Without splitting that prefix back out, the operations panel renders
the full key as the display name and has no structured way to label which
worker an install is targeting. Detect the prefix, surface nodeID as its own
response field, and reduce the display name back to the bare backend slug.
Bare (non-scoped) ops are left untouched so legacy installs do not gain a
misleading empty nodeID.

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* feat(react-ui): poll job status for node-targeted backend installs

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(react-ui): make NodeInstallPicker state updates pure and surface cancellations as errors

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* refactor(react-ui): clarify async semantics in handleInstallOnTarget

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* refactor(http): use statusUrl casing for node install response to match codebase precedent

Assisted-by: Claude:opus-4-7 [Edit] [Bash]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-05-21 22:25:53 +02:00
..
agent_collections.go fix(agents): handle embedding model dim changes on collection upload (#9365) 2026-04-15 20:05:28 +02:00
agent_jobs.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
agent_responses.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
agent_skills.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
agents.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
agents_isolation_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
api_instructions.go feat(api): add /v1/audio/diarization endpoint with sherpa-onnx + vibevoice.cpp (#9654) 2026-05-05 15:10:13 +02:00
api_instructions_test.go feat(branding): admin-configurable instance name, tagline, and assets (#9635) 2026-05-02 15:51:36 +02:00
audio.go feat: add biometrics UI (#9524) 2026-04-24 08:50:34 +02:00
audio_transform.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
backend.go feat: add ds4 backend (DeepSeek V4 Flash) with tool calls, thinking, KV cache (#9758) 2026-05-11 22:15:47 +02:00
backend_logs.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
backend_logs_test.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
backend_monitor.go fix(backend-monitor): accept model as a query parameter (#9411) 2026-04-21 22:06:35 +02:00
backend_test.go feat(importer): expand importer flow to almost all backends (#9466) 2026-04-22 22:42:37 +02:00
branding.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
branding_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
config_meta.go feat(gallery): Speed up load times and clean gallery entries (#9211) 2026-05-06 14:51:38 +02:00
config_meta_test.go feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
cors_proxy.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
cors_proxy_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
detection.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
edit_model.go feat: localai assistant chat modality (#9602) 2026-04-28 19:29:27 +02:00
edit_model_test.go fix(ui): rename model config files on save to prevent duplicates (#9388) 2026-04-17 08:12:48 +02:00
face_analyze.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
face_embed.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
face_forget.go feat(face-recognition): add insightface/onnx backend for 1:1 verify, 1:N identify, embedding, detection, analysis (#9480) 2026-04-22 21:55:41 +02:00
face_identify.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
face_register.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
face_verify.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
finetune.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
gallery.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
get_token_metrics.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
images.go feat(face-recognition): add insightface/onnx backend for 1:1 verify, 1:N identify, embedding, detection, analysis (#9480) 2026-04-22 21:55:41 +02:00
import_model.go feat(gallery): Speed up load times and clean gallery entries (#9211) 2026-05-06 14:51:38 +02:00
import_model_test.go feat(importer): expand importer flow to almost all backends (#9466) 2026-04-22 22:42:37 +02:00
localai_suite_test.go feat(webui): add import/edit model page (#6050) 2025-08-14 23:48:09 +02:00
mcp.go feat: localai assistant chat modality (#9602) 2026-04-28 19:29:27 +02:00
mcp_prompts.go feat(ui): MCP Apps, mcp streaming and client-side support (#8947) 2026-03-11 07:30:49 +01:00
mcp_resources.go feat(ui): MCP Apps, mcp streaming and client-side support (#8947) 2026-03-11 07:30:49 +01:00
mcp_tools.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
metrics.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
nodes.go fix(nodes): make per-node backend install async via gallery job queue (#9928) 2026-05-21 22:25:53 +02:00
nodes_install_async_test.go fix(nodes): make per-node backend install async via gallery job queue (#9928) 2026-05-21 22:25:53 +02:00
nodes_test.go fix(distributed): preserve UI-added node labels across worker re-register 2026-04-27 21:24:50 +00:00
p2p.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
pin_model.go feat: localai assistant chat modality (#9602) 2026-04-28 19:29:27 +02:00
quantization.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
settings.go feat(branding): admin-configurable instance name, tagline, and assets (#9635) 2026-05-02 15:51:36 +02:00
stores.go feat(loader): enhance single active backend to support LRU eviction (#7535) 2025-12-12 12:28:38 +01:00
system.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
toggle_model.go feat: localai assistant chat modality (#9602) 2026-04-28 19:29:27 +02:00
tokenize.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
traces.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
traces_test.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
tts.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
types.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
vad.go feat(api): Allow coding agents to interactively discover how to control and configure LocalAI (#9084) 2026-04-04 15:14:35 +02:00
video.go Validate video image URLs before download (#9819) 2026-05-14 15:07:17 +02:00
voice_analyze.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
voice_embed.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
voice_forget.go feat: voice recognition (#9500) 2026-04-23 12:07:14 +02:00
voice_identify.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
voice_register.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
voice_verify.go feat(whisper): honor client cancellation via ggml abort_callback (#9710) 2026-05-08 01:44:47 +02:00
vram.go feat(gallery): Speed up load times and clean gallery entries (#9211) 2026-05-06 14:51:38 +02:00
vram_test.go feat(gallery): Speed up load times and clean gallery entries (#9211) 2026-05-06 14:51:38 +02:00
welcome.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00