From 297eb572dec931ab254657a3b70eb77795f90e0e Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Thu, 5 Feb 2026 13:26:27 -0800 Subject: [PATCH 1/2] fix(samples): Use native Gemini integration instead of LiteLLM Replace LiteLlm wrapper with ADK's native Gemini class for better performance, reliability, and access to latest features. This removes the warning about using Gemini via LiteLLM. Changes: - Import Gemini from google.adk.models.google_llm instead of LiteLlm - Rename env var from LITELLM_MODEL to GEMINI_MODEL - Update model format from "gemini/gemini-2.5-flash" to "gemini-2.5-flash" --- samples/agent/adk/contact_lookup/agent.py | 6 +++--- samples/agent/adk/contact_multiple_surfaces/agent.py | 6 +++--- samples/agent/adk/orchestrator/agent.py | 6 +++--- samples/agent/adk/restaurant_finder/agent.py | 6 +++--- samples/agent/adk/rizzcharts/__main__.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/samples/agent/adk/contact_lookup/agent.py b/samples/agent/adk/contact_lookup/agent.py index d16b58a9e..7901d6586 100644 --- a/samples/agent/adk/contact_lookup/agent.py +++ b/samples/agent/adk/contact_lookup/agent.py @@ -26,7 +26,7 @@ from google.adk.agents.llm_agent import LlmAgent from google.adk.artifacts import InMemoryArtifactService from google.adk.memory.in_memory_memory_service import InMemoryMemoryService -from google.adk.models.lite_llm import LiteLlm +from google.adk.models.google_llm import Gemini from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService from google.genai import types @@ -80,7 +80,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the contact agent.""" - LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash") + GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: instruction = get_ui_prompt(self.base_url, CONTACT_UI_EXAMPLES) @@ -89,7 +89,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=LiteLlm(model=LITELLM_MODEL), + model=Gemini(model=GEMINI_MODEL), name="contact_agent", description="An agent that finds colleague contact info.", instruction=instruction, diff --git a/samples/agent/adk/contact_multiple_surfaces/agent.py b/samples/agent/adk/contact_multiple_surfaces/agent.py index 29001eef0..9baa333c9 100644 --- a/samples/agent/adk/contact_multiple_surfaces/agent.py +++ b/samples/agent/adk/contact_multiple_surfaces/agent.py @@ -26,7 +26,7 @@ from google.adk.agents.llm_agent import LlmAgent from google.adk.artifacts import InMemoryArtifactService from google.adk.memory.in_memory_memory_service import InMemoryMemoryService -from google.adk.models.lite_llm import LiteLlm +from google.adk.models.google_llm import Gemini from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService from google.genai import types @@ -75,7 +75,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the contact agent.""" - LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash") + GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: examples = load_examples(self.base_url) @@ -85,7 +85,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=LiteLlm(model=LITELLM_MODEL), + model=Gemini(model=GEMINI_MODEL), name="contact_agent", description="An agent that finds colleague contact info.", instruction=instruction, diff --git a/samples/agent/adk/orchestrator/agent.py b/samples/agent/adk/orchestrator/agent.py index 7298dd627..9248a7362 100644 --- a/samples/agent/adk/orchestrator/agent.py +++ b/samples/agent/adk/orchestrator/agent.py @@ -17,7 +17,7 @@ import os from a2a.client import A2ACardResolver from a2a.extensions.common import HTTP_EXTENSION_HEADER -from google.adk.models.lite_llm import LiteLlm +from google.adk.models.google_llm import Gemini from google.adk.agents.llm_agent import LlmAgent from google.adk.agents.remote_a2a_agent import RemoteA2aAgent, DEFAULT_TIMEOUT from google.adk.planners.built_in_planner import BuiltInPlanner @@ -182,9 +182,9 @@ async def build_agent(cls, base_url: str, subagent_urls: List[str]) -> (LlmAgent logger.info(f'Created remote agent with description: {description}') - LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash") + GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") agent = LlmAgent( - model=LiteLlm(model=LITELLM_MODEL), + model=Gemini(model=GEMINI_MODEL), name="orchestrator_agent", description="An agent that orchestrates requests to multiple other agents", instruction="You are an orchestrator agent. Your sole responsibility is to analyze the incoming user request, determine the user's intent, and route the task to exactly one of your expert subagents", diff --git a/samples/agent/adk/restaurant_finder/agent.py b/samples/agent/adk/restaurant_finder/agent.py index 5283cd882..cc8db5a1e 100644 --- a/samples/agent/adk/restaurant_finder/agent.py +++ b/samples/agent/adk/restaurant_finder/agent.py @@ -22,7 +22,7 @@ from google.adk.agents.llm_agent import LlmAgent from google.adk.artifacts import InMemoryArtifactService from google.adk.memory.in_memory_memory_service import InMemoryMemoryService -from google.adk.models.lite_llm import LiteLlm +from google.adk.models.google_llm import Gemini from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService from google.genai import types @@ -93,7 +93,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the restaurant agent.""" - LITELLM_MODEL = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash") + GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: # Construct the full prompt with UI instructions, examples, and schema @@ -104,7 +104,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=LiteLlm(model=LITELLM_MODEL), + model=Gemini(model=GEMINI_MODEL), name="restaurant_agent", description="An agent that finds restaurants and helps book tables.", instruction=instruction, diff --git a/samples/agent/adk/rizzcharts/__main__.py b/samples/agent/adk/rizzcharts/__main__.py index ab459ee07..2e3facc2a 100644 --- a/samples/agent/adk/rizzcharts/__main__.py +++ b/samples/agent/adk/rizzcharts/__main__.py @@ -25,7 +25,7 @@ from agent import RizzchartsAgent from google.adk.artifacts import InMemoryArtifactService from google.adk.memory.in_memory_memory_service import InMemoryMemoryService -from google.adk.models.lite_llm import LiteLlm +from google.adk.models.google_llm import Gemini from google.adk.runners import Runner from google.adk.sessions.in_memory_session_service import InMemorySessionService from dotenv import load_dotenv @@ -53,9 +53,9 @@ def main(host, port): "GEMINI_API_KEY environment variable not set and GOOGLE_GENAI_USE_VERTEXAI is not TRUE." ) - lite_llm_model = os.getenv("LITELLM_MODEL", "gemini/gemini-2.5-flash") + gemini_model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") agent = RizzchartsAgent( - model=LiteLlm(model=lite_llm_model), + model=Gemini(model=gemini_model), a2ui_enabled_provider=get_a2ui_enabled, a2ui_schema_provider=get_a2ui_schema, ) From 1a720f2f4efc44a54ed49ec0d32bcc8f59edb603 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Thu, 5 Feb 2026 17:53:07 -0800 Subject: [PATCH 2/2] style: Use snake_case for gemini_model variable --- samples/agent/adk/contact_lookup/agent.py | 4 ++-- samples/agent/adk/contact_multiple_surfaces/agent.py | 4 ++-- samples/agent/adk/orchestrator/agent.py | 4 ++-- samples/agent/adk/restaurant_finder/agent.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/agent/adk/contact_lookup/agent.py b/samples/agent/adk/contact_lookup/agent.py index 7901d6586..2a4bfc239 100644 --- a/samples/agent/adk/contact_lookup/agent.py +++ b/samples/agent/adk/contact_lookup/agent.py @@ -80,7 +80,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the contact agent.""" - GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") + gemini_model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: instruction = get_ui_prompt(self.base_url, CONTACT_UI_EXAMPLES) @@ -89,7 +89,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=Gemini(model=GEMINI_MODEL), + model=Gemini(model=gemini_model), name="contact_agent", description="An agent that finds colleague contact info.", instruction=instruction, diff --git a/samples/agent/adk/contact_multiple_surfaces/agent.py b/samples/agent/adk/contact_multiple_surfaces/agent.py index 9baa333c9..b23749abc 100644 --- a/samples/agent/adk/contact_multiple_surfaces/agent.py +++ b/samples/agent/adk/contact_multiple_surfaces/agent.py @@ -75,7 +75,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the contact agent.""" - GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") + gemini_model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: examples = load_examples(self.base_url) @@ -85,7 +85,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=Gemini(model=GEMINI_MODEL), + model=Gemini(model=gemini_model), name="contact_agent", description="An agent that finds colleague contact info.", instruction=instruction, diff --git a/samples/agent/adk/orchestrator/agent.py b/samples/agent/adk/orchestrator/agent.py index 9248a7362..039ca2874 100644 --- a/samples/agent/adk/orchestrator/agent.py +++ b/samples/agent/adk/orchestrator/agent.py @@ -182,9 +182,9 @@ async def build_agent(cls, base_url: str, subagent_urls: List[str]) -> (LlmAgent logger.info(f'Created remote agent with description: {description}') - GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") + gemini_model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") agent = LlmAgent( - model=Gemini(model=GEMINI_MODEL), + model=Gemini(model=gemini_model), name="orchestrator_agent", description="An agent that orchestrates requests to multiple other agents", instruction="You are an orchestrator agent. Your sole responsibility is to analyze the incoming user request, determine the user's intent, and route the task to exactly one of your expert subagents", diff --git a/samples/agent/adk/restaurant_finder/agent.py b/samples/agent/adk/restaurant_finder/agent.py index cc8db5a1e..6ca1b8c38 100644 --- a/samples/agent/adk/restaurant_finder/agent.py +++ b/samples/agent/adk/restaurant_finder/agent.py @@ -93,7 +93,7 @@ def get_processing_message(self) -> str: def _build_agent(self, use_ui: bool) -> LlmAgent: """Builds the LLM agent for the restaurant agent.""" - GEMINI_MODEL = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") + gemini_model = os.getenv("GEMINI_MODEL", "gemini-2.5-flash") if use_ui: # Construct the full prompt with UI instructions, examples, and schema @@ -104,7 +104,7 @@ def _build_agent(self, use_ui: bool) -> LlmAgent: instruction = get_text_prompt() return LlmAgent( - model=Gemini(model=GEMINI_MODEL), + model=Gemini(model=gemini_model), name="restaurant_agent", description="An agent that finds restaurants and helps book tables.", instruction=instruction,