{"record":{"id":"061614b1dac2005b","repo":"BerriAI/litellm","slug":"invalid-credentials-type-type-credentials","errorCode":null,"errorMessage":"Invalid credentials type: {type(credentials)}","messagePattern":"Invalid credentials type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/vertex_llm_base.py","lineNumber":128,"sourceCode":"                    os.getcwd(),\n                )\n\n                try:\n                    if _is_path:\n                        with open(credentials) as f:\n                            json_obj = json.load(f)\n                    else:\n                        json_obj = json.loads(credentials)\n                except Exception as e:\n                    raise Exception(\n                        \"Unable to load vertex credentials from environment. \"\n                        \"Ensure the JSON is valid (check for unescaped newlines in private_key). \"\n                        f\"Parse error: {type(e).__name__}\"\n                    )\n            elif isinstance(credentials, dict):\n                json_obj = credentials\n            else:\n                raise ValueError(f\"Invalid credentials type: {type(credentials)}\")\n\n            # Check if the JSON object contains Workload Identity Federation configuration\n            if \"type\" in json_obj and json_obj[\"type\"] == \"external_account\":\n                # If environment_id key contains \"aws\" value it corresponds to an AWS config file\n                credential_source: Final = json_obj.get(\"credential_source\", {})\n                environment_id: Final = (\n                    credential_source.get(\"environment_id\", \"\") if isinstance(credential_source, dict) else \"\"\n                )\n                if isinstance(environment_id, str) and \"aws\" in environment_id:\n                    # Check if explicit AWS params are in the JSON (bypasses metadata)\n                    from litellm.llms.vertex_ai.vertex_ai_aws_wif import (\n                        VertexAIAwsWifAuth,\n                    )\n\n                    aws_params: Final = VertexAIAwsWifAuth.extract_aws_params(json_obj)\n                    if aws_params:\n                        creds = VertexAIAwsWifAuth.credentials_from_explicit_aws(\n                            json_obj,","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/vertex_llm_base.py#L110-L146","documentation":"Type guard on the credentials parameter in load_auth: it is neither None, a str, nor a dict (the supported VERTEX_CREDENTIALS_TYPES), so LiteLLM does not know how to interpret it. The unexpected type is reported.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/vertex_llm_base.py:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass credentials as a google.oauth2 Credentials object, a dict of the service account JSON, or a path to the JSON key file.","Check the reported type in the error and convert it to one of the supported credential forms."],"exampleFix":null,"handlingStrategy":"type-guard","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"}