{"record":{"id":"c126f495a7821bb5","repo":"BerriAI/litellm","slug":"skip-pre-call-logic-true-requires-litellm-logging","errorCode":null,"errorMessage":"skip_pre_call_logic=True requires litellm_logging_obj to be set in data. Ensure common_processing_pre_call_logic was called before using this parameter.","messagePattern":"skip_pre_call_logic=True requires litellm_logging_obj to be set in data\\. Ensure common_processing_pre_call_logic was called before using this parameter\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/common_request_processing.py","lineNumber":1834,"sourceCode":"        user_max_tokens: int | None = None,\n        user_api_base: str | None = None,\n        version: str | None = None,\n        is_streaming_request: bool | None = False,\n        contents: list | None = None,  # Add contents parameter\n        skip_pre_call_logic: bool = False,\n    ) -> Any:\n        \"\"\"\n        Common request processing logic for both chat completions and responses API endpoints\n        \"\"\"\n        requested_model_from_client: Final[str | None] = (\n            self.data.get(\"model\") if isinstance(self.data.get(\"model\"), str) else None\n        )\n        self._debug_log_request_payload()\n\n        if skip_pre_call_logic:\n            logging_obj = self.data.get(\"litellm_logging_obj\")\n            if logging_obj is None:\n                raise ValueError(\n                    \"skip_pre_call_logic=True requires litellm_logging_obj to be set in data. \"\n                    \"Ensure common_processing_pre_call_logic was called before using this parameter.\"\n                )\n        else:\n            self.data, logging_obj = await self._pre_call_with_fallbacks(\n                request=request,\n                general_settings=general_settings,\n                proxy_logging_obj=proxy_logging_obj,\n                user_api_key_dict=user_api_key_dict,\n                version=version,\n                proxy_config=proxy_config,\n                user_model=user_model,\n                user_temperature=user_temperature,\n                user_request_timeout=user_request_timeout,\n                user_max_tokens=user_max_tokens,\n                user_api_base=user_api_base,\n                model=model,\n                route_type=route_type,","sourceCodeStart":1816,"sourceCodeEnd":1852,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/common_request_processing.py#L1816-L1852","documentation":"Internal ValueError raised by the proxy's common request processing when a caller passes skip_pre_call_logic=True but self.data does not contain 'litellm_logging_obj'. The flag is a fast-path (used by the Responses API flows) that assumes common_processing_pre_call_logic already ran and installed a logging object in the request data; the guard makes that contract explicit instead of failing later with a NoneType error.","triggerScenarios":"Calling the internal processing method with skip_pre_call_logic=True on a request dict that never went through common_processing_pre_call_logic (e.g. new endpoint wiring, custom forks invoking the class directly, or a code path that drops litellm_logging_obj from data).","commonSituations":"Contributors adding new proxy endpoints and reusing the flag without the prerequisite call; forks that copy the call pattern from responses API but skip the pre-call step; rare regressions when refactoring request pipelines.","solutions":["Run common_processing_pre_call_logic(...) first so data['litellm_logging_obj'] is populated, then pass skip_pre_call_logic=True.","Or simply do not set skip_pre_call_logic=True; the normal path builds the logging object itself.","If you hold a logging object, set data['litellm_logging_obj'] explicitly before the call.","On a stock install (no custom code), upgrade litellm: this indicates version skew or a patched proxy."],"exampleFix":"// before\nprocessing = ProxyBaseLLMRequestProcessing(data)  # data lacks litellm_logging_obj\nresult = await processing.common_processing(..., skip_pre_call_logic=True)\n\n// after\nawait processing.common_processing_pre_call_logic(...)\nresult = await processing.common_processing(..., skip_pre_call_logic=True)","handlingStrategy":"validation","validationCode":"if skip_pre_call_logic and 'litellm_logging_obj' not in data:\n    raise ValueError('run common_processing_pre_call_logic before skip_pre_call_logic=True')","typeGuard":null,"tryCatchPattern":"try:\n    result = await processing.common_processing(..., skip_pre_call_logic=True)\nexcept ValueError as e:\n    if 'litellm_logging_obj' in str(e):\n        data['litellm_logging_obj'] = logging_obj  # repair and retry once\n        result = await processing.common_processing(..., skip_pre_call_logic=True)\n    else:\n        raise","preventionTips":["Treat skip_pre_call_logic=True as an internal fast path: always pair it with a prior pre-call step.","Add an integration test per endpoint that exercises the flag to catch wiring regressions.","On stock installs, report upstream instead of patching - this guard marks a broken call sequence."],"tags":["litellm","proxy","internal","invariant","valueerror"],"backgroundTag":"precondition-not-met","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}