fix(router): give the _text_completion model_name cast a cast-ok reason (LIT006 gate)

This commit is contained in:
Lalith Vardhan 2026-10-27 09:49:53 -07:00
parent 585702f260
commit 104f225164

View file

@ -5749,7 +5749,9 @@ class Router:
self._update_kwargs_with_deployment(deployment=deployment, kwargs=kwargs)
data: Final = deployment["litellm_params"] # not mutated; the call below merges into a new dict
model_name = cast(str, data["model"]) # rebind-ok: assigned inside try so except can attribute the failure
model_name = cast( # cast-ok: deployment params hold a str model # rebind-ok: set in try, read in except
str, data["model"]
)
self.total_calls[model_name] += 1
### DEPLOYMENT-SPECIFIC PRE-CALL CHECKS ### (e.g. update rpm pre-call. Raise error, if deployment over limit)