Skip to content

[Bug]: tool_choice Not Respected in Qwen3.5-VL: Tools Triggered on Every Request #107

@abdullah-cod9

Description

@abdullah-cod9
  • I am running the latest code from the JamePeng/llama-cpp-python branch.
  • I carefully followed the README.md.
  • I have verified the issue is not a duplicate.
  • I have tested it using the official binary llama-cli or llama-server provided by llama.cpp, and the problem (exists/does not exist) still exists.
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Environment & Hardware Configuration

Please provide your specific setup. Use the suggested commands for your OS to verify.

  • OS Version: Windows
  • CPU: AMD Ryzen 5 3600 6-Core Processor
  • RAM: 16 GB
  • GPU: NVIDIA RTX 3060 12GB
  • Python: 3.12

Model & Logic Context

  • Model source: HuggingFace
  • Model: Qwen3.5-VL

Failure Timing & Logs

The issue is occurring during Runtime.

Analysis & Brainstorming

I've noticed that tool_choice isn't taken into account in multimodal models such as Qwen3.5. The tools are passed and executed for every request as if tool_choice were set to “required” by default. I suspect the reason might be that the code doesn't pass this parameter when rendering the chat template.

I've made sure to set tool_choice to None. I've also tried other tool_choice like "auto".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions