From aad0efd99ab8a28fe641bf99d8665dbb27fc35da Mon Sep 17 00:00:00 2001 From: AlexsanderHamir Date: Thu, 16 Oct 2025 11:25:03 -0700 Subject: [PATCH] fix(proxy): change check_file_size_under_limit to accept Collection[str] Fixes mypy type error where router_model_names (a set) was incompatible with List[str] parameter type. Changed check_file_size_under_limit to accept Collection[str] instead of List[str] since the parameter is only used for membership checks, making it more flexible and avoiding unnecessary type conversions. Resolves: proxy/proxy_server.py:5107 arg-type error --- litellm/proxy/common_utils/http_parsing_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/common_utils/http_parsing_utils.py b/litellm/proxy/common_utils/http_parsing_utils.py index 33d432e869..807b895bd0 100644 --- a/litellm/proxy/common_utils/http_parsing_utils.py +++ b/litellm/proxy/common_utils/http_parsing_utils.py @@ -1,6 +1,6 @@ import json import re -from typing import Any, Dict, List, Optional +from typing import Any, Collection, Dict, List, Optional import orjson from fastapi import Request, UploadFile, status @@ -149,7 +149,7 @@ def _safe_get_request_headers(request: Optional[Request]) -> dict: def check_file_size_under_limit( request_data: dict, file: UploadFile, - router_model_names: List[str], + router_model_names: Collection[str], ) -> bool: """ Check if any files passed in request are under max_file_size_mb