adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

Using Preview Gemini Models on Vertex AI Agent Engine

Open sertacakdogan opened this issue 1 year ago • 11 comments

Describe the bug I'm not able to run gemini flash 2.5 preview on Vertex Agent Engine because its on global location but global location is not available on Agent Engine.

To Reproduce Setting vertex ai location to global and host on vertex ai.

Expected behavior preview models to be able to assigned to agennts' models.

Model Information:

  • Are you using LiteLLM: Not for this case
  • Which model is being used(e.g. gemini-flash-latest or gemini-2.5-flash-preview)

sertacakdogan avatar Oct 14 '25 18:10 sertacakdogan

having the same issue!

smohsin-pave avatar Oct 14 '25 20:10 smohsin-pave

Hello @sertacakdogan

We recommend trying gemini-2.5-flash, it is available across different location. You can refer to this page for detailed information on model locations.

llalitkumarrr avatar Nov 27 '25 08:11 llalitkumarrr

Hello @sertacakdogan

We recommend trying gemini-2.5-flash, it is available across different location. You can refer to this page for detailed information on model locations.

Surely, I'm using 2-5 flash. But It's not the solution. For example, I cannot use also gemini-3-pro-preview because its on preview. There should be a native solution for using preview models natively.

sertacakdogan avatar Nov 27 '25 14:11 sertacakdogan

Hello @sertacakdogan ,

We understand your concern, but you will get comparable performance with gemini-2.5-flash as this is final version. Preview versions are usually released to gather insight and feedback. So we believe gemini-2.5-flash should be able to deliver you expect results.

llalitkumarrr avatar Dec 02 '25 12:12 llalitkumarrr

@sertacakdogan what error did you see in your deployment? Have you tried using the "global" model endpoint with "us-central1" in Vertex AI Agent Engine?

wuliang229 avatar Jan 15 '26 23:01 wuliang229

Just checked with the team. It's being worked on. Should be fixed soon!

wuliang229 avatar Jan 16 '26 02:01 wuliang229

Just checked with the team. It's being worked on. Should be fixed soon!

Hello, I tried using google-3-flash-preview and it does not work. version: google-adk==1.22.0

Error: {"error": "404 NOT_FOUND. {'error': {'code': 404, 'message': 'Publisher Model projects/viralyst-b2hpxy/locations/us-central1/publishers/google/models/gemini-3-flash-preview was not found or your project does not have access to it. Please ensure you are using a valid model version. For more information, see: https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions', 'status': 'NOT_FOUND'}}"}

sertacakdogan avatar Jan 16 '26 18:01 sertacakdogan

@sertacakdogan Thanks. I'm seeing the same issue after deploying to Agent Engine. Confirming again that this is a known issue and should be fixed within the next week or two.

wuliang229 avatar Jan 16 '26 18:01 wuliang229

hey team @wuliang229 @yeesian , my team is also seeing the same issue - since the preview models are only available on "global", but Agent Engine is dependent on a singular location that is set on the Vertex AI init with a specific region (usually us-central1 is the default). It is currently too complicated to test out the preview models on Agent Engine deployed ADK agents.

The issue is that there is no current way to configure some sort of deployment_location and model_location attributes within the agent_engine.deploy and agent_engine.update commands.

Having these configurations available would be key to enabling us to use the new models (and releasing them to GA would be nice too... it's been a few months 😄)

reyolivo avatar Mar 20 '26 19:03 reyolivo

Any news on this?

ariel-udc avatar Apr 28 '26 12:04 ariel-udc

shipped in v2.4.0. Gemini takes a client_kwargs dict passed straight to the genai client, so one model can target a different vertex location than the deployment it runs in:

Gemini(model="gemini-3-pro-preview", client_kwargs={"location": "global"})

with GOOGLE_CLOUD_LOCATION=us-central1 a plain Gemini resolves to .../locations/us-central1/..., the exact path in your 404. with the above it resolves to .../locations/global/..., where the preview models live. applies to the streaming client too.

client_kwargs is dropped by model_dump(), so you can't express it in a yaml agent config. set it in python. it does survive the pickling agent engine deploys use.

the deployment_location / model_location split is vertex sdk surface, so that half belongs on googleapis/python-aiplatform.

GWeale avatar Aug 24 '26 20:08 GWeale