{"record":{"id":"11eac0dbcc88b5a2","repo":"BerriAI/litellm","slug":"parameter-k-is-not-supported-for-model-model-11eac0","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/black_forest_labs/image_generation/transformation.py","lineNumber":107,"sourceCode":"            if k in optional_params:\n                continue\n\n            if k in supported_params:\n                # Map OpenAI 'size' to BFL width/height\n                if k == \"size\" and v:\n                    self._map_size_param(v, optional_params)\n                elif k == \"n\":\n                    if \"ultra\" in model.lower():\n                        optional_params[\"num_images\"] = v\n                    # non-ultra: silently skip (n=1 is BFL default)\n                elif k == \"quality\":\n                    if v == \"hd\" and \"ultra\" in model.lower():\n                        optional_params[\"raw\"] = True\n                    # other quality values have no BFL mapping\n                else:\n                    optional_params[k] = v\n            elif 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\n        return optional_params\n\n    def _map_size_param(self, size: str, optional_params: dict) -> None:\n        \"\"\"Map OpenAI size parameter to BFL width/height.\"\"\"\n        # Common size mappings\n        size_mapping: Final = {\n            \"1024x1024\": (1024, 1024),\n            \"1792x1024\": (1792, 1024),\n            \"1024x1792\": (1024, 1792),\n            \"512x512\": (512, 512),\n            \"256x256\": (256, 256),\n        }\n","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/black_forest_labs/image_generation/transformation.py#L89-L125","documentation":"In the BFL transformation layer, each OpenAI-style image parameter is checked against the model's supported params. Unknown parameters raise this ValueError unless drop_params is enabled. This mirrors litellm's standard 'unsupported param' guard: it prevents silently sending parameters the BFL endpoint would reject or ignore.","triggerScenarios":"Calling image generation with a parameter not in the supported list for the BFL model — e.g. passing 'quality' with a value other than 'hd' on an ultra model path is fine, but passing params like 'style' or 'response_format' when not supported, without drop_params=True.","commonSituations":"Porting code written for OpenAI images (which accepts style/response_format) to BFL models; generic wrapper code that forwards a fixed parameter dict to every provider; new OpenAI params not yet mapped for BFL.","solutions":["Remove the unsupported parameter named in the message for BFL calls, or gate it per provider.","Pass drop_params=True (or set litellm.drop_params=True globally) to have litellm silently drop unsupported params.","Check the supported params list printed in the error message and map your param to a supported equivalent (e.g. size -> width/height is handled for you)."],"exampleFix":"# before\nlitellm.images.generate(model=\"bfl/flux-dev\", prompt=p, style=\"natural\")\n\n# after\nlitellm.images.generate(model=\"bfl/flux-dev\", prompt=p, drop_params=True)","handlingStrategy":"validation","validationCode":"BFL_SUPPORTED = {\"prompt\", \"model\", \"size\", \"n\", \"quality\"}  # verify against error message/docs\ncleaned = {k: v for k, v in request_params.items() if k in BFL_SUPPORTED}","typeGuard":null,"tryCatchPattern":"try:\n    litellm.images.generate(model=\"bfl/flux-dev\", **params)\nexcept ValueError as e:\n    if \"not supported\" in str(e):\n        params = {k: v for k, v in params.items() if k not in str(e)}\n        litellm.images.generate(model=\"bfl/flux-dev\", drop_params=True, **params)\n    else:\n        raise","preventionTips":["Set litellm.drop_params = True for provider-agnostic codebases.","Keep per-provider param whitelists in a config instead of forwarding generic dicts.","Read the supported list from the error message — it is authoritative per model."],"tags":["bfl","params","validation","openai-compat"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}