litellm/tests/unit/proxy/utils
mateo-berri 0c596b95b1 fix(proxy): log a fallback's image refusal on the deployment that answered
When the client gets a fallback's refusal or 422 after an earlier model
failed another way, its failure row, Prometheus spend and request labels
now go on that fallback's deployment instead of the first one. Prometheus
also counts that attempt in the fallback deployment's success and total
counters, and the billed spend metrics label requested_model with the
group that answered.

Adapted for lts/1.108.x. This line's proxy failure hook lifts the last
attempt's logging object, so its model, price and model_id already name
the fallback that answered, while the request metadata still names the
first deployment. The lift copies that object's model_group and model_id
onto the metadata, which the spend row and Prometheus read first, instead
of looking the deployment up in the router. The deployment_attribution
rename and the per-attempt Prometheus counters are left out, since this
line runs the failure log on every router attempt.

(cherry picked from commit 1277be6ffa)
2026-11-24 16:05:09 -08:00
..
helpers fix(proxy): list team access group models in /v1/model/info and keep key model lists narrow (#32599) 2026-10-15 10:23:03 -07:00
prisma_and_spend fix(proxy): treat Postgres restart and shutdown errors as DB unavailable, not poison spend-log rows (#50132) 2026-11-06 02:50:47 +00:00
proxy_logging fix(proxy): log a fallback's image refusal on the deployment that answered 2026-11-24 16:05:09 -08:00
__init__.py