fix(failover): send remote targets their own upstream model

A chain request reached a cloud-proxy target with the client's model,
the chain name, whenever the target set no upstream_model: passthrough
forwards the body's model and translate falls back to it. The upstream
answered 404, which neither retries nor trips, while the liveness
probe, which checks the target's own name, kept passing.

PrepareTarget now sets the upstream model of a remote target to
proxy.upstream_model or the target name, the same name the probe uses.
The request pipeline and realtime chain stages both call it.

Assisted-by: Claude:claude-opus-5-5
This commit is contained in:
Ettore Di Giacinto committed 2026-09-26 19:26:13 +00:00
1 parent d1a59aae41
commit e183ea11d1
8 files changed
+98 -7

No files matched your search

+3
View File
@@ -50,6 +50,9 @@ Rules:
- A chain cannot also set `alias` or `backend`.
- Responses name the chain as the model. The `X-LocalAI-Served-Model` header
names the target that served the request.
- A remote (`cloud-proxy`) target receives its own model name, never the chain
name: `proxy.upstream_model`, or the target name when `upstream_model` is
empty. The health check looks for the same name.
## How the target is chosen