mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* fix(router): warn when a Bedrock application inference profile ARN deployment cannot be priced A deployment whose model is a Bedrock application inference profile ARN, with no base_model and no custom pricing, logs $0 spend for every call because the ARN names no model. Warn once per deployment when it is loaded from config or added later, naming the deployment and asking for model_info.base_model * perf(router): skip the unpriced-profile check before dumping params unless the model is an application profile ARN * fix(router): match the unpriced-profile warning to what the cost calculator prices Skip the warning when the cost map already prices the ARN (a register_model entry), count only fields that set a rate as custom pricing, warn only for deployments active in this environment, and tell admins to use the id the profile was copied from, since a cross-region id is priced differently from the bare model id. * fix(router): warn when an application profile's base_model has no price in the cost map * fix(router): check the base_model that per-call pricing reads before warning about an unpriced profile Per-call pricing reads litellm_params.base_model before model_info.base_model, but the warning read them the other way, so an admin could follow the warning, set a priced model_info.base_model, and silence it while calls still logged $0. The warning now resolves base_model in the per-call order and names the field that wins. A profile ARN set as model_id under a label the cost map lacks now warns too, since those calls also log $0. * fix(logging): warn and count each call logged at $0 through an unpriced Bedrock ARN The load-time warning only reaches the server log once per worker, so calls through an unpriced Bedrock ARN, including bedrock/* wildcard and SDK calls, still logged $0 with nothing next to them. The per-call zero-cost check now reports them with the reason unpriced_bedrock_arn in the warning and in litellm_zero_cost_requests_total. An empty litellm_params.base_model now counts as unset in the load-time warning, as it does in per-call pricing. * fix(cost): warn per call for unpriced Bedrock ARNs on SDK and multiplier-only paths SDK calls through an unpriced ARN fail cost calculation, so no pricing entry resolves and the per-call check returned before the ARN diagnostic ran. A register_model entry holding only an uplift multiplier counted as priced per call while the load-time check, which counts rate fields only, warned. The ARN diagnostic now runs with an empty pricing entry when none resolves, and uses bedrock_arn_without_rates, the same rate-only rule as load time. * fix(cost): skip the unpriced ARN warning for calls with explicit zero per-call rates An SDK call through an unregistered Bedrock ARN that passes input_cost_per_token=0 and output_cost_per_token=0 is free on purpose, but the ARN check only looked at the cost map entry, so it warned and counted the call. The check now reads the call's own per-call pricing first, the same way is_usage_explicitly_free does. |
||
|---|---|---|
| .. | ||
| invoke | ||
| __init__.py | ||
| test_atomic_upsert.py | ||
| test_invoke_streaming.py | ||
| test_routing_stores.py | ||
| test_surface_fallbacks.py | ||
| test_surface_registry.py | ||
| test_walk.py | ||