You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(backends/hf): thinking/answer splitting on the streaming path #1799
area/backendsProvider-specific work: Ollama, HF, LiteLLM, OpenAI, Bedrock, vLLMenhancementNew feature or requestp1High: important bugs (workaround exists) or high-value core features. Do soon, not on fire.
Today <think>...</think> splitting happens on the non-streaming path only; for LocalHFBackend streaming it's skipped, so the reasoning trace leaks inline into result.value. Make streaming split equivalently to non-streaming — populating result.thinking / result.value — including </think> straddling a chunk boundary, prompt-opened <think> (granite-4.2), and truncated reasoning (no </think>).
Why is this feature needed?
Streaming output is inconsistent with LocalHFBackend's own non-streaming path and with the other backends, which already separate reasoning from the answer during streaming (e.g. litellm.py populates mot.thinking incrementally). The non-streaming native + fallback parsing is being added under #1604, which scopes streaming out; this issue tracks that deferred streaming work.
I’d like to take this on. I have a patch for both LocalHFBackend streaming paths that separates reasoning from the answer, including when the closing tag spans chunks. It also preserves literal tags in structured JSON. The targeted Hugging Face suite passed with 222 tests and 10 skips. This complements #1801, which covers non-streaming output. Could a maintainer confirm the scope and assign or route this issue so I can open the PR?
Hi @jeeth-kataria, thanks for the interest! I believe that this work will have to build off of the direction that #1801 goes in, so I think it's best to hold off until it's approved/merged.
area/backendsProvider-specific work: Ollama, HF, LiteLLM, OpenAI, Bedrock, vLLMenhancementNew feature or requestp1High: important bugs (workaround exists) or high-value core features. Do soon, not on fire.
Activity
jeeth-kataria commentedon Nov 20, 2026
I’d like to take this on. I have a patch for both LocalHFBackend streaming paths that separates reasoning from the answer, including when the closing tag spans chunks. It also preserves literal tags in structured JSON. The targeted Hugging Face suite passed with 222 tests and 10 skips. This complements #1801, which covers non-streaming output. Could a maintainer confirm the scope and assign or route this issue so I can open the PR?
rafvasq commentedon Nov 23, 2026
Hi @jeeth-kataria, thanks for the interest! I believe that this work will have to build off of the direction that #1801 goes in, so I think it's best to hold off until it's approved/merged.