Skip to content

[Bug] Exposing Gemma 4 with Unsloth run command leaks thinking / tool calling blocks #6471

Closed

Description

@mugulmd

Note: Please do not remove the questions. Answer beside them.

  1. Did you update? pip install --upgrade unsloth unsloth_zoo -> yes, currently using unsloth 2026.6.8
  2. Colab or Kaggle or local / cloud -> NA
  3. Number GPUs used, use nvidia-smi -> 1
  4. Which notebook? Please link! -> NA
  5. Which Unsloth version, TRL version, transformers version, PyTorch version? -> unsloth 2026.6.8
  6. Which trainer? SFTTrainer, GRPOTrainer etc -> NA

Description

I am running unsloth run --model unsloth/gemma-4-12b-it-GGUF:UD-Q4_K_XL to expose Gemma 4 as an OpenAI-compatible endpoints, and using it in pi.

The server is running fine (hitting the /models endpoint returns the expected model description result).

However when I try to run a query in pi for exploring a codebase, the LLM message I get contains thinking and tool calling blocks:

<think>The user wants to change the ...
...
 First, I'll list the files in the root directory to find the backend
 folder.</think><|tool_call>call:ls{path:"."}<tool_call|>

I don't think this is the expected behavior: these blocks should have been parsed and respectively put into the reasoning_content and tool_calls fields of the response (I might be wrong on the exact semantics of the field).

The most impactful consequence is that the harness cannot actually execute the tool calls, which results in a quite useless coding agent...

Maybe there is a chat template option missing somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions