BerriAI/litellm · error · ValueError

Unsupported parameter for Volcengine: {param}

Error message

Unsupported parameter for Volcengine: {param}

What it means

Volcengine embeddings support only a small set of OpenAI params (encoding_format, user, extra_headers - see get_supported_openai_params). Any other non-default OpenAI parameter passed to litellm.embedding with a volcengine model raises ValueError listing the offending param, unless drop_params is enabled.

Source

Thrown at litellm/llms/volcengine/embedding/transformation.py:119

            Updated optional_params dict
        """
        for param, value in non_default_params.items():
            if param == "encoding_format":
                # Volcengine supports: float, base64, null
                if value in ["float", "base64", None]:
                    optional_params["encoding_format"] = value
                else:
                    if not drop_params:
                        raise ValueError(
                            f"Unsupported encoding_format: {value}. Volcengine supports: float, base64, null"
                        )
            elif param == "user":
                # Keep user parameter as-is
                optional_params["user"] = value
            elif param in self.get_supported_openai_params(model):
                optional_params[param] = value
            elif not drop_params:
                raise ValueError(f"Unsupported parameter for Volcengine: {param}")

        return optional_params

    def transform_embedding_request(
        self,
        model: str,
        input: AllEmbeddingInputValues,
        optional_params: dict,
        headers: dict,
    ) -> dict:
        """Transform embedding request to Volcengine format"""
        # Prepare request data (only the JSON body, not the full request)
        data: Final = {
            "model": model,
            "input": input if isinstance(input, list) else [input],
        }

        # Add optional parameters from optional_params

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Remove the parameter named in the message from the volcengine call.
  2. Set litellm.drop_params = True or litellm.modify_params consistent with your policy so unsupported params are dropped silently.
  3. Inspect the allowlist before calling: from litellm.llms.volcengine.embedding.transformation import VolcEngineEmbeddingConfig; VolcEngineEmbeddingConfig().get_supported_openai_params(model).
  4. Keep per-provider kwargs dicts instead of one shared kwargs object.

Example fix

# before
resp = litellm.embedding(
    model="volcengine/ep-20240903144444",
    input=["hello"],
    dimensions=256,  # ValueError: Unsupported parameter for Volcengine: dimensions
)

# after
kwargs = {"input": ["hello"]}
if model.startswith("openai/"):
    kwargs["dimensions"] = 256
resp = litellm.embedding(model=model, **kwargs)
Defensive patterns

Strategy: validation

Validate before calling

from litellm.llms.volcengine.embedding.transformation import VolcEngineEmbeddingConfig

ALLOWED = set(VolcEngineEmbeddingConfig().get_supported_openai_params("")) | {"model", "input"}
clean = {k: v for k, v in kwargs.items() if k in ALLOWED}
resp = litellm.embedding(model="volcengine/ep-...", **clean)

Type guard

const isVolcengineSafeParam = (k: string): boolean =>
  ["encoding_format", "user", "extra_headers"].includes(k);

Try / catch

try:
    resp = litellm.embedding(model="volcengine/ep-...", input=inputs, **kwargs)
except ValueError as e:
    if "Unsupported parameter for Volcengine" in str(e):
        bad = str(e).rsplit(":", 1)[-1].strip()
        kwargs.pop(bad, None)
        resp = litellm.embedding(model="volcengine/ep-...", input=inputs, **kwargs)
    else:
        raise

Prevention

When it happens

Trigger: litellm.embedding(model="volcengine/...", input=[...], dimensions=256); passing timeout-as-body param, chunk_size, or other OpenAI embedding params that Volcengine's /api/v3/embeddings endpoint does not implement.

Common situations: Unified embedding pipelines that send the same kwargs to OpenAI, Azure, and Volcengine; teams adding dimensions/truncation params for text-embedding-3 models and forgetting they are OpenAI-specific.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/3d2a9b840bfc48d7. Report an issue: GitHub.