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] Tokens per chat are not being counted Again #10337
^ This appears only after sending a new message in a chat.
^ This appears if a Cloud Model is selected.
^This is what appears if a local model has not yet been selected or a new message has not been sent in a chat after the model has been loaded.
In this case t he local model was loaded via API but I hadn't yet chatted in Unsloth with the model since it had been loaded. So selecting different chats doesn't show their token counts.
This also makes it hard to choose a model if I am going back to a chat.
In use-chat-model-runtime.ts the status poll only calls refreshContextUsage after setCheckpoint(checkpointId, statusRes.gguf_variant) when !selectedCheckpoint. Reading the code, an API load with a local checkpoint already selected hits that branch and skips the recount, while loadModel's already-resident tail calls refreshContextUsage({ afterModelLoad: true }) unconditionally. I will drop the guard to match loadModel. I have not run a live API load to confirm the context bar behavior.
Fixed! Sorry on the delay. The context bar stayed blank for a saved chat when a cloud model was selected or a model was loaded through the API, and again when you switched back to a chat you had already opened after changing or ejecting the model. The first cases were fixed in #10467 and #9475, and the last one in #13225, so saved chats now show their token count (or a ~estimate when no local model can count it exactly).
To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.
Activity
claxman commentedon Sep 8, 2026
In
use-chat-model-runtime.tsthe status poll only callsrefreshContextUsageaftersetCheckpoint(checkpointId, statusRes.gguf_variant)when!selectedCheckpoint. Reading the code, an API load with a local checkpoint already selected hits that branch and skips the recount, whileloadModel's already-resident tail callsrefreshContextUsage({ afterModelLoad: true })unconditionally. I will drop the guard to matchloadModel. I have not run a live API load to confirm the context bar behavior.danielhanchen commentedon Oct 10, 2026
Fixed! Sorry on the delay. The context bar stayed blank for a saved chat when a cloud model was selected or a model was loaded through the API, and again when you switched back to a chat you had already opened after changing or ejecting the model. The first cases were fixed in #10467 and #9475, and the last one in #13225, so saved chats now show their token count (or a ~estimate when no local model can count it exactly).
To update: Unsloth Desktop will have an update banner. For Studio, use
unsloth studio update. For Docker, usedocker exec <container> unsloth-studio-update. Reopen if it still happens.