Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Fix mypy issues

Sameer Kankute351921d5db3e
diff --git a/litellm/llms/bedrock/files/transformation.py b/litellm/llms/bedrock/files/transformation.py
index 20ec233808d..e29b07ca3a5 100644
--- a/litellm/llms/bedrock/files/transformation.py
+++ b/litellm/llms/bedrock/files/transformation.py
@@ -259,14 +259,14 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
AmazonConverseConfig,
)
- config = AmazonConverseConfig()
- mapped_params = config.map_openai_params(
+ converse_config = AmazonConverseConfig()
+ mapped_params = converse_config.map_openai_params(
non_default_params=optional_params,
optional_params={},
model=_model,
drop_params=False,
)
- return config.transform_request(
+ return converse_config.transform_request(
model=_model,
messages=messages,
optional_params=mapped_params,
diff --git a/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py b/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py
index a07e3a6bd14..000682bbf80 100644
--- a/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py
+++ b/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py
@@ -322,6 +322,7 @@ async def create_model_group(
# Validate model_names exist in router (only if using model_names path)
if not use_model_ids and has_model_names:
+ assert data.model_names is not None
all_valid, missing_models = validate_models_exist(
model_names=data.model_names,
llm_router=llm_router,
@@ -354,12 +355,14 @@ async def create_model_group(
# Update deployments using the appropriate method
if use_model_ids:
+ assert data.model_ids is not None
models_updated = await update_specific_deployments_with_access_group(
model_ids=data.model_ids,
access_group=data.access_group,
prisma_client=prisma_client,
)
else:
+ assert data.model_names is not None
models_updated = await update_deployments_with_access_group(
model_names=data.model_names,
access_group=data.access_group,
@@ -587,6 +590,7 @@ async def update_access_group(
# Validation: Check if all new models exist (only if using model_names path)
if not use_model_ids and has_model_names:
+ assert data.model_names is not None
all_valid, missing_models = validate_models_exist(
model_names=data.model_names,
llm_router=llm_router,
@@ -619,12 +623,14 @@ async def update_access_group(
# Step 2: Add access group using the appropriate method
if use_model_ids:
+ assert data.model_ids is not None
models_updated = await update_specific_deployments_with_access_group(
model_ids=data.model_ids,
access_group=access_group,
prisma_client=prisma_client,
)
else:
+ assert data.model_names is not None
models_updated = await update_deployments_with_access_group(
model_names=data.model_names,
access_group=access_group,