{"record":{"id":"f71d42a6889c9330","repo":"BerriAI/litellm","slug":"invalid-response-format-missing-predictions-fie","errorCode":null,"errorMessage":"Invalid response format: missing 'predictions' field","messagePattern":"Invalid response format: missing 'predictions' field","errorType":"http","errorClass":"BaseLLMException","httpStatus":422,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_gemma_models/transformation.py","lineNumber":124,"sourceCode":"                {\n                    \"@requestFormat\": \"chatCompletions\",\n                    **openai_request,\n                }\n            ]\n        }\n\n    def _unwrap_predictions_response(\n        self,\n        response_json: dict[str, Any],\n    ) -> dict[str, Any]:\n        \"\"\"\n        Unwrap the Vertex Gemma predictions format to OpenAI format.\n\n        Vertex Gemma wraps the OpenAI-compatible response in a 'predictions' field.\n        This method extracts it so the parent class can process it normally.\n        \"\"\"\n        if \"predictions\" not in response_json:\n            raise BaseLLMException(\n                status_code=422,\n                message=\"Invalid response format: missing 'predictions' field\",\n            )\n\n        return response_json[\"predictions\"]\n\n    @staticmethod\n    def _sync_post(\n        client: HTTPHandler | httpx.Client | None,\n        api_base: str,\n        headers: dict[str, str],  # mutable-ok: forwarded to post(headers: dict | None)\n        request_data: dict[str, Any],  # mutable-ok: forwarded to post(json: dict | ...)\n        timeout: float | httpx.Timeout | None,\n    ) -> httpx.Response:\n        if isinstance(client, HTTPHandler):\n            return client.post(\n                url=api_base,\n                headers=headers,","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_gemma_models/transformation.py#L106-L142","documentation":"Guard in _unwrap_predictions_response: the Vertex Gemma response JSON lacks the 'predictions' wrapper that should contain the OpenAI-compatible completion, so there is nothing to unwrap and the parent transform cannot proceed.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_gemma_models/transformation.py:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response; missing 'predictions' usually means the endpoint returned an error payload.","Verify the request matches the Gemma endpoint's expected schema (instances/parameters) and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}