{"record":{"id":"bcdc95463671bada","repo":"BerriAI/litellm","slug":"instances-are-required-for-private-endpoint-bcdc95","errorCode":null,"errorMessage":"Instances are required for private endpoint","messagePattern":"Instances are required for private endpoint","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_ai_non_gemini.py","lineNumber":656,"sourceCode":"        )\n        request_str += f\"llm_model = aiplatform.gapic.PredictionServiceAsyncClient(client_options={client_options}, credentials=...)\\n\"\n        endpoint_path: Final = llm_model.endpoint_path(project=vertex_project, location=vertex_location, endpoint=model)\n        request_str += f\"client.predict(endpoint={endpoint_path}, instances={instances})\\n\"\n        response_obj = await llm_model.predict(\n            endpoint=endpoint_path,\n            instances=instances,\n        )\n\n        response = response_obj.predictions\n        completion_response = response[0]\n        if isinstance(completion_response, str) and \"\\nOutput:\\n\" in completion_response:\n            completion_response = completion_response.split(\"\\nOutput:\\n\", 1)[1]\n        if stream:\n            response = TextStreamer(completion_response)\n\n    elif mode == \"private\":\n        if instances is None:\n            raise ValueError(\"Instances are required for private endpoint\")\n        stream = optional_params.pop(\"stream\", None)\n        _ = instances[0].pop(\"stream\", None)\n        request_str += f\"llm_model.predict_async(instances={instances})\\n\"\n        response_obj = await llm_model.predict_async(\n            instances=instances,\n        )\n        response = response_obj.predictions\n        completion_response = response[0]\n        if isinstance(completion_response, str) and \"\\nOutput:\\n\" in completion_response:\n            completion_response = completion_response.split(\"\\nOutput:\\n\", 1)[1]\n        if stream:\n            response = TextStreamer(completion_response)\n\n    if response is None:\n        raise ValueError(\"Unable to generate response\")\n\n    logging_obj.post_call(input=prompt, api_key=None, original_response=response)\n","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_ai_non_gemini.py#L638-L674","documentation":"Async private-endpoint guard (PredictionServiceAsyncClient path): instances is None, but the await-ed predict call requires instance dicts. Mirrors the sync check and fails fast before any network I/O.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_ai_non_gemini.py:656 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the 'instances' field in the request to the private endpoint.","Review the model's serving input contract and supply instances in the required format."],"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"}