Skip to content

v3.4.0 - Reasoning models and prompt cache stats

Latest

Choose a tag to compare

@hekmon hekmon released this 20 Nov 17:37
· 9 commits to main since this release
v3.4.0
e6bfffa

This release is about reasoning models. Their reasoning used to be dropped. It is now kept in the history and sent back to the server, and you can print it in the console if you want. The usage stats now also explain the prompt cache: what was read, what was written, and what the server really had to process. Existing workflows keep working as is. With a reasoning model, though, the history now carries the reasoning (see Upgrade notes).

✨ Reasoning models

  • The reasoning is no longer dropped. It is read from reasoning_content (llama.cpp, SGLang, LM Studio, tabbyAPI, DeepSeek…), or else from reasoning (recent vLLM, Ollama, OpenRouter, Groq…).
  • It is kept in the History output under the key it arrived with, and sent back as is on the next turns. Whether the model reuses it (preserved thinking) is up to the server and its chat template. Some need a chat template option, which you can set with the Extra body node. Null or empty values are never kept, because some servers reject them.
  • Relays such as OpenRouter or the Vercel AI Gateway return reasoning_details blocks (text, summary and encrypted). They are kept unmodified and in order, which Gemini continuations require. The content of encrypted blocks is never logged.
  • Show Reasoning (new advanced input, off by default) prints the reasoning in the console, plus the count and size of the encrypted blocks. It is off by default because a long reasoning floods the console.
  • Send Back Reasoning (new advanced input, on by default): turn it off to send the history without the reasoning. The History output keeps it either way.
  • A response with reasoning but no text now warns that the model probably spent its token budget on reasoning, and suggests raising the max tokens.
  • The OpenAI API itself returns no reasoning on chat completions, only its token count. Its summaries and encrypted reasoning are only available through the Responses API.

📊 Usage stats

  • Prompt cache reads are now shown, including a reported 0. Before, only prompt_tokens_details.cached_tokens was read and a 0 was hidden, so a cache miss looked like a server that does not report its cache. The OpenAI, DeepSeek and Anthropic-style fields are now read, as well as the llama.cpp timings.cache_n counter.
  • Uncached tokens: the tokens your server actually had to process.
  • Cache writes are shown when the server reports them, including the vLLM created_cache_tokens.
  • Content tokens are shown next to the reasoning tokens, so there is no subtraction to do.
  • vLLM needs --enable-prompt-tokens-details and SGLang needs --enable-cache-report to report their cache. On hybrid models (linear attention or Mamba layers), vLLM only caches whole blocks of more than a thousand tokens, so a shorter prompt always shows cache read: 0.

🖥️ Console

  • Every message of the pack starts with [openai-api], followed by the node name, so you can find it among the other custom nodes. The usage stats are now on a single line.

📖 Docs

  • Skipping a request: a new README section explains how to skip a chat completion with the core If/Else Switch node, including the memory loop case where History needs a second switch.
  • The README now says that main is ahead of the registry release, and how to install from it.

⚠️ Upgrade notes

  • Workflows load unchanged: both new inputs are optional and come after the existing ones.
  • With a reasoning model, the history now carries the reasoning and sends it back by default. If your server keeps it in the context, the context grows. Turn Send Back Reasoning off to go back to the 3.3.0 behaviour.
  • Still requires ComfyUI 0.10.0 or later.

🔧 Maintenance

  • Image(s) label: the input label is capitalized. Only the label changed, so existing links are kept.
  • Banner: regenerated at its native size, with the memory loop drawn as a dashed line.
  • The package is declared Operating System :: OS Independent on the registry.
  • requirements.txt is marked as a copy of the pyproject.toml dependencies, for manual installs.

Full Changelog: v3.3.0...v3.4.0