{"record":{"id":"7e6d0167d5351352","repo":"BerriAI/litellm","slug":"parameter-k-is-not-supported-for-model-model-7e6d01","errorCode":null,"errorMessage":"Parameter {k} is not supported for model {model}. Supported parameters are {supported_params}. Set drop_params=True to drop unsupported parameters.","messagePattern":"Parameter (.+?) is not supported for model (.+?)\\. Supported parameters are (.+?)\\. Set drop_params=True to drop unsupported parameters\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/image_edit/stability_transformation.py","lineNumber":135,"sourceCode":"\n        # Create a copy to not mutate original - convert TypedDict to regular dict\n        mapped_params: Final[dict[str, Any]] = dict(image_edit_optional_params)\n\n        for k, v in image_edit_optional_params.items():\n            if k in param_mapping:\n                # Map param if mapping exists and value is valid\n                if k == \"size\" and v in OPENAI_SIZE_TO_STABILITY_ASPECT_RATIO:\n                    mapped_params[param_mapping[k]] = OPENAI_SIZE_TO_STABILITY_ASPECT_RATIO[v]\n                # Don't copy \"size\" itself to final dict\n            elif k == \"n\":\n                # Store for logic but do not add to outgoing params\n                mapped_params[\"_n\"] = v\n            elif k == \"response_format\":\n                # Only b64 supported at Stability; store for postprocessing\n                mapped_params[\"_response_format\"] = v\n            elif k not in supported_params:\n                if not drop_params:\n                    raise ValueError(\n                        f\"Parameter {k} is not supported for model {model}. \"\n                        f\"Supported parameters are {supported_params}. \"\n                        f\"Set drop_params=True to drop unsupported parameters.\"\n                    )\n                # Otherwise, param will simply be dropped\n            else:\n                # param is supported and not mapped, keep as-is\n                continue\n\n        # Remove OpenAI params that have been mapped unless they're in stability\n        for mapped in [\"size\", \"n\", \"response_format\"]:\n            mapped_params.pop(mapped, None)\n\n        return mapped_params\n\n    def transform_image_edit_request(\n        self,\n        model: str,","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/image_edit/stability_transformation.py#L117-L153","documentation":"When mapping OpenAI images/edits params onto Stability AI's schema, the transformer only allows params that are supported for the model or explicitly mapped (size -> aspect_ratio, n -> _n, response_format -> _response_format). Any other OpenAI param raises ValueError listing supported params unless drop_params=True is set, mirroring litellm's global get_optional_params behavior.","triggerScenarios":"Calling bedrock stability image edits with extra OpenAI params like 'quality', 'style', 'user', or 'background', none of which exist in Stability's supported set; the check fires before the request is sent.","commonSituations":"Porting DALL-E 3 or gpt-image-1 edit calls (which accept quality/style/background/user) to bedrock/stability.*; passing through user-supplied param dicts unfiltered.","solutions":["Set drop_params=True (litellm.drop_params = True, or per-call drop_params=True) to silently drop unsupported params.","Or remove/whitelist params client-side to only those listed in the error's supported_params.","Map size manually: only specific OpenAI sizes convert to Stability aspect ratios; unsupported size strings also fall through to this path."],"exampleFix":"# before\nlitellm.image_edit(model=\"bedrock/stability.sd3-large-img-edit\",\n                  image=img, prompt=\"...\", quality=\"hd\")  # ValueError\n# after\nlitellm.image_edit(model=\"bedrock/stability.sd3-large-img-edit\",\n                  image=img, prompt=\"...\", drop_params=True)","handlingStrategy":"validation","validationCode":"STABILITY_ALLOWED = {\"prompt\", \"image\", \"mask\", \"size\", \"n\", \"response_format\"}\n\ndef filter_stability_params(d: dict) -> dict:\n    return {k: v for k, v in d.items() if k in STABILITY_ALLOWED}","typeGuard":"def is_stability_edit_param(k: object) -> bool:\n    return k in {\"prompt\", \"image\", \"mask\", \"size\", \"n\", \"response_format\"}","tryCatchPattern":null,"preventionTips":["Set litellm.drop_params = True in proxies that fan out to multiple providers.","Maintain a per-provider param whitelist in your client SDK.","Remember DALL-E/gpt-image-1 params (quality, style, background, user) are not accepted on stability edits."],"tags":["bedrock","stability","image-edit","params","validation"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}