Gemma-4-31B-it occasionally emits <turn|> token when served via vLLM, causing failures when using it with GitHub Copilot Custom Model Provider

#138
by aygupt - opened

I have been using gemma-4-31B-it deployed with vLLM in Github CoPilot mainly for coding purposes. However sometimes I get this error after getting a response back for a prompt :-

...<turn|>

x Sorry, no response was returned.

Is this an issue with chat-template or an issue from vLLM's side ?

I have attached a screenshot for more details.
chat_error

My Configuration :-
Model: google/gemma-4-31B-it
Serving: vLLM
Client: GitHub Copilot (Custom Model Provider)
Deployment: Docker
vLLM: 0.25.1

vLLM Configuration :-
--model google/gemma-4-31B-it
--served-model-name personal-coder
--dtype auto
--kv-cache-dtype fp8
--max-model-len 143360
--override-generation-config '{"temperature":1.0,"top_p":0.95,"top_k":64}'
--max-num-batched-tokens 5120
--gpu-memory-utilization 0.97
--enable-prefix-caching
--enable-chunked-prefill
--enable-auto-tool-choice
--tool-call-parser gemma4
--reasoning-parser gemma4
--trust-remote-code
--language-model-only

Google org

Hi @aygupt , thanks for reporting this . I'd like to try reproducing this on my end.
Could you please share the minimal reproducible prompt or message payload that reliably triggers this error? Also, just a quick check there was an recent update to the Gemma 4 chat template that touches on turn boundaries. Could you confirm if you're using the latest chat template ?

I am working on a C++/CMake code-base. I am attaching a screenshot. In the screenshot when I provide it instructions or some prompt to perform something, it fails to generate the response.

I can see the logic and thoughts\thinking process but it does not provide an answer based on that. It succeeds with the command but fails to generate any output or perform required operation like changing/editing a file etc or producing output and produces some error and outputs <turn|>in the end.

image (1)

Also, I checked, I am using the updated chat-template based on latest commit: https://huggingface.co/google/gemma-4-31B-it/blob/main/chat_template.jinja.

Sign up or log in to comment