Skip to content

[Bug] Tokens per chat are not being counted Again #10337

Closed

Description

@jimster480

Unsloth
Unsloth Version
v0.1.806-beta
Package Version
2026.9.2
llama.cpp Version
b10798-mix-659e406

Hardware
GPU 0
AMD Radeon PRO W7900 · 45 GiB
GPU 1
AMD Radeon PRO W7500 · 8 GiB
ROCm
7.13.99004

Image ^ This appears only after sending a new message in a chat. Image ^ This appears if a Cloud Model is selected. Image ^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.

Activity

  1. added
    feature request
    on Sep 5, 2026
  2. claxman commented on Sep 8, 2026

    @claxman
    Contributor

    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.

  3. danielhanchen commented on Oct 10, 2026

    @danielhanchen
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfeature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions