DataAgentBench icon indicating copy to clipboard operation
DataAgentBench copied to clipboard

Qwen models raise ValueError before first LLM call: prompt_builder has no qwen branch

Open marc-shade opened this issue 4 months ago • 1 comments

Qwen models are documented as supported and are routed to a Together.AI client in DataAgent.py, but prompt_builder.init_messages has no qwen branch, so any Qwen deployment name raises ValueError during DataAgent.__init__, before the first LLM call.

Verified on main @ 9ed8bdde3.

Where

common_scaffold/DataAgent.py:87 routes qwen to Together:

elif "kimi" in deployment_name.lower() or "qwen" in deployment_name.lower():
    self.client = OpenAI(api_key=os.getenv("TOGETHER_API_KEY"), base_url="https://api.together.xyz/v1")

common_scaffold/prompts/prompt_builder.py:79-91 has no matching branch:

if "gemini" in deployment_name.lower(): ...
elif "gpt" in deployment_name.lower(): ...
elif "kimi" in deployment_name.lower(): ...
elif "claude" in deployment_name.lower(): ...
else:
    raise ValueError(f"Unknown deployment_name: {deployment_name}")

README.md:276 states: "Together.AI API (for Kimi and Qwen models)".

Repro

python run_agent.py --dataset music_brainz_20k --query_id 1 \
  --llm qwen3-8b --iterations 20 --use_hints --root_name run_0
File "common_scaffold/DataAgent.py", line 135, in __init__
    self.messages = prompt_builder.init_messages(
File "common_scaffold/prompts/prompt_builder.py", line 91, in init_messages
    raise ValueError(f"Unknown deployment_name: {deployment_name}")
ValueError: Unknown deployment_name: qwen3-8b

The client is constructed successfully first, so the failure is not a credentials problem; it happens on the very next statement regardless of TOGETHER_API_KEY.

Suggested fix

Add a qwen branch to init_messages. I have not proposed the instruction text because the correct choice depends on Together's tool-call ID format for Qwen, which I have not verified. If Qwen tool-call IDs are OpenAI-compatible, reusing GPT_TOOL_CALL_INSTRUCTIONS would be the minimal change; if they resemble Kimi's, KIMI_TOOL_CALL_INSTRUCTINOS would be. Alternatively, if Qwen is no longer intended to be supported, removing it from DataAgent.py:87 and the README would make the two consistent.

Happy to send a PR once you confirm which instruction set is correct.

marc-shade avatar Aug 02 '26 14:08 marc-shade

Thanks @marc-shade !

We no longer have Together.AI access for Qwen, so we can't verify its tool-call ID format . So we've removed Qwen from both the supported-models list in the README, and the Together client routing in DataAgent.py (a Qwen deployment name now fails with Unsupported deployment name).

If you'd still like to run Qwen (or other model) and its tool-call ID format doesn't match any existing branch in common_scaffold/prompts/prompt_builder.py, please feel free to add your own branch and mention the format in the PR — we'd be happy to merge it.

Thanks again for flagging this!

Ruiying-Ma avatar Aug 02 '26 21:08 Ruiying-Ma