A2UI icon indicating copy to clipboard operation
A2UI copied to clipboard

Can't run Restaurant finder application with GEMINI_API_KEY - LiteLLM tries to use Vertex credentials

Open jacobsimionato opened this issue 3 weeks ago • 2 comments

I'm having an issue where when I run the restaurant finder app, I get an error like:

  File "/Users/jsimionato/development/A2UI/a2a_agents/python/.venv/lib/python3.13/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 123, in load_auth
    raise ValueError("Could not resolve project_id")
ValueError: Could not resolve project_id
ERROR:LiteLLM:Failed to load vertex credentials. Check to see if credentials containing partial/invalid information. Error: Could not resolve project_id
Traceback (most recent call last):
  File "/Users/jsimionato/development/A2UI/a2a_agents/python/.venv/lib/python3.13/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 490, in get_access_token
    _credentials, credential_project_id = self.load_auth(
                                          ~~~~~~~~~~~~~~^
        credentials=credentials, project_id=project_id
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/jsimionato/development/A2UI/a2a_agents/python/.venv/lib/python3.13/site-packages/litellm/llms/vertex_ai/vertex_llm_base.py", line 123, in load_auth

I'm surprised by this, because I'm setting GEMINI_API_KEY and not providing vertex credentials.

To workaround this, I had to hack to change:

LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini-2.5-flash")

to

LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash")

In a2a_agents/python/adk/samples/restaurant_finder/agent.py.

We should make sure it's easy to use the sample agents with just an API key, because it's too hard to set up Vertex casually.

jacobsimionato avatar Dec 05 '25 02:12 jacobsimionato

CC @dmandar

jacobsimionato avatar Dec 05 '25 02:12 jacobsimionato

This would be great. I ran into this issue. I was able to get Vertex setup, but then when it said I needed to attach a billing account, I bailed.

darrelmiller avatar Dec 05 '25 21:12 darrelmiller