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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
[Fix] Remove recursion in BFL _read_image_bytes to pass CI recursive detector
yuneng-jiang553cfc6d727d
diff --git a/litellm/llms/black_forest_labs/image_edit/transformation.py b/litellm/llms/black_forest_labs/image_edit/transformation.pyindex 78898345bf6..172b3b14853 100644--- a/litellm/llms/black_forest_labs/image_edit/transformation.py+++ b/litellm/llms/black_forest_labs/image_edit/transformation.py@@ -191,11 +191,15 @@ class BlackForestLabsImageEditConfig(BaseImageEditConfig):def _read_image_bytes(self, image: Any) -> bytes:"""Read image bytes from various input types."""+ # Unwrap nested lists iteratively to avoid recursion+ for _ in range(10):+ if isinstance(image, list):+ image = image[0]+ else:+ break+if isinstance(image, bytes):return image- elif isinstance(image, list):- # If it's a list, take the first image- return self._read_image_bytes(image[0])elif isinstance(image, str):if image.startswith(("http://", "https://")):# Download image from URL