{"record":{"id":"77e694d3f204c506","repo":"BerriAI/litellm","slug":"setting-user-encoding-format-is-not-supported-by","errorCode":null,"errorMessage":"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.","messagePattern":"Setting user/encoding format is not supported by (.+?)\\. To drop it from the call, set `litellm\\.drop_params = True`\\.","errorType":"exception","errorClass":"UnsupportedParamsError","httpStatus":500,"severity":"error","filePath":"litellm/assistants/utils.py","lineNumber":103,"sourceCode":"        \"quality\": None,\n        \"response_format\": None,\n        \"size\": None,\n        \"style\": None,\n        \"user\": None,\n    }\n\n    non_default_params = {k: v for k, v in passed_params.items() if (k in default_params and v != default_params[k])}\n    optional_params = {}\n\n    ## raise exception if non-default value passed for non-openai/azure embedding calls\n    def _check_valid_arg(supported_params):\n        if len(non_default_params.keys()) > 0:\n            keys: Final = list(non_default_params.keys())\n            for k in keys:\n                if litellm.drop_params is True and k not in supported_params:  # drop the unsupported non-default values\n                    non_default_params.pop(k, None)\n                elif k not in supported_params:\n                    raise UnsupportedParamsError(\n                        status_code=500,\n                        message=f\"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.\",\n                    )\n            return non_default_params\n\n    if (\n        custom_llm_provider == \"openai\"\n        or custom_llm_provider == \"azure\"\n        or custom_llm_provider in litellm.openai_compatible_providers\n    ):\n        optional_params = non_default_params\n    elif custom_llm_provider == \"bedrock\":\n        supported_params = [\"size\"]\n        _check_valid_arg(supported_params=supported_params)\n        if size is not None:\n            width, height = size.split(\"x\")\n            optional_params[\"width\"] = int(width)\n            optional_params[\"height\"] = int(height)","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/assistants/utils.py#L85-L121","documentation":"UnsupportedParamsError raised by the assistants/embedding shared param-checking helper when a non-default OpenAI-specific param (e.g. user, encoding_format) is passed for a provider that does not support it (non-OpenAI/Azure/bedrock etc.). The message text is generic ('user/encoding format') regardless of which param actually triggered it, which is a known quirk. Setting litellm.drop_params = True makes LiteLLM silently drop the unsupported param instead.","triggerScenarios":"Passing params like user='u1' or encoding_format='base64' to an assistants or embedding call routed to a provider whose supported_params list excludes them — e.g. a non-OpenAI-compatible provider going through the else branch of the provider check. Only non-default values trigger it; params equal to their defaults pass.","commonSituations":"Code written against OpenAI embeddings reused with another provider through LiteLLM; migrations where user-tracking headers were added; providers whose supported param lists lag behind new OpenAI params.","solutions":["Remove the unsupported param (check the non_default_params keys that triggered it) for that provider's calls.","Or opt in globally: litellm.drop_params = True (or per-call drop_params=True) so LiteLLM strips unsupported non-default params.","If the provider genuinely supports the param, update its supported_params mapping in the transformation and file an upstream issue."],"exampleFix":"# before\nlitellm.embedding(model=\"some-provider/model\", input=[\"hi\"], user=\"user-123\")\n\n# after\nlitellm.embedding(model=\"some-provider/model\", input=[\"hi\"])\n# or: litellm.embedding(model=\"some-provider/model\", input=[\"hi\"], user=\"user-123\", drop_params=True)","handlingStrategy":"validation","validationCode":"SUPPORTED = {\"openai\", \"azure\", *litellm.openai_compatible_providers}\nif provider not in SUPPORTED and \"user\" in kwargs:\n    kwargs.pop(\"user\")  # or set litellm.drop_params = True globally","typeGuard":"def supports_param(provider: str, param: str, supported_params: set[str]) -> bool:\n    return provider in (\"openai\", \"azure\") or provider in litellm.openai_compatible_providers or param in supported_params","tryCatchPattern":"from litellm.exceptions import UnsupportedParamsError\ntry:\n    resp = litellm.embedding(model=model, input=inp, user=user)\nexcept UnsupportedParamsError:\n    resp = litellm.embedding(model=model, input=inp)  # retry without optional params","preventionTips":["Set litellm.drop_params = True in apps that mix providers and don't need strict param checking.","Maintain per-provider param allowlists at your call sites.","Watch the non_default_params set — only non-default values trigger the error."],"tags":["assistants","embeddings","unsupported-params","provider-compat"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}