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
BedrockImageEdit.get_config_class performs the same routing as the standalone helper: stability.* edit models, then Nova Canvas when flagged in model_cost; otherwise ValueError. This is the entry-point check on every bedrock image_edit call, so an unrecognized model never reaches AWS.
Source
Thrown at litellm/llms/bedrock/image_edit/handler.py:63
endpoint_url: str
prepped: AWSPreparedRequest
body: bytes
data: dict
class BedrockImageEdit(BaseAWSLLM):
"""
Bedrock Image Edit handler
"""
@classmethod
def get_config_class(cls, model: str | None):
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."
)
def image_edit(
self,
model: str,
image: list,
prompt: str | None,
model_response: ImageResponse,
optional_params: dict,
logging_obj: LitellmLogging,
timeout: float | httpx.Timeout | None,
aimage_edit: bool = False,
api_base: str | None = None,
extra_headers: dict | None = None,
client: HTTPHandler | AsyncHTTPHandler | None = None,View on GitHub (pinned to 6c2dcb801b)
Solutions
- Check the model id: it must match a stability.* image-edit pattern or be a nova-canvas id with supports_nova_canvas_image_edit.
- Register custom ids with the flag in model_prices (or update litellm to a version that knows the model).
- Route generation-only models to /v1/images/generations.
Defensive patterns
Strategy: validation
Validate before calling
EDIT_MODEL_PREFIXES = ("stability.",)
EDIT_MODEL_SUBSTR = "nova-canvas"
def editable(model: str) -> bool:
m = model.split("/")[-1]
return m.startswith(EDIT_MODEL_PREFIXES) or EDIT_MODEL_SUBSTR in m Type guard
def is_edit_routed(model: object) -> bool:
return isinstance(model, str) and (
model.split("/")[-1].startswith("stability.") or "nova-canvas" in model
) Prevention
- Validate model id against the routed families before calling image_edit.
- Fail fast in your API layer with a clear message instead of relying on litellm's ValueError.
- Watch litellm release notes for new image-edit model support.
When it happens
Trigger: Any litellm.image_edit(model='bedrock/<id>', ...) or /v1/images/edits where <id> fails both _is_stability_edit_model and _is_nova_canvas_image_edit_model checks.
Common situations: Passing chat/inference model ids (bedrock/anthropic.claude-...) to images/edits by mistake; using model aliases without metadata; typo'd ids; litellm version predating nova-canvas edit support.
Related errors
- Unsupported Bedrock image-edit model: {model!r}. Use a stabi
- OUTPAINTING requires either a mask image or a mask prompt. P
- Unsupported Amazon Nova Canvas taskType: {task_type!r}. Use
- Amazon Nova Canvas INPAINTING requires either maskPrompt or
- Nova Canvas image edit requires an image input
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/5dbfc73293f50ad5.
Report an issue: GitHub.