BerriAI/litellm · error · ValueError
Unsupported Bedrock image-edit model
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
get_bedrock_image_edit_config_for_model routes a Bedrock model id to a request transformer: stability.* edit ids go to BedrockStabilityImageEditConfig, ids flagged supports_nova_canvas_image_edit in model_cost go to the Nova Canvas config, and everything else raises this ValueError. It mirrors BedrockImageEdit.get_config_class for callers that need a config instance directly.
Solutions
- Use a supported stability edit id, e.g. bedrock/stability.stable-image-core-v1:1, bedrock/stability.stable-image-ultra-v1:1
- For Nova Canvas models, register the id with supports_nova_canvas_image_edit: true in your model_prices/custom config
- Upgrade LiteLLM so fresh model_prices_and_context entries include the new model
- Check the exact model id spelling and its bedrock/ prefix
Example fix
# before
config = get_bedrock_image_edit_config_for_model("bedrock/my-custom-editor")
# after
from litellm.constants import MODEL_COST
MODEL_COST["my-custom-editor"] = {"supports_nova_canvas_image_edit": True, ...}
config = get_bedrock_image_edit_config_for_model("bedrock/my-custom-editor") Defensive patterns
Strategy: validation
Validate before calling
def is_supported_edit_model(model: str, model_cost: dict) -> bool:
m = model.removeprefix("bedrock/").lower()
if m.startswith("stability."):
return True
return bool(model_cost.get(model) or {}).get("supports_nova_canvas_image_edit")
assert is_supported_edit_model(model, litellm.model_cost), f"unsupported edit model {model}" Type guard
def is_bedrock_image_edit_model(model: str, model_cost: dict | None = None) -> bool:
"""True when the id routes to a Bedrock image-edit transformer."""
m = (model or "").removeprefix("bedrock/").lower()
if m.startswith("stability."):
return True
if model_cost:
for key in (model, f"bedrock/{model}"):
entry = model_cost.get(key)
if entry and entry.get("supports_nova_canvas_image_edit"):
return True
return False Try / catch
try:
config = get_bedrock_image_edit_config_for_model(model)
except ValueError as e:
if "Unsupported Bedrock image-edit model" in str(e):
raise ConfigurationError(f"{model} cannot edit images; use a stability edit id or flag it") from e
raise Prevention
- Pin model ids in config with a capability flag list (image_edit: true/false) instead of free-form strings
- Run a routing smoke test on startup for each configured model
- Track LiteLLM release notes for new supports_nova_canvas_image_edit entries
When it happens
Trigger: get_bedrock_image_edit_config_for_model('bedrock/some.new-model') where the id is neither a stability edit model nor marked supports_nova_canvas_image_edit in model_prices_and_context / model_cost.
Common situations: A newly released Bedrock image-edit model not yet present in the installed LiteLLM's model catalog (version lag); custom/private model ids; typo in the model string.
Related errors
- Unsupported Bedrock image-edit model
- Amazon Nova Canvas INPAINTING requires either maskPrompt or…
- Amazon Nova Canvas requires a text prompt. Pass a non-empty…
- err.response.text
- Error in response object format, got None
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/017d56f15a696bb2.
Report an issue: GitHub.
Appendix: 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 77b7c6c40c)