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

Agent with model=LiteLlm(model="ollama/gemma3:27b") fails with infinite loop

Open burak-aksoy opened this issue 1 year ago • 7 comments

** 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:

  1. start adk web

  2. Select agent

  3. Type anything (Hello etc.)

  4. Agent starts to loop. (log and screen shot provided)

Expected behavior Basic

Screenshots

Image

agent.log

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.

burak-aksoy avatar Apr 13 '25 17:04 burak-aksoy

Already have an issue like this here https://github.com/google/adk-python/issues/81

INFINIVagas avatar Apr 13 '25 21:04 INFINIVagas

This is fixed in the latest wheel. Please let us know if you still see this issue.

hangfei avatar Apr 24 '25 02:04 hangfei

Hi,

Thanks for the reply.

I tried pip uninstall google-adk pip install google-adk

but still the same problem.

burak-aksoy avatar Apr 25 '25 10:04 burak-aksoy

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 :(

burak-aksoy avatar Apr 26 '25 06:04 burak-aksoy

Its not fixed - ollama/gemma3:12b . Its still running in infinite loop.

pygaurav avatar May 04 '25 09:05 pygaurav

@hangfei FYI

burak-aksoy avatar May 08 '25 15:05 burak-aksoy

hello,

I still have this issue :(

proxybase-user avatar Nov 20 '25 07:11 proxybase-user