Skip to content

ADK agent on Agent Engine with VertexAI models result in Model not Found #3020

Description

@martijnschouwe

Describe the bug
When using a model from Vertex AI the results is model not found on Agent Engine
Locally the agent works running adk web
Deploy with adk deploy

To Reproduce

The agent code
from dotenv import load_dotenv
from google.adk.agents import LlmAgent
from google.adk.models.anthropic_llm import Claude # Import needed for registration
from google.adk.models.registry import LLMRegistry # Import needed for registration
from google.genai import types
from vertexai import agent_engines
from prompt import COPY_WRITER
import os
from google.adk.models.lite_llm import LiteLlm

load_dotenv()

LLMRegistry.register(Claude)

root_agent = LlmAgent(
# The ADK's Claude class recognizes this "claude-..." prefix.
model="claude-3-7-sonnet@20250219",
name="cotton_copywriter",
instruction=COPY_WRITER,
description="You are a copy writer agent helping the marketing department",
generate_content_config=types.GenerateContentConfig(max_output_tokens=4096),
)

app = agent_engines.AdkApp(
agent=root_agent,
enable_tracing=True,
)

The deploy script:
import vertexai
from agent import root_agent
from vertexai import agent_engines
from vertexai import agent_engines
from vertexai.preview.reasoning_engines import AdkApp

vertexai.init(staging_bucket="gs://bucket", location="europe-west1")

app = AdkApp(agent=root_agent, enable_tracing=True)

remote_app = agent_engines.create(
app,
display_name="The Copywriter",
description="A Helpful Copywriter",
requirements=[
"google-adk",
"google-cloud-aiplatform[adk,agent_engines]==1.95.1",
"python-dotenv",
"cloudpickle",
"pydantic",
],
)

The Cloud trace logs:

exception.escaped False
exception.message Model claude-3-7-sonnet@20250219 not found.
exception.stacktrace Traceback (most recent call last): File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.11/lib/python3.11/site-packages/opentelemetry/trace/init.py", line 589, in use_span yield span File "/home/appuser

Expected behavior
A text response just like with Gemini models, when replacing the Anthropic models with gemini the Agent Engine gives response

Desktop (please complete the following information):

  • OS:MacOs
  • Python version(python -V): 3.11.13
  • ADK version(pip show google-adk): 1.8.0

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used(e.g. gemini-2.5-pro) Claude sonnet 3 or 4 on VertexAI

Additional context
Also tried with a full url as described here:
https://google.github.io/adk-docs/agents/models/#model-garden-deployments

And with
https://google.github.io/adk-docs/agents/models/#fine-tuned-model-endpoints

Metadata

Metadata

Labels

agent engine[Component] This issue is related to Vertex AI Agent Engine

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions