{"record":{"id":"fb249611fb29058b","repo":"BerriAI/litellm","slug":"litellm-params-is-required","errorCode":null,"errorMessage":"litellm_params is required","messagePattern":"litellm_params is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/completion_extras/litellm_responses_transformation/handler.py","lineNumber":126,"sourceCode":"        model: Final = typed_kwargs.get(\"model\")\n        if model is None or not isinstance(model, str):\n            raise ValueError(\"model is required\")\n\n        custom_llm_provider: Final = typed_kwargs.get(\"custom_llm_provider\")\n        if custom_llm_provider is None or not isinstance(custom_llm_provider, str):\n            raise ValueError(\"custom_llm_provider is required\")\n\n        messages: Final = typed_kwargs.get(\"messages\")\n        if messages is None or not isinstance(messages, list):\n            raise ValueError(\"messages is required\")\n\n        optional_params: Final = typed_kwargs.get(\"optional_params\")\n        if optional_params is None or not isinstance(optional_params, dict):\n            raise ValueError(\"optional_params is required\")\n\n        litellm_params: Final = typed_kwargs.get(\"litellm_params\")\n        if litellm_params is None or not isinstance(litellm_params, dict):\n            raise ValueError(\"litellm_params is required\")\n\n        headers: Final = typed_kwargs.get(\"headers\")\n        if headers is None or not isinstance(headers, dict):\n            raise ValueError(\"headers is required\")\n\n        model_response: Final = typed_kwargs.get(\"model_response\")\n        if model_response is None or not isinstance(model_response, ModelResponse):\n            raise ValueError(\"model_response is required\")\n\n        logging_obj: Final = typed_kwargs.get(\"logging_obj\")\n        if logging_obj is None or not isinstance(logging_obj, LiteLLMLoggingObj):\n            raise ValueError(\"logging_obj is required\")\n\n        return ResponsesToCompletionBridgeHandlerInputKwargs(\n            model=model,\n            messages=messages,\n            optional_params=optional_params,\n            litellm_params=litellm_params,","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/completion_extras/litellm_responses_transformation/handler.py#L108-L144","documentation":"validate_input_kwargs raises when 'litellm_params' is absent from kwargs or is not a dict. litellm_params carries router/proxy-level metadata (metadata, base_url, api_base, ...) that the bridge threads into the Responses API call. Only direct, hand-built invocations of the handler can omit it.","triggerScenarios":"Calling the bridge handler with a kwargs dict missing the litellm_params key; passing it as a non-dict (e.g. a list of tuples).","commonSituations":"Custom pipelines or unit tests constructing kwargs manually; refactors that pass only the outer request params and forget the litellm-internal dict.","solutions":["Use litellm.completion()/acompletion() which always injects litellm_params","If direct, include litellm_params as a dict (an empty dict is accepted)","Verify no middleware strips the key before it reaches the handler"],"exampleFix":"# before\nkwargs = {\"model\": m, \"messages\": msgs, \"optional_params\": {}}\n\n# after\nkwargs = {\"model\": m, \"messages\": msgs, \"optional_params\": {}, \"litellm_params\": {}}","handlingStrategy":"validation","validationCode":"def has_litellm_params(kwargs: dict) -> bool:\n    return isinstance(kwargs.get(\"litellm_params\"), dict)","typeGuard":"def is_dict_param(v) -> bool:\n    return isinstance(v, dict)","tryCatchPattern":null,"preventionTips":["Default litellm_params to {} in manual invocations","Forward the pipeline-provided litellm_params untouched in wrappers"],"tags":["validation","bridge","litellm-params","internal-api"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}