BroadRouter

Why a reasoning model returns an empty answer

Updated

The model spent the whole max_tokens budget on reasoning before it started the visible answer. On BroadNet Inference, DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B reason first, and reasoning counts toward max_tokens. Allow 1,000 tokens or more, or set reasoning_effort to low.

You send a short prompt with max_tokens: 100, the request succeeds, and choices[0].message.content is empty. Nothing is broken: the answer never started.

What happens

Reasoning models write a hidden chain of thought before the visible answer. Both share one max_tokens budget. With a small limit, the reasoning uses all of it, and in the standard chat-completions shape finish_reason is then length.

Three fixes

1. Leave room. Set max_tokens to 1,000 or more, as BroadNet’s docs advise. The max_tokens calculator for reasoning models sizes the limit for your answer length and shows the cost.

2. Reason less. Set reasoning_effort to low for simple tasks:

import os
from openai import OpenAI

client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])

response = client.chat.completions.create(
    model="broadnet/deepseek-v4.1-flash",
    reasoning_effort="low",
    max_tokens=1000,
    messages=[{"role": "user", "content": "Classify: 'refund my order' -> intent?"}],
)

3. Watch the usage. When the model reports it, usage.completion_tokens_details.reasoning_tokens shows how much went to reasoning:

print(response.choices[0].finish_reason)                       # "length" means the budget ran out
details = response.usage.completion_tokens_details             # None if the model doesn't report it
print(details.reasoning_tokens if details else "not reported")

In a stream, add stream_options={"include_usage": True} and the same usage arrives in the last chunk. See streaming chat completions.

Which models reason

Model Reasons first
DeepSeek V4.1 Flash (broadnet/deepseek-v4.1-flash) Yes
GLM 5.3 (broadnet/glm-5.3) Yes
Qwen3.8 27B (broadnet/qwen3.8-27b) Yes
BroadNet Gemma 4 VL 26B (broadnet/gemma-4-26b-a4b) Not listed

Troubleshooting

  • Empty content, finish_reason is length. Raise max_tokens or set reasoning_effort to low.
  • Empty content, finish_reason is stop. The limit was not the cause. Check your prompt and print the full response to see what came back.
  • AttributeError on completion_tokens_details. The model did not report the breakdown for that request; guard for None as in the example above.
  • A slow first token in a stream. The model is reasoning before it writes the answer. A lower reasoning_effort can shorten the wait.

If you run agents all day, reasoning tokens add up on pay-as-you-go. The BroadNet pricing calculator shows when a flat unlimited plan costs less.

Questions

Does reasoning cost money?

On pay-as-you-go, reasoning is reported inside the completion tokens, which are billed at the output price. On an unlimited plan for DeepSeek V4.1 Flash there is no token meter, so they cost nothing extra.

Does BroadNet Gemma 4 VL 26B reason?

BroadNet's docs list reasoning for DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B, not for Gemma 4 VL 26B.

Why is message content empty when finish_reason is length?

The token budget ran out before the visible answer began. A reasoning model writes its reasoning first, and those tokens count toward max_tokens. Raise max_tokens to 1,000 or more, or lower reasoning_effort.

What does reasoning_effort low do?

It asks the model to reason less before it answers. BroadNet's docs suggest it as the alternative to a bigger max_tokens when a short limit leaves the answer empty. Use it for simple tasks such as classification or extraction.

How do I see how many tokens went to reasoning?

Read usage.completion_tokens_details.reasoning_tokens in the response, when the model reports it. In a stream, send stream_options with include_usage true and read it from the last chunk.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity