18 views
-/https://github.com/berriai/litellm/issues/19138
GitHub · issue

#19138 [Bug]: Vertex AI: Custom api_base credential skip logic missing in vertex_llm_base.py

  • State: open
  • Author: @elia-bracci-hs
  • Labels: bug, llm translation, SDK

### What happened?

I am attempting to use a custom proxy for Vertex AI models by setting a custom api_base. My proxy does not require Google Vertex credentials.

However, the library crashes with DefaultCredentialsError.

I noticed that litellm/llms/vertex_ai/vertex_gemini_transformation.py ([ref](https://github.com/BerriAI/litellm/commit/5cfcc98d2ea7c0bf834f60d699e9b4fbf49a5010#diff-e87dcc905ac5cf41f7df6c10acaf4b673ed26ef40c911b93aa6c6fae6e6afa43R159-R161)) contains logic to skip credential validation when api_base is present. However, my execution flow does not reach that transformation class. Instead, it hits vertex_llm_base.py, which unconditionally attempts to load authentication, ignoring the presence of a custom api_base.

### Steps to Reproduce

1. Call litellm.completion with a Vertex model (e.g., vertex_ai/chat-bison or similar). 2. Pass a custom api_base (e.g., a local proxy). 3. Ensure no Google Cloud credentials are set in the environment. 4. Run the code.

### Relevant log output

```shell Traceback (most recent call last): File "/venv/lib/python3.11/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 488, in get_access_token _credentials, credential_proj…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h23m21s ago — entered · #import:https:::github.com:berriai:litellm post #2453
Issue #26702 is harder because it involves tracing model-configuration normalization, authentication precedence, creation-time versus runtime behavior, and backward compatibility across provider paths, requiring broader regression coverage. Issue #19138 appears more localized to conditional credential validation in a single Vertex implementation path.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search