{"record":{"id":"5e4cf6aeb638090d","repo":"BerriAI/litellm","slug":"e-5e4cf6","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"http","errorClass":"VertexAIError","httpStatus":500,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_model_garden/main.py","lineNumber":149,"sourceCode":"                messages=messages,\n                api_base=api_base,\n                api_key=access_token,\n                custom_prompt_dict=custom_prompt_dict,\n                model_response=model_response,\n                print_verbose=print_verbose,\n                logging_obj=logging_obj,\n                optional_params=optional_params,\n                acompletion=acompletion,\n                litellm_params=litellm_params,\n                logger_fn=logger_fn,\n                client=client,\n                timeout=timeout,\n                encoding=encoding,\n                custom_llm_provider=\"vertex_ai\",\n            )\n\n        except Exception as e:\n            raise VertexAIError(status_code=500, message=str(e))\n","sourceCodeStart":131,"sourceCodeEnd":150,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_model_garden/main.py#L131-L150","documentation":"A catch-all wrapper at the boundary of the Vertex Model Garden completion handler: any exception raised while preparing or executing the request (token retrieval, URL building, the OpenAILikeChatHandler call) is re-raised as VertexAIError with status 500 and the original message preserved. It is not a specific failure itself — it is the transport envelope for whatever went wrong underneath; read the message text to find the real cause.","triggerScenarios":"Any failure inside the vertex_ai/openai/{MODEL_ID} path: missing project/credentials from _ensure_access_token, model-name resolution errors from get_vertex_base_model_name, network/HTTP failures from the underlying handler, or unsupported-parameter errors — all re-wrapped here with status_code=500.","commonSituations":"Model Garden model IDs spelled wrong (publisher/model mismatch); Vertex endpoint not deployed for the requested model in that project/region; quota or permission (iam.serviceAccounts) errors; transient 429/503 from the Vertex service being surfaced as generic 500s.","solutions":["Read the wrapped message — it is str(e) of the original exception and names the actual problem; fix that first.","Confirm the model string after normalization: get_vertex_base_model_name must map vertex_ai/openai/<id> to a deployed Model Garden endpoint in your project.","Verify project/location/credentials (vertex_project, vertex_location, VERTEXAI_*) and that aiplatform.googleapis.com is enabled.","If the inner error is a Google 429/5xx, add retries with exponential backoff rather than changing config."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from litellm.exceptions import VertexAIError\n\ntry:\n    resp = litellm.completion(model=\"vertex_ai/openai/llama-3.1-405b-instruct\", messages=msgs)\nexcept VertexAIError as e:\n    inner = str(e)  # contains the original error text\n    if \"429\" in inner or \"quota\" in inner.lower():\n        backoff_and_retry()\n    elif \"permission\" in inner.lower():\n        raise ConfigError(f\"Vertex IAM/billing issue: {inner}\")\n    else:\n        raise","preventionTips":["Treat this wrapper as opaque: always branch on the inner message, never on status_code alone (it is always 500 here).","Pre-validate model IDs against your deployed Model Garden endpoints before calling.","Wrap model-garden calls with retry+backoff for transient Google-side 429/5xx inner errors."],"tags":["vertex-ai","model-garden","wrapper","http-500"],"backgroundTag":"provider-api-error","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}