{"record":{"id":"ff2a07f680b792d1","repo":"BerriAI/litellm","slug":"response-missing-predictions-field","errorCode":null,"errorMessage":"Response missing 'predictions' field","messagePattern":"Response missing 'predictions' field","errorType":"validation","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_embeddings/bge.py","lineNumber":143,"sourceCode":"            [0.002, 0.021, ...],\n            [0.003, 0.022, ...]\n          ]\n        }\n\n        Args:\n            response: The raw response from Vertex AI\n            model: The model name\n            model_response: The EmbeddingResponse object to populate\n\n        Returns:\n            EmbeddingResponse: The transformed response in OpenAI format\n\n        Raises:\n            KeyError: If response doesn't contain 'predictions'\n            ValueError: If predictions is not a list or contains invalid data\n        \"\"\"\n        if \"predictions\" not in response:\n            raise KeyError(\"Response missing 'predictions' field\")\n\n        _predictions: Final = response[\"predictions\"]\n\n        if not isinstance(_predictions, list):\n            raise ValueError(f\"Expected 'predictions' to be a list, got {type(_predictions)}\")\n\n        embedding_response: Final = []\n        # BGE models don't return token counts, so we estimate or set to 0\n        input_tokens: Final = 0\n\n        for idx, embedding_values in enumerate(_predictions):\n            if not isinstance(embedding_values, list):\n                raise ValueError(f\"Expected embedding at index {idx} to be a list, got {type(embedding_values)}\")\n\n            embedding_response.append(\n                {\n                    \"object\": \"embedding\",\n                    \"index\": idx,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_embeddings/bge.py#L125-L161","documentation":"KeyError guard in the BGE embedding transform: the Vertex response dict has no 'predictions' key, so there are no embedding vectors to map into the OpenAI-format EmbeddingResponse — typically an error body was returned instead.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_embeddings/bge.py:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response for an upstream error; a missing 'predictions' field usually signals a failed prediction call.","Verify the BGE endpoint deployment, request payload format, and credentials, then 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-14T05:17:10.506Z"}