ollama - 💡(How to fix) Fix Format output for qwen 3.5 35b model does not count thinking tokens as eval [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14957Fetched 2026-04-08 01:04:01
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
commented ×2labeled ×1
RAW_BUFFERClick to expand / collapse

What is the issue?

Format output for qwen 3.5 35b model does not count thinking tokens as eval, but adds them as prompt_eval.

This is the request params:

response = client_llm.chat(model="qwen3.5:35b", messages=messages, context_length= 40000, top_p = 0.95, top_k = 20, temperature = 1, repeat_penalty=1.5, max_tokens=6000, stream=True, format=ProcessedTranscription.model_json_schema(), )

The problem can be identified by changing prompt_eval for the same request running several times.

Relevant log output

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

1.18.1

extent analysis

Fix Plan

To fix the issue with the qwen 3.5 35b model not counting thinking tokens as eval, but adding them as prompt_eval, we need to adjust the format parameter in the client_llm.chat request.

Code Changes

Here's an example of how to modify the request:

response = client_llm.chat(
    model="qwen3.5:35b", 
    messages=messages,
    context_length=40000,
    top_p=0.95,
    top_k=20,
    temperature=1,
    repeat_penalty=1.5,
    max_tokens=6000,
    stream=True,
    format={"output_type": "text", "include_thinking_tokens": True}, 
)

Alternatively, if you are using the ProcessedTranscription.model_json_schema() function to generate the format, you can modify it to include the include_thinking_tokens field:

class ProcessedTranscription:
    @staticmethod
    def model_json_schema():
        return {
            "output_type": "text",
            "include_thinking_tokens": True,  # Add this line
        }

Verification

To verify that the fix worked, run the same request multiple times and check the prompt_eval values. They should now be consistent and include the thinking tokens as eval.

Extra Tips

Make sure to update the ProcessedTranscription.model_json_schema() function or the format parameter in all places where the qwen 3.5 35b model is used to ensure consistency.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING