mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-29 01:03:17 +00:00
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
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _harness_smoke_test.py | ||
| conftest.py | ||
| test_alerting.py | ||
| test_callback_capabilities_class.py | ||
| test_callback_capabilities_dataclass.py | ||
| test_during_call_hook.py | ||
| test_guardrail_pipeline.py | ||
| test_internal_usage_cache.py | ||
| test_lifecycle.py | ||
| test_mcp_bridging.py | ||
| test_module_helpers.py | ||
| test_post_call_failure_hook.py | ||
| test_post_call_success_hook.py | ||
| test_pre_call_hook.py | ||
| test_streaming_hooks.py | ||