BerriAI/litellm · error · NotImplementedError

Task type {task_type} is not supported

Error message

Task type {task_type} is not supported

What it means

The Nova Canvas request transformer only supports a fixed set of task types (e.g. COLOR_GUIDED_GENERATION, INPAINTING, and text-to-image handling upstream). If the resolved task_type string matches none of the if/elif branches, a NotImplementedError is raised naming the unsupported task type.

Source

Thrown at litellm/llms/bedrock/image_generation/amazon_nova_canvas_transformation.py:148

                inpainting_params_typed: Final = AmazonNovaCanvasInpaintingParams(**inpainting_params)
            except Exception as e:
                raise ValueError(
                    f"Error transforming inpainting params: {e}. Got params: {inpainting_params}, Expected params: {AmazonNovaCanvasInpaintingParams.__annotations__}"
                )

            try:
                image_generation_config_typed = AmazonNovaCanvasImageGenerationConfig(**image_generation_config)
            except Exception as e:
                raise ValueError(
                    f"Error transforming image generation config: {e}. Got params: {image_generation_config}, Expected params: {AmazonNovaCanvasImageGenerationConfig.__annotations__}"
                )

            return AmazonNovaCanvasInpaintingRequest(
                taskType=task_type,
                inpaintingParams=inpainting_params_typed,
                imageGenerationConfig=image_generation_config_typed,
            )
        raise NotImplementedError(f"Task type {task_type} is not supported")

    @classmethod
    def map_openai_params(cls, non_default_params: dict, optional_params: dict) -> dict:
        """
        Map the OpenAI params to the Bedrock params
        """
        _size: Final = non_default_params.get("size")
        if _size is not None:
            width, height = _size.split("x")
            optional_params["width"], optional_params["height"] = (
                int(width),
                int(height),
            )
        if non_default_params.get("n") is not None:
            optional_params["numberOfImages"] = non_default_params.get("n")
        if non_default_params.get("quality") is not None:
            if non_default_params.get("quality") in ("hd", "premium"):
                optional_params["quality"] = "premium"

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Check the task_type spelling/case against the AWS Nova Canvas API (e.g. INPAINTING, COLOR_GUIDED_GENERATION).
  2. If the task is genuinely unsupported (e.g. OUTPAINTING), upgrade litellm to a version that supports it.
  3. If still unsupported, call the Bedrock InvokeModel/bedrock-runtime API directly with the raw payload via litellm.completion-style passthrough (bedrock/invoke model string) instead of the image_generation helper.

Example fix

# before
image_generation_config={"taskType": "outpainting", ...}  # wrong case + unsupported

# after
image_generation_config={"inpaintingParams": {...}}  # use a supported task, correct casing
Defensive patterns

Strategy: type-guard

Validate before calling

SUPPORTED_NOVA_TASKS = {"COLOR_GUIDED_GENERATION", "INPAINTING"}  # per installed litellm; verify in release notes

def task_supported(task_type: str) -> bool:
    return task_type in SUPPORTED_NOVA_TASKS

Type guard

def is_supported_task_type(t: str) -> bool:
    return isinstance(t, str) and t in {"COLOR_GUIDED_GENERATION", "INPAINTING"}

Try / catch

try:
    litellm.image_generation(model=model, prompt=p, image_generation_config=cfg)
except NotImplementedError as e:
    raise UserFacingError(f"Task not supported by installed litellm: {e}") from e

Prevention

When it happens

Trigger: Setting image_generation_config to a taskType litellm does not map yet, such as 'OUTPAINTING', 'BACKGROUND_REMOVAL', 'IMAGE_VARIATION', or a typo like 'inpainting' (wrong case).

Common situations: New Nova Canvas task types added by AWS but not yet supported by the installed litellm version; case mismatches; passing an arbitrary taskType string through the config.

Related errors


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