feat(openrouter/qwen/qwen3.7-max): add new models [bot]#1143
Conversation
|
/test-models |
2 similar comments
|
/test-models |
|
/test-models |
Gateway test results
Failures (10)
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "List 3 colors with their hex codes in JSON."},
],
response_format={"type": "json_object"},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: json-output stream - no content received")
_json.loads(_accumulated)
print("\nVALIDATION: json-output stream SUCCESS")
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
],
reasoning_effort="medium",
stream=True,
)
_reasoning_detected = False
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
if getattr(delta, "reasoning_content", None) is not None:
_reasoning_detected = True
if getattr(delta, "reasoning", None) is not None:
_reasoning_detected = True
_usage = getattr(chunk, "usage", None)
if _usage is not None:
_details = getattr(_usage, "completion_tokens_details", None)
if _details and getattr(_details, "reasoning_tokens", 0) > 0:
_reasoning_detected = True
if not _reasoning_detected:
raise Exception("VALIDATION FAILED: reasoning stream - no reasoning information in stream")
print("\nVALIDATION: reasoning stream SUCCESS")
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=True,
)
_tool_calls_made = False
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
if delta.tool_calls:
_tool_calls_made = True
for _tc in delta.tool_calls:
if _tc.function:
print(_tc.function.arguments or "", end="", flush=True)
if not _tool_calls_made:
raise Exception("VALIDATION FAILED: tool-call stream - no tool calls received")
print("\nVALIDATION: tool-call stream SUCCESS")
ErrorCode snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. London",
},
},
"required": ["location"],
"additionalProperties": False,
},
"strict": True,
},
},
]
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Use the get_weather tool to check the weather in London. You must call the tool, do not respond with plain text."},
],
tools=tools,
tool_choice="auto",
stream=False,
)
_message = response.choices[0].message
if _message.tool_calls:
for _tc in _message.tool_calls:
print(f"Function: {_tc.function.name}")
print(f"Arguments: {_tc.function.arguments}")
else:
print(_message.content)
if not _message.tool_calls or len(_message.tool_calls) == 0:
raise Exception("VALIDATION FAILED: tool-call - no tool calls in response")
print("VALIDATION: tool-call SUCCESS")
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "What is the capital of France?"},
],
max_tokens=128,
temperature=0.8,
stream=False,
)
print(response.choices[0].message.content)
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "What is the capital of France?"},
],
max_tokens=128,
temperature=0.8,
stream=True,
)
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
print(delta.content, end="", flush=True)
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "How to calculate 3^3^3^3? Think step by step and show all reasoning."},
],
reasoning_effort="medium",
stream=False,
)
_usage = getattr(response, "usage", None)
_reasoning_detected = False
_choices = getattr(response, "choices", None)
if _choices and len(_choices) > 0:
_message = getattr(_choices[0], "message", None)
else:
_message = None
if _message and getattr(_message, "content", None) is not None:
print(_message.content)
if _usage is not None:
_output_token_details = getattr(_usage, "completion_tokens_details", None)
if _output_token_details and getattr(_output_token_details, "reasoning_tokens", 0) > 0:
_reasoning_detected = True
elif getattr(_usage, "reasoning", None) is not None:
_reasoning_detected = True
if getattr(_message, "reasoning_content", None) is not None:
_reasoning_detected = True
elif getattr(_message, "reasoning", None) is not None:
_reasoning_detected = True
if not _reasoning_detected:
print("Response: ", response)
raise Exception("VALIDATION FAILED: reasoning - no reasoning information in response")
print("VALIDATION: reasoning SUCCESS")
ErrorCode snippetfrom openai import OpenAI
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "List 3 colors with their hex codes in JSON."},
],
response_format={"type": "json_object"},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: json-output - response content is empty")
_json.loads(_content)
print("VALIDATION: json-output SUCCESS")
ErrorCode snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received")
_parsed = _json.loads(_accumulated)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
)
print("\nVALIDATION: structured-output stream SUCCESS") |
|
/test-models |
Gateway test results
Failures (2)
ErrorCode snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=False,
)
import json as _json
_content = response.choices[0].message.content
print(_content)
if not _content:
raise Exception("VALIDATION FAILED: structured-output - response content is empty")
_parsed = _json.loads(_content)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output - unexpected keys present: {set(_parsed.keys())}"
)
print("VALIDATION: structured-output SUCCESS")Output
ErrorCode snippetfrom openai import OpenAI
import json
client = OpenAI(api_key="***", base_url="https://internal.devtest.truefoundry.tech/api/llm")
response_schema = json.loads('''{
"title": "CalendarEvent",
"type": "object",
"properties": {
"name": { "type": "string" },
"date": { "type": "string" },
"participants": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["name", "date", "participants"],
"additionalProperties": false
}''')
response = client.chat.completions.create(
model="test-v2-openrouter/qwen-qwen3.7-max",
messages=[
{"role": "user", "content": "Alice and Bob are going to a science fair on Friday. Extract the event details as JSON."},
],
response_format={"type": "json_schema", "json_schema": {"name": "CalendarEvent", "schema": response_schema}},
stream=True,
)
import json as _json
_accumulated = ""
for chunk in response:
if chunk.choices and len(chunk.choices) > 0:
delta = chunk.choices[0].delta
if delta.content is not None:
_accumulated += delta.content
print(delta.content, end="", flush=True)
if not _accumulated:
raise Exception("VALIDATION FAILED: structured-output stream - no content received")
_parsed = _json.loads(_accumulated)
if "name" not in _parsed or "date" not in _parsed or "participants" not in _parsed:
raise Exception("VALIDATION FAILED: structured-output stream - missing expected fields (name, date, participants)")
if not isinstance(_parsed.get("participants"), list):
raise Exception("VALIDATION FAILED: structured-output stream - 'participants' is not a list, schema not enforced")
if set(_parsed.keys()) != {"name", "date", "participants"}:
raise Exception(
f"VALIDATION FAILED: structured-output stream - unexpected keys present: {set(_parsed.keys())}"
)
print("\nVALIDATION: structured-output stream SUCCESS")OutputSuccesses (8)
Output
Output
Output
Output
Output
Output
Output
Output |
|
/test-models |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c7ca8f. Configure here.
| features: | ||
| - function_calling | ||
| - json_output | ||
| - prompt_caching |
There was a problem hiding this comment.
Missing cache read cost
Medium Severity
The qwen3.7-max.yaml config enables prompt_caching and sets cache_creation_input_token_cost, but it's missing cache_read_input_token_cost. This means cost estimates for cached prompts will be inaccurate, as OpenRouter has separate pricing for cache reads.
Reviewed by Cursor Bugbot for commit 9c7ca8f. Configure here.
| - function_calling | ||
| - json_output | ||
| - prompt_caching | ||
| - structured_output |
There was a problem hiding this comment.
Structured output validation fails
Medium Severity
structured_output is listed in features, but gateway model tests for this PR report validation_failure on both structured-output scenarios while json_output scenarios pass. That mismatch suggests schema-strict output is not reliably met despite the flag.
Reviewed by Cursor Bugbot for commit 9c7ca8f. Configure here.


Auto-generated by model-addition-agent for
openrouter/qwen/qwen3.7-max.Note
Low Risk
Low risk: adds a new model metadata YAML file only, with no changes to runtime logic or shared configuration.
Overview
Adds a new OpenRouter model definition for
qwen/qwen3.7-max, including token pricing, supported features (tool/function calling, JSON/structured output, prompt caching), and large context/output limits, marked aschatandserverlesswiththinkingenabled.Reviewed by Cursor Bugbot for commit 9c7ca8f. Bugbot is set up for automated code reviews on this repo. Configure here.