Agent with model=LiteLlm(model="ollama/gemma3:27b") fails with infinite loop
** Please make sure you read the contribution guide and file the issues in the rigth place. ** Contribution guide.
Describe the bug When I try to use agent with model=LiteLlm(model="ollama/gemma3:27b") using the adk web, agent goes into infinite loop.
To Reproduce Here is the code: import datetime import random from zoneinfo import ZoneInfo from google.adk.agents import Agent from typing import Optional from google.adk.agents import LlmAgent from google.adk.models.lite_llm import LiteLlm
This method is used to provide dealer data to the caller. The output is the full list of dealer with dealer_code,dealer_name format.
def get_dealers() -> dict: """This function returns list of dealers in dealer_code, dealer name format.""" return { "201": "Bayi A", "202": "Bayi B", "203": "Bayi C", "204": "Bayi D", "205": "Bayi E" }
root_agent = Agent( name="Sales_Rep_Agent", model=LiteLlm(model="ollama/gemma3:27b"), #model="gemini-2.0-flash-exp", description=( "Sales reps helper agent. This agent provides information to sales reps about dealers. " ), instruction=( "You are an agent which provide information to sales reps about dealers. " ), tools=[get_dealers], )
Python Version :3.12 Using Anaconda environment
Steps:
-
start adk web
-
Select agent
-
Type anything (Hello etc.)
-
Agent starts to loop. (log and screen shot provided)
Expected behavior Basic
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Macos
- Python version(python -V): 3.12
- ADK version(pip show google-adk):
Additional context Add any other context about the problem here.
Already have an issue like this here https://github.com/google/adk-python/issues/81
This is fixed in the latest wheel. Please let us know if you still see this issue.
Hi,
Thanks for the reply.
I tried pip uninstall google-adk pip install google-adk
but still the same problem.
This is fixed in the latest wheel. Please let us know if you still see this issue.
I tried installing from the wheel, that did not work as well.
Not fixed :(
Its not fixed - ollama/gemma3:12b . Its still running in infinite loop.
@hangfei FYI
hello,
I still have this issue :(