BerriAI/litellm · error · ValueError

Unsupported Bedrock image-edit model: {model!r}. Use a stabi

Error message

Unsupported Bedrock image-edit model: {model!r}. Use a stability.* image-edit model id or add supports_nova_canvas_image_edit in model_prices for this id.

What it means

Bedrock image-edit routing recognizes only two families: stability.* edit models and Nova Canvas models explicitly flagged with supports_nova_canvas_image_edit in model_cost/model_prices. This helper (used to resolve a config class for a model string) raises ValueError for anything else so an unsupported model fails fast before any AWS call.

Source

Thrown at litellm/llms/bedrock/image_edit/amazon_nova_canvas_image_edit_transformation.py:506

def get_bedrock_image_edit_config_for_model(
    model: str,
) -> BaseImageEditConfig:
    """
    Return the correct Bedrock image-edit config for the model id.

    Same routing as ``BedrockImageEdit.get_config_class``: Stability edit models,
    Nova Canvas when marked in model_cost; otherwise raises ``ValueError``.
    """
    from litellm.llms.bedrock.image_edit.stability_transformation import (
        BedrockStabilityImageEditConfig,
    )

    if BedrockStabilityImageEditConfig._is_stability_edit_model(model):
        return BedrockStabilityImageEditConfig()
    if BedrockAmazonNovaCanvasImageEditConfig._is_nova_canvas_image_edit_model(model):
        return BedrockAmazonNovaCanvasImageEditConfig()
    raise ValueError(
        f"Unsupported Bedrock image-edit model: {model!r}. "
        "Use a stability.* image-edit model id or add supports_nova_canvas_image_edit "
        "in model_prices for this id."
    )

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Use a supported model id: a stability.* edit model (e.g. bedrock/stability.sd3-large-img-edit) or an amazon nova-canvas id with supports_nova_canvas_image_edit in model_prices.
  2. For a custom/private model id, add supports_nova_canvas_image_edit: true to its entry in model_prices_and_context.json (or via litellm known model metadata customization) and make the id resolvable.
  3. Upgrade litellm — newly shipped Bedrock edit models get flags added over time.
  4. If the model only supports generation, call /v1/images/generations instead.

Example fix

# before: ValueError for unflagged id
litellm.image_edit(model="bedrock/titan-image-generator-v1", ...)
# after: use a routed family or flag your id in model_prices
litellm.image_edit(model="bedrock/stability.sd3-large-img-edit", ...)
Defensive patterns

Strategy: validation

Validate before calling

def is_supported_edit_model(model: str) -> bool:
    return model.startswith("stability.") or (
        "nova-canvas" in model  # plus supports_nova_canvas_image_edit flag in model_prices
    )

Type guard

def is_bedrock_edit_model(model: object) -> bool:
    if not isinstance(model, str):
        return False
    m = model.removeprefix("bedrock/")
    return m.startswith("stability.") or "nova-canvas" in m

Prevention

When it happens

Trigger: Calling /v1/images/edits with a bedrock model id that is neither stability.* nor a nova-canvas id with the supports_nova_canvas_image_edit flag — e.g. 'bedrock/titan-image-generator-v1' or a custom/aliased id.

Common situations: New Bedrock edit model not yet in litellm's model_prices; custom model alias (bedrock/my-own-model) routed to image edits; typo in the model string; older litellm version lacking the nova-canvas flag.

Related errors


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/017d56f15a696bb2. Report an issue: GitHub.