{"record":{"id":"7d5907de91f46528","repo":"BerriAI/litellm","slug":"image-edit-is-not-supported-for-custom-llm-provid","errorCode":null,"errorMessage":"image edit is not supported for {custom_llm_provider}","messagePattern":"image edit is not supported for (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/images/main.py","lineNumber":833,"sourceCode":"                    image=images,\n                    prompt=prompt,\n                    model_response=model_response,\n                    api_key=kwargs.get(\"api_key\"),\n                    api_base=kwargs.get(\"api_base\"),\n                    optional_params=kwargs,\n                    logging_obj=litellm_logging_obj,\n                    timeout=timeout,\n                    client=custom_client,\n                )\n\n        # get provider config\n        image_edit_provider_config: BaseImageEditConfig | None = ProviderConfigManager.get_provider_image_edit_config(\n            model=model,\n            provider=litellm.LlmProviders(custom_llm_provider),\n        )\n\n        if image_edit_provider_config is None:\n            raise ValueError(f\"image edit is not supported for {custom_llm_provider}\")\n\n        local_vars.update(kwargs)\n        # Get ImageEditOptionalRequestParams with only valid parameters\n        image_edit_optional_params: Final[ImageEditOptionalRequestParams] = (\n            _get_ImageEditRequestUtils().get_requested_image_edit_optional_param(local_vars)\n        )\n        # Get optional parameters for the responses API\n        image_edit_request_params: Final[dict] = _get_ImageEditRequestUtils().get_optional_params_image_edit(\n            model=model,\n            image_edit_provider_config=image_edit_provider_config,\n            image_edit_optional_params=image_edit_optional_params,\n            drop_params=kwargs.get(\"drop_params\"),\n            additional_drop_params=kwargs.get(\"additional_drop_params\"),\n        )\n\n        # Pre Call logging\n        litellm_logging_obj.update_from_kwargs(\n            kwargs=kwargs,","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/images/main.py#L815-L851","documentation":"litellm.image_edit dispatches per-provider only when ProviderConfigManager.get_provider_image_edit_config returns a BaseImageEditConfig for the model/provider pair (litellm/images/main.py:822-833). A None result means this litellm build has no image-edit config registered for that provider — the endpoint is treated as unsupported for it, even if the provider supports image generation.","triggerScenarios":"image_edit with a provider that only has generation support registered (e.g. recraft or stability on builds lacking edit configs); a model/provider combo missing from the registry on older litellm; typo'd model under a supported provider causing the registry lookup to miss.","commonSituations":"Assuming edit parity with generation providers; pinned older litellm versions; using newest providers (edit support lands later than generation support).","solutions":["Use a provider with registered edit support — openai (gpt-image-1), gemini, bedrock, black_forest_labs are the wired edit routes in this file.","Upgrade litellm — edit configs are added release by release.","Pre-check ProviderConfigManager.get_provider_image_edit_config(model, LlmProviders(provider)) before routing.","For unsupported providers, call the provider's native edit API."],"exampleFix":"# before\nresp = litellm.image_edit(model=\"recraft/recraft-v3\", image=img, prompt=\"remove background\")\n# ValueError: image edit is not supported for recraft\n\n# after\nresp = litellm.image_edit(model=\"openai/gpt-image-1\", image=img, prompt=\"remove background\")","handlingStrategy":"validation","validationCode":"from litellm.utils import ProviderConfigManager\nfrom litellm import LlmProviders\n\ncfg = ProviderConfigManager.get_provider_image_edit_config(\n    model=\"gpt-image-1\", provider=LlmProviders.OPENAI\n)\nif cfg is None:\n    raise RuntimeError(\"image edit not wired for this provider in your litellm version; use openai/bedrock/gemini/black_forest_labs or upgrade\")","typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.image_edit(model=model, image=img, prompt=p)\nexcept ValueError as e:\n    if \"image edit is not supported\" in str(e):\n        resp = litellm.image_edit(model=\"openai/gpt-image-1\", image=img, prompt=p)  # known-good route\n    else:\n        raise","preventionTips":["Maintain an allowlist of edit-capable providers per litellm version and validate against it.","Pre-check get_provider_image_edit_config in startup smoke tests for every edit model you expose.","Do not assume generation support implies edit support."],"tags":["litellm","image-edit","unsupported-provider","provider-config","registry"],"backgroundTag":"unsupported-provider","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}