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
[Bug] Preset persistence issues, tool reasoning streaming, and GGUF timeout on long-context prefill #5130
Description:
I have been using Unsloth Studio for local inference and have identified three specific bugs that affect the user experience, particularly when attempting to maintain high-context conversations on low-end hardware.
Bug 1: Model Presets and KV Cache Settings Not Persisting on Load
Issue: When loading a model using a saved preset, the context window and KV cache quantization settings are not applied correctly on the initial load.
Behavior: The model defaults to a 4096 context window and F16 KV cache regardless of the saved preset.
Workaround: I must manually re-select the desired context window and KV cache settings in the UI and click "Apply," which triggers a secondary model reload. Only then do the settings persist.
Bug 2: Tool Reasoning Trace Is Not Streaming in UI
Issue: When a model utilizes tools, the reasoning/thought process does not stream live to the UI.
Behavior: Instead of a live trace, the UI displays a static block (e.g., "Thought for 1 seconds") only after the process is complete. This removes the ability to monitor the model's logic during execution.
Bug 3: GGUF Streaming Timeout During Long-Context Prefill
Issue: When resuming a conversation with a very large context (tested at 85.5k tokens out of a 148k limit), the engine fails to resume after a restart due to a timeout error.
Observation: On low-end hardware with slower RAM, the prefill/prompt processing for 80k+ tokens takes longer than the currently hardcoded timeout threshold (appearing to be ~120 seconds). Since the engine is busy during this "silent" prefill phase, the UI/Wrapper assumes a hang and kills the connection.
Request: Implementation of a configurable/infinite timeout or a "Keep Alive" signal during heavy prompt processing to prevent the connection from dropping.
Environment & Hardware (Low-End Hardware Context)
OS: Windows (utilizing 49GB Page File)
GPU: NVIDIA RTX 2060 Super (8GB VRAM)
CPU: AMD Ryzen 5 3600
RAM: 32GB DDR4 @ 2866MHz
Model Used: Gemma 4 26B (A4B Q5_K_M GGUF)
Context Settings: 148k limit with Q8 KV Cache
Additional Context
Despite the hardware constraints, performance once the context is loaded is excellent (averaging 11.7 tps at 85k tokens). The primary bottleneck is the initial connection timeout and the manual "double-load" required for presets.
was able to reproduce Bug 1, will tag here when fix is ready.
Bug 2 is basically whenever the tools are active in a chat the reasoning does not stream and after its done reasoning it just shows the reasoning block and says thought for 1second, regardless if tools are being called or not.
confirmed part of Bug 1 came from preset logic being too coupled to model-specific settings, which contributed to GGUF/runtime settings behaving inconsistently between initial load and reload
I’ve put up a change to narrow presets to reusable generation settings (#5159) and will follow up separately with per-model config to fully address the issue
A quick fix for # 3 is to change the httpx read timeout, but for a currently working install this is in C:\Users\Administrator\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\inference\llama_cpp.py around line 3075, then restart & reload. (see /home/<username>/.unsloth/... on Linux)
Tip: If the timer runs out again but the inference is still visibly running on your cpu/gpu then we can also click the re-gen (recycle) icon and when the inference finally finishes it should still output the full response without restarting.
Activity
Imagineer99 commentedon Apr 22, 2026
thanks for sharing, these seem like real bugs, will investigate.
Imagineer99 commentedon Apr 22, 2026
was able to reproduce Bug 1, will tag here when fix is ready.
shashwata2020 commentedon Apr 23, 2026
Bug 2 is basically whenever the tools are active in a chat the reasoning does not stream and after its done reasoning it just shows the reasoning block and says thought for 1second, regardless if tools are being called or not.
shashwata2020 commentedon Apr 23, 2026
And bug 3 is probably a hardware edge case, cause i dont think its reproducible without very weak hardware.
Imagineer99 commentedon Apr 24, 2026
confirmed part of Bug 1 came from preset logic being too coupled to model-specific settings, which contributed to GGUF/runtime settings behaving inconsistently between initial load and reload
I’ve put up a change to narrow presets to reusable generation settings (#5159) and will follow up separately with per-model config to fully address the issue
will investigate Bug 2 and 3 shortly as well
shashwata2020 commentedon Apr 24, 2026
Thank you very much!
kustomzone commentedon May 11, 2026
A quick fix for # 3 is to change the httpx read timeout, but for a currently working install this is in
C:\Users\Administrator\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\inference\llama_cpp.pyaround line 3075, then restart & reload. (see/home/<username>/.unsloth/...on Linux)Tip: If the timer runs out again but the inference is still visibly running on your cpu/gpu then we can also click the re-gen (recycle) icon and when the inference finally finishes it should still output the full response without restarting.
shashwata2020 commentedon May 11, 2026
Thanks ill give it a try!
shimmyshimmer commentedon Aug 21, 2026
Auto compaction / rolling context window is now available.
Please update to the latest version: https://github.com/unslothai/unsloth/releases/tag/v0.1.801-beta
CC: @shashwata2020