From 2984526aa51c0efe233e92e28b42ae42c6b51d36 Mon Sep 17 00:00:00 2001 From: Taksh Date: Fri, 17 Apr 2026 17:28:29 +0530 Subject: [PATCH] Fix Monitor.update_model_call_limit always rejecting every call Monitor.model_call_limit_global is initialized to an empty dict and no code path populates it outside update_model_call_limit itself. The function, however, early-returns False when the model is not already a key, which means the first call for any model always fails and the dict is never populated - making the /update_model_call_limit/{model}/{limit} endpoint unreachable. Drop the early-return so the function sets the limit unconditionally. get_model_call_limit / is_model_limit_reached already treat a missing key as 'no limit configured', so upserting here is consistent with the rest of the class. --- fastchat/serve/call_monitor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fastchat/serve/call_monitor.py b/fastchat/serve/call_monitor.py index bc456f107..2b23b5cbb 100644 --- a/fastchat/serve/call_monitor.py +++ b/fastchat/serve/call_monitor.py @@ -71,8 +71,6 @@ def get_model_call_limit(self, model: str) -> int: return self.model_call_limit_global[model] def update_model_call_limit(self, model: str, limit: int) -> bool: - if model not in self.model_call_limit_global: - return False self.model_call_limit_global[model] = limit return True