Hi, i’m running Gemma4 locally on Apple M2 with 32GB of Unified RAM. I am serving it with llamma.cpp. I am trying to use it with coding agents. No matter which coding agent I test with (Kilo Code, Pi, Continue, Aider), it almost always devolves into looping thoughts. I realize in the config below I am running an unsloth variant, but this issue happens on the original versions of the model as well, and on other variations and sizes that I have tried.
I’m reluctant to raise the repeat-penalty arg because I don’t want to reduce the quality of the output. Are there any recommended configs I am missing that would fix this?
This is my llamma config:
~/.unsloth/llama.cpp/build/bin/llama-server \
-m /Users/cnrudd/.cache/huggingface/hub/models--unsloth--gemma-4-12B-it-qat-GGUF/snapshots/7102bdea62863acff919c945405ef29973113d66/gemma-4-12B-it-qat-UD-Q4_K_XL.gguf \
--port 50305 \
--ctx-size 262143 \
--n-predict 32768 \
--parallel 1 \
--flash-attn on \
--no-context-shift \
--fit on \
--jinja \
--reasoning on \
--chat-template-kwargs '{"preserve_thinking": true}' \
--spec-draft-n-max 1 \
--mmproj /Users/cnrudd/.cache/huggingface/hub/models--unsloth--gemma-4-12B-it-qat-GGUF/snapshots/7102bdea62863acff919c945405ef29973113d66/mmproj-F16.gguf \
--temp 1.0 \
--top-k 40 \
--top-p 0.95 \
--repeat-penalty 1.0 \
--log-verbose \
Here is a screengrab of the looping:

