{"record":{"id":"96a2ad30ea0da451","repo":"BerriAI/litellm","slug":"unknown-bfl-image-edit-model-model-name-suppor","errorCode":null,"errorMessage":"Unknown BFL image edit model: {model_name}. Supported models: {list(IMAGE_EDIT_MODELS.keys())}","messagePattern":"Unknown BFL image edit model: (.+?)\\. Supported models: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/black_forest_labs/image_edit/transformation.py","lineNumber":171,"sourceCode":"        \"\"\"\n        BFL uses JSON requests, not multipart/form-data.\n        \"\"\"\n        return False\n\n    def _get_model_endpoint(self, model: str) -> str:\n        \"\"\"\n        Get the API endpoint for a given model.\n        \"\"\"\n        # Remove provider prefix if present (e.g., \"black_forest_labs/flux-kontext-pro\")\n        model_name = model.lower()\n        if \"/\" in model_name:\n            model_name = model_name.split(\"/\")[-1]\n\n        # Check if model is in our mapping\n        if model_name in IMAGE_EDIT_MODELS:\n            return IMAGE_EDIT_MODELS[model_name]\n\n        raise ValueError(\n            f\"Unknown BFL image edit model: {model_name}. Supported models: {list(IMAGE_EDIT_MODELS.keys())}\"\n        )\n\n    def get_complete_url(\n        self,\n        model: str,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for the Black Forest Labs API request.\n        \"\"\"\n        base_url: str = api_base or get_secret_str(\"BFL_API_BASE\") or DEFAULT_API_BASE\n        base_url = base_url.rstrip(\"/\")\n\n        endpoint: Final = self._get_model_endpoint(model)\n        return f\"{base_url}{endpoint}\"\n","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/black_forest_labs/image_edit/transformation.py#L153-L189","documentation":"Model-mapping guard in _get_model_endpoint: after stripping any provider prefix and lowercasing, the model name is not a key in IMAGE_EDIT_MODELS, so there is no known BFL endpoint for it. The supported model list is included in the error.","triggerScenarios":"Thrown at litellm/llms/black_forest_labs/image_edit/transformation.py:171 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the supported BFL image edit models listed in the error.","Check the model name for typos.","Refer to BFL docs for the correct model identifier."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}