{"record":{"id":"e858d81cf62325d3","repo":"BerriAI/litellm","slug":"param-key-is-not-supported-on-bytez","errorCode":null,"errorMessage":"param `{key}` is not supported on Bytez","messagePattern":"param `(.+?)` is not supported on Bytez","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/llms/bytez/chat/transformation.py","lineNumber":106,"sourceCode":"    def map_openai_params(\n        self,\n        non_default_params: dict,\n        optional_params: dict,\n        model: str,\n        drop_params: bool,\n    ) -> dict:\n        adapted_params: Final = {}\n\n        all_params: Final = {**non_default_params, **optional_params}\n\n        for key, value in all_params.items():\n            alias = self.openai_to_bytez_param_map.get(key)\n\n            if alias is False:\n                if drop_params:\n                    continue\n\n                raise Exception(f\"param `{key}` is not supported on Bytez\")\n\n            if alias is None:\n                adapted_params[key] = value\n                continue\n\n            adapted_params[alias] = value\n\n        return adapted_params\n\n    def validate_environment(\n        self,\n        headers: dict,\n        model: str,\n        messages: list[AllMessageValues],\n        optional_params: dict,\n        litellm_params: dict,\n        api_key: str | None = None,\n        api_base: str | None = None,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bytez/chat/transformation.py#L88-L124","documentation":"The Bytez chat transformation maps OpenAI parameter names to Bytez equivalents via openai_to_bytez_param_map. Parameters explicitly mapped to False are known-unsupported; passing any of them raises this bare Exception unless drop_params is set, in which case they are silently skipped. Params mapped to None pass through unchanged; params with an alias are renamed.","triggerScenarios":"Calling a bytez/ chat completion with a parameter the map marks False (e.g. certain OpenAI-only params) while drop_params is not enabled — for example forwarding a generic kwargs dict containing that param to litellm.completion(model=\"bytez/...\").","commonSituations":"Provider-agnostic wrapper code that sends the same optional params (logit_bias, user, function-style args, etc.) to every provider; switching an OpenAI-targeted call to a Bytez model without pruning params.","solutions":["Pass drop_params=True (or set litellm.drop_params) so unsupported params are dropped instead of raising.","Remove the offending param named in the message for Bytez calls.","Branch your request builder per provider so only mapped params reach Bytez."],"exampleFix":"# before\nlitellm.completion(model=\"bytez/meta-llama/Llama-3-8b\", messages=m, logit_bias={\"1\": -100})\n\n# after\nlitellm.completion(model=\"bytez/meta-llama/Llama-3-8b\", messages=m, drop_params=True)","handlingStrategy":"validation","validationCode":"BYTEZ_SAFE_PARAMS = {\"temperature\", \"max_tokens\", \"top_p\", \"stream\"}  # subset known to pass through\nbytez_params = {k: v for k, v in kwargs.items() if k in BYTEZ_SAFE_PARAMS}","typeGuard":null,"tryCatchPattern":"try:\n    litellm.completion(model=\"bytez/...\", messages=m, **kwargs)\nexcept Exception as e:\n    if \"not supported on Bytez\" in str(e):\n        litellm.completion(model=\"bytez/...\", messages=m, drop_params=True, **kwargs)\n    else:\n        raise","preventionTips":["Enable litellm.drop_params globally in multi-provider applications.","Build request params per provider from a whitelist, not a shared dict.","Wrap provider calls so param errors degrade to dropped params rather than failed requests."],"tags":["bytez","params","validation","openai-compat"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}