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(bfl): remove unsupported params and error on unknown models

Chesars52d2ea237fef
diff --git a/litellm/llms/black_forest_labs/image_edit/transformation.py b/litellm/llms/black_forest_labs/image_edit/transformation.py
index 5732b8786db..23ebd9840ab 100644
--- a/litellm/llms/black_forest_labs/image_edit/transformation.py
+++ b/litellm/llms/black_forest_labs/image_edit/transformation.py
@@ -54,11 +54,7 @@ class BlackForestLabsImageEditConfig(BaseImageEditConfig):
Note: BFL uses different parameter names, these are mapped in map_openai_params.
"""
- return [
- "n", # Number of images (BFL returns 1 per request)
- "size", # Maps to aspect_ratio
- "response_format", # b64_json or url
- ]
+ return []
def map_openai_params(
self,
@@ -155,8 +151,10 @@ class BlackForestLabsImageEditConfig(BaseImageEditConfig):
if model_name in IMAGE_EDIT_MODELS:
return IMAGE_EDIT_MODELS[model_name]
- # Default to kontext-pro
- return IMAGE_EDIT_MODELS["flux-kontext-pro"]
+ raise ValueError(
+ f"Unknown BFL image edit model: {model_name}. "
+ f"Supported models: {list(IMAGE_EDIT_MODELS.keys())}"
+ )
def get_complete_url(
self,
diff --git a/litellm/llms/black_forest_labs/image_generation/transformation.py b/litellm/llms/black_forest_labs/image_generation/transformation.py
index 7e1c2d286d3..7a97adafe80 100644
--- a/litellm/llms/black_forest_labs/image_generation/transformation.py
+++ b/litellm/llms/black_forest_labs/image_generation/transformation.py
@@ -61,7 +61,6 @@ class BlackForestLabsImageGenerationConfig(BaseImageGenerationConfig):
return [
"n", # Number of images (BFL returns 1 per request, but ultra supports up to 4)
"size", # Maps to width/height or aspect_ratio
- "response_format", # b64_json or url
"quality", # Maps to raw mode for ultra
]
@@ -176,8 +175,10 @@ class BlackForestLabsImageGenerationConfig(BaseImageGenerationConfig):
if model_name in IMAGE_GENERATION_MODELS:
return IMAGE_GENERATION_MODELS[model_name]
- # Default to flux-pro-1.1
- return IMAGE_GENERATION_MODELS["flux-pro-1.1"]
+ raise ValueError(
+ f"Unknown BFL image generation model: {model_name}. "
+ f"Supported models: {list(IMAGE_GENERATION_MODELS.keys())}"
+ )
def get_complete_url(
self,