{"record":{"id":"12df82b29a3ca2ea","repo":"BerriAI/litellm","slug":"model-model-is-not-supported-for-azure-ai-image","errorCode":null,"errorMessage":"Model {model} is not supported for Azure AI image editing.","messagePattern":"Model (.+?) is not supported for Azure AI image editing\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/image_edit/__init__.py","lineNumber":42,"sourceCode":"    Get the appropriate image edit config for an Azure AI model.\n\n    - MAI models use /mai/v1/images/edits with multipart form data and size\n    - FLUX 2 models use JSON with base64 image\n    - FLUX 1 models use multipart/form-data\n    \"\"\"\n    if AzureFoundryMAIImageGenerationConfig.is_mai_model(model):\n        return AzureFoundryMAIImageEditConfig()\n\n    # Check if it's a FLUX 2 model\n    if AzureFoundryFluxImageGenerationConfig.is_flux2_model(model):\n        return AzureFoundryFlux2ImageEditConfig()\n\n    # Default to FLUX 1 config for other FLUX models\n    model_normalized: Final = model.lower().replace(\"-\", \"\").replace(\"_\", \"\")\n    if model_normalized == \"\" or \"flux\" in model_normalized:\n        return AzureFoundryFluxImageEditConfig()\n\n    raise ValueError(f\"Model {model} is not supported for Azure AI image editing.\")\n","sourceCodeStart":24,"sourceCodeEnd":43,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/image_edit/__init__.py#L24-L43","documentation":"get_image_edit_config() dispatches Azure AI image-edit requests to a handler based on the model name: MAI (OpenAI image) models, FLUX 2 models, and FLUX 1 as the default for anything containing 'flux'. Any other model string raises ValueError 'Model {model} is not supported for Azure AI image editing.' — i.e. the provider only edits images with specific model families on Foundry.","triggerScenarios":"litellm.image_edit(..., model='azure_ai/<name>') where <name> contains neither 'flux' (case-insensitive, dash/underscore-stripped) nor matches the MAI/FLUX2 detectors — e.g. a DALL-E or Stable Diffusion name, a typo, or a custom deployment alias.","commonSituations":"Assuming image_edit supports the same models as image_variation or chat; using a friendly deployment alias in a proxy that hides the real model name; typos like 'flx' or 'Fluxx'; new Azure model family not yet supported by the installed litellm version.","solutions":["Use a supported model family: an FLUX image-edit deployment (model string containing 'flux') or an MAI image model.","If you meant OpenAI DALL-E / gpt-image-1 on plain Azure OpenAI, call the azure/ (not azure_ai/) provider route.","Update litellm — new Foundry model families get dispatch support over time.","If the model genuinely is FLUX but the string is an alias, pass the real model name and keep aliases in your proxy layer."],"exampleFix":"# before\nlitellm.image_edit(model='azure_ai/my-alias', image=img, prompt='...')\n\n# after\nlitellm.image_edit(model='azure_ai/flux-1.1-pro', image=img, prompt='...')\n# or, for OpenAI image models on Azure OpenAI:\nlitellm.image_edit(model='azure/gpt-image-1', image=img, prompt='...')","handlingStrategy":"type-guard","validationCode":"def is_supported_image_edit_model(model: str) -> bool:\n    m = model.lower().replace('-', '').replace('_', '')\n    return m != '' and ('flux' in m or is_mai_model(model))  # extend as litellm adds families","typeGuard":"def is_supported_image_edit_model(model: str) -> bool:\n    normalized = model.lower().replace('-', '').replace('_', '')\n    if 'flux' in normalized:\n        return True\n    return model.lower().startswith(('gpt-image',)) or 'mai' in normalized","tryCatchPattern":"try:\n    litellm.image_edit(model=m, image=img, prompt=p)\nexcept ValueError as e:\n    if 'not supported for Azure AI image editing' in str(e):\n        m = pick_supported_image_edit_model()  # fall back to a known FLUX deployment\n    raise","preventionTips":["Maintain an allowlist of supported image-edit model names in config, not scattered strings.","Resolve model aliases to real Foundry model names before calling litellm.","Smoke-test image_edit at deploy time so unsupported names fail in CI, not at runtime."],"tags":["azure","image-edit","model-dispatch","validation","unsupported-model"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}