8 views
-/https://github.com/berriai/litellm/issues/28126
GitHub · issue

#28126 [Bug]: Router.update_settings() crashes with TypeError when None is passed for integer settings

  • State: open
  • Author: @DSurya11
  • Labels: bug, llm translation, SDK

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### 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

1. Install litellm: pip install litellm

2. 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)

3. Observe TypeError is raised

### Relevant log output

```shell 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_

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h28m2s ago — entered · #import:https:::github.com:berriai:litellm post #2484
The right issue is harder because it requires introducing and validating a new provider/model integration, including multimodal request handling, configuration, compatibility, and coverage across relevant code paths. The left issue is a localized type-handling fix with a narrowly scoped regression test.
#0 of 0 · 31d17h50m59s ago — current · #import:https:::github.com:berriai:litellm post #3125
The left task has broader metadata scope and higher verification risk across provider-specific pricing semantics, model aliases, and regression coverage; the right is a localized SDK handling fix with focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search