{"record":{"id":"ed428b838bc009ac","repo":"BerriAI/litellm","slug":"vertex-project-and-location-are-required-for-custo","errorCode":null,"errorMessage":"Vertex project and location are required for custom endpoint","messagePattern":"Vertex project and location are required for custom endpoint","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_ai_non_gemini.py","lineNumber":324,"sourceCode":"\n            request_str += f\"llm_model.predict({prompt}, **{optional_params}).text\\n\"\n            ## LOGGING\n            logging_obj.pre_call(\n                input=prompt,\n                api_key=None,\n                additional_args={\n                    \"complete_input_dict\": optional_params,\n                    \"request_str\": request_str,\n                },\n            )\n            completion_response = llm_model.predict(prompt, **optional_params).text\n        elif mode == \"custom\":\n            \"\"\"\n            Vertex AI Model Garden\n            \"\"\"\n\n            if vertex_project is None or vertex_location is None:\n                raise ValueError(\"Vertex project and location are required for custom endpoint\")\n\n            ## LOGGING\n            logging_obj.pre_call(\n                input=prompt,\n                api_key=None,\n                additional_args={\n                    \"complete_input_dict\": optional_params,\n                    \"request_str\": request_str,\n                },\n            )\n            llm_model = aiplatform.gapic.PredictionServiceClient(\n                client_options=client_options,\n                credentials=creds,\n            )\n            request_str += f\"llm_model = aiplatform.gapic.PredictionServiceClient(client_options={client_options}, credentials=...)\\n\"\n            endpoint_path = llm_model.endpoint_path(project=vertex_project, location=vertex_location, endpoint=model)\n            request_str += f\"llm_model.predict(endpoint={endpoint_path}, instances={instances})\\n\"\n            response = llm_model.predict(endpoint=endpoint_path, instances=instances).predictions","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_ai_non_gemini.py#L306-L342","documentation":"Raised in the 'custom' (Model Garden) branch when vertex_project or vertex_location is None: endpoint discovery for a custom endpoint requires both to construct the aiplatform client, so the call cannot proceed with defaults.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_ai_non_gemini.py:324 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set vertex_project and vertex_location (via params or VERTEXAI_PROJECT / VERTEXAI_LOCATION env vars) for the custom endpoint.","Verify the credentials being used actually resolve a project and location."],"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"}