Check for existing issues
What happened?
Router.update_settings() raises an unhandled TypeError when None is passed for any integer setting (timeout, num_retries, retry_after, allowed_fails, cooldown_time).
Expected behavior: passing None should reset the setting to None without crashing.
I have a fix ready and will submit a PR immediately after filing this issue.
Steps to Reproduce
-
Install litellm: pip install litellm
-
Run the following Python script:
from litellm import Router
router = Router(model_list=[
{"model_name": "test", "litellm_params": {"model": "openai/gpt-4", "api_key": "sk-fake"}}
])
router.update_settings(timeout=None)
- Observe TypeError is raised
Relevant log output
File "litellm/router.py", line 9523, in update_settings
_casted_value = int(kwargs[var])
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
What part of LiteLLM is this about?
SDK (litellm Python package)
What LiteLLM version are you on ?
v1.86.0
Twitter / LinkedIn details
No response
Check for existing issues
What happened?
Router.update_settings() raises an unhandled TypeError when None is passed for any integer setting (timeout, num_retries, retry_after, allowed_fails, cooldown_time).
Expected behavior: passing None should reset the setting to None without crashing.
I have a fix ready and will submit a PR immediately after filing this issue.
Steps to Reproduce
Install litellm: pip install litellm
Run the following Python script:
from litellm import Router
router = Router(model_list=[
{"model_name": "test", "litellm_params": {"model": "openai/gpt-4", "api_key": "sk-fake"}}
])
router.update_settings(timeout=None)
Relevant log output
What part of LiteLLM is this about?
SDK (litellm Python package)
What LiteLLM version are you on ?
v1.86.0
Twitter / LinkedIn details
No response