chore: drop mutable-collection constructions flagged by LIT002 gate

This commit is contained in:
Aiden McComiskey 2026-09-25 15:43:14 +01:00
parent a4f47b3c4c
commit ad4488b168
2 changed files with 12 additions and 14 deletions

View file

@ -89,7 +89,7 @@ class VLLMModelInfo(BaseLLMModelInfo):
resolved_api_base: Final = self._get_discovery_api_base(api_base)
environment_variable: Final = "HOSTED_VLLM_API_KEY" if self._provider == "hosted_vllm" else "VLLM_API_KEY"
resolved_api_key: Final = api_key or get_secret_str(environment_variable)
headers: Final = {"Authorization": f"Bearer {resolved_api_key}"} if resolved_api_key else {}
headers: Final = {"Authorization": f"Bearer {resolved_api_key}"} if resolved_api_key else None
response: Final = litellm.module_level_client.get(
url=_add_path_to_api_base(resolved_api_base, "/v1/models"),
headers=headers,

View file

@ -9782,10 +9782,10 @@ def get_litellm_model_info(model: dict = {}):
return {
**live_model_info,
**static_model_info,
**(
{"max_input_tokens": live_model_info["max_input_tokens"]}
"max_input_tokens": (
live_model_info["max_input_tokens"]
if live_model_info["max_input_tokens"] is not None
else {}
else static_model_info.get("max_input_tokens")
),
}
except Exception:
@ -15052,17 +15052,15 @@ async def model_info_v2(
# Fill in model info based on config.yaml and litellm model_prices_and_context_window.json
# This must happen before teamId filtering so that direct_access and access_via_team_ids are populated
all_models = list(
await asyncio.gather(
*(
asyncio.to_thread(
_enrich_model_info_with_litellm_data,
model=_model,
debug=debug if debug is not None else False,
llm_router=llm_router,
)
for _model in all_models
all_models = await asyncio.gather(
*(
asyncio.to_thread(
_enrich_model_info_with_litellm_data,
model=_model,
debug=debug if debug is not None else False,
llm_router=llm_router,
)
for _model in all_models
)
)