#1454·GenieX

QAIRT backend: tools parameter silently dropped in apply_chat_template, tool calling non-functional

Author: EurusZhangCreated Sep 11, 2026Updated Sep 17, 2026

Describe the bug When running a QAIRT-backed model (e.g. qualcomm/Qwen3-VL-8B-Instruct:W4A16) via geniex serve, the tools parameter in an OpenAI-compatible /v1/chat/completions request is correctly forwarded through GenieX's Go layer into the C-level geniex_vlm_apply_chat_template call, but is silently dropped during prompt rendering. The final prompt_utf8 is identical to a request sent without tools, prompt_tokens is unchanged, and tool_calls in the response is always null.

Debug log evidence:

# tools correctly passed into C layer
VlmApplyChatTemplateInput(tools: [{"function":{"name":"get_weather",...}}], ...)

# but rendered prompt contains no tool definitions
prompt_utf8:
 <|im_start|>system
 You are a helpful AI assistant.<|im_end|>
 <|im_start|>user
 What is the weather in Beijing?<|im_end|>
 <|im_start|>assistant

To Reproduce Steps to reproduce the behavior:

  1. Start GenieX server: geniex serve
  2. Send a request with tools to a QAIRT model:
bash
 curl http://localhost:18181/v1/chat/completions \
   -H "Content-Type: application/json" \
   -d '{
     "model": "qualcomm/Qwen3-VL-8B-Instruct:W4A16",
     "messages": [{"role": "user", "content": "What is the weather in Beijing?"}],
     "tools": [{"type": "function", "function": {"name": "get_weather", "description": "Get weather for a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}],
     "tool_choice": "auto",
     "max_tokens": 256
   }'
  1. Observe tool_calls: null in the response and prompt_tokens unchanged vs. a request without tools.

Expected behavior Tool definitions should be rendered into the prompt so the model can return a structured tool_calls response. The upstream Qwen/Qwen3-VL-8B-Instruct model on HuggingFace includes a full Jinja2 chat template with a complete tools branch — this capability should be preserved in the QAIRT deployment bundle and reflected in the plugin's apply_chat_template implementation.

Screenshots N/A

Desktop (please complete the following information):

  • OS: Windows 11 (ARM64)
  • Browser: N/A
  • GenieX CLI: v0.6.1
  • QAIRT Runtime: 2.45
  • LlamaCPP Runtime Hash: 0eadefe

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A
  • Version: N/A

Additional context The tokenizer_config.json bundled with qualcomm/Qwen3-VL-8B-Instruct:W4A16 is only 710 bytes (no chat_template field), whereas the upstream HuggingFace model ships a 10.9 kB tokenizer_config.json containing a full chat template with tools support. The QAIRT plugin's apply_chat_template uses a static template with no tools rendering logic, so the capability gap exists at both the bundle and the plugin level.