BerriAI/litellm · error · UnsupportedParamsError

Setting user/encoding format is not supported by {custom_llm

Error message

Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.

What it means

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.

Source

Thrown at litellm/assistants/utils.py:103

        "quality": None,
        "response_format": None,
        "size": None,
        "style": None,
        "user": None,
    }

    non_default_params = {k: v for k, v in passed_params.items() if (k in default_params and v != default_params[k])}
    optional_params = {}

    ## raise exception if non-default value passed for non-openai/azure embedding calls
    def _check_valid_arg(supported_params):
        if len(non_default_params.keys()) > 0:
            keys: Final = list(non_default_params.keys())
            for k in keys:
                if litellm.drop_params is True and k not in supported_params:  # drop the unsupported non-default values
                    non_default_params.pop(k, None)
                elif k not in supported_params:
                    raise UnsupportedParamsError(
                        status_code=500,
                        message=f"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.",
                    )
            return non_default_params

    if (
        custom_llm_provider == "openai"
        or custom_llm_provider == "azure"
        or custom_llm_provider in litellm.openai_compatible_providers
    ):
        optional_params = non_default_params
    elif custom_llm_provider == "bedrock":
        supported_params = ["size"]
        _check_valid_arg(supported_params=supported_params)
        if size is not None:
            width, height = size.split("x")
            optional_params["width"] = int(width)
            optional_params["height"] = int(height)

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Remove the unsupported param (check the non_default_params keys that triggered it) for that provider's calls.
  2. Or opt in globally: litellm.drop_params = True (or per-call drop_params=True) so LiteLLM strips unsupported non-default params.
  3. If the provider genuinely supports the param, update its supported_params mapping in the transformation and file an upstream issue.

Example fix

# before
litellm.embedding(model="some-provider/model", input=["hi"], user="user-123")

# after
litellm.embedding(model="some-provider/model", input=["hi"])
# or: litellm.embedding(model="some-provider/model", input=["hi"], user="user-123", drop_params=True)
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED = {"openai", "azure", *litellm.openai_compatible_providers}
if provider not in SUPPORTED and "user" in kwargs:
    kwargs.pop("user")  # or set litellm.drop_params = True globally

Type guard

def supports_param(provider: str, param: str, supported_params: set[str]) -> bool:
    return provider in ("openai", "azure") or provider in litellm.openai_compatible_providers or param in supported_params

Try / catch

from litellm.exceptions import UnsupportedParamsError
try:
    resp = litellm.embedding(model=model, input=inp, user=user)
except UnsupportedParamsError:
    resp = litellm.embedding(model=model, input=inp)  # retry without optional params

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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