ollama - 💡(How to fix) Fix Infinity loop in tool calls with Gemma4 + Ollama 0.20.6/0.20.7 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15573Fetched 2026-04-16 06:36:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
5
Author
Participants
Timeline (top)
subscribed ×2labeled ×1renamed ×1
RAW_BUFFERClick to expand / collapse

What is the issue?

Upgrade Ollama to version 0.20.6 (edit and 0.20.7 too) causing infinity loop in tool calls with gemma4:31b. After reverting back to version 0.20.5 this problem will disappear. Observed only with the gemma4 model, other models e.g. qwen3.5 work with tool calls without problems.

Relevant log output

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.20.6 / 0.20.7

extent analysis

TL;DR

Downgrade Ollama to version 0.20.5 to avoid the infinity loop issue with the gemma4:31b model.

Guidance

  • The issue seems to be specific to the gemma4:31b model and Ollama versions 0.20.6 and 0.20.7, so trying other models like qwen3.5 may not reproduce the problem.
  • Verify that the issue is resolved by downgrading to version 0.20.5 and testing tool calls with the gemma4:31b model.
  • If downgrading is not feasible, consider testing other gemma4 models to see if the issue is specific to the 31b variant.
  • Monitor the Ollama version history for a potential fix in future releases.

Notes

The root cause of the issue is unclear, but it seems to be related to the specific combination of Ollama version and gemma4:31b model.

Recommendation

Apply workaround: Downgrade to version 0.20.5, as it is the only known version that resolves the issue with the gemma4:31b model.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING