{"record":{"id":"5b4be3e6cf706b4a","repo":"BerriAI/litellm","slug":"vertex-project-vertex-location-and-model-are-req","errorCode":null,"errorMessage":"vertex_project, vertex_location, and model are required when use_psc_endpoint_format=True","messagePattern":"vertex_project, vertex_location, and model are required when use_psc_endpoint_format=True","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_llm_base.py","lineNumber":653,"sourceCode":"        if api_base:\n            if custom_llm_provider == \"gemini\":\n                # For Gemini (Google AI Studio), construct the full path like other providers\n                if model is None:\n                    raise ValueError(\"Model parameter is required for Gemini custom API base URLs\")\n                url = f\"{api_base}/models/{model}:{endpoint}\"\n                if gemini_api_key is None:\n                    raise ValueError(\n                        \"Missing Gemini API key. Set the GEMINI_API_KEY or GOOGLE_API_KEY environment variable.\"\n                    )\n                if gemini_api_key is not None:\n                    auth_header = {\"x-goog-api-key\": gemini_api_key}\n            else:\n                # For Vertex AI\n                if use_psc_endpoint_format:\n                    # User explicitly specified PSC endpoint format\n                    # Construct full PSC/custom endpoint URL\n                    if not (vertex_project and vertex_location and model):\n                        raise ValueError(\n                            \"vertex_project, vertex_location, and model are required when use_psc_endpoint_format=True\"\n                        )\n                    # Strip routing prefixes (bge/, gemma/, etc.) for endpoint URL construction\n                    model_for_url: Final = get_vertex_base_model_name(model=model)\n                    # Format: {api_base}/v1/projects/{project}/locations/{location}/endpoints/{model}:{endpoint}\n                    version: Final = vertex_api_version or \"v1\"\n                    url = \"{}/{}/projects/{}/locations/{}/endpoints/{}:{}\".format(\n                        api_base.rstrip(\"/\"),\n                        version,\n                        vertex_project,\n                        vertex_location,\n                        model_for_url,\n                        endpoint,\n                    )\n                elif urlparse(api_base).path in (\"\", \"/\"):\n                    url = api_base.rstrip(\"/\") + urlparse(url).path\n                else:\n                    url = f\"{api_base}:{endpoint}\"","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_llm_base.py#L635-L671","documentation":"Raised when use_psc_endpoint_format=True but one of vertex_project, vertex_location, or model is missing: the PSC URL format embeds all three ({api_base}/v1/projects/{project}/locations/{location}/endpoints/{model}:{endpoint}) and cannot be templated without them.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_llm_base.py:653 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide vertex_project, vertex_location, and model when use_psc_endpoint_format=True.","Set them via parameters or the VERTEXAI_PROJECT / VERTEXAI_LOCATION environment variables."],"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"}