unsloth/studio/backend
Wasim Yousef Said 50cccfd55e
feat(chat): server-side timings, context display & source hover cards (#4467)
* feat(chat): add server-side timings and context display for GGUF

Extract timings/usage metadata from llama-server SSE stream and forward
through the full stack. Replace client-side estimates with accurate
server-reported metrics (prompt eval, tok/s, token counts, cache hits).
Add context window usage bar to chat top nav.

* feat(chat): source badges with hover cards and 2-row collapse

- Add hover cards to source badges showing favicon, title, URL and
  snippet description on hover
- Limit source badges to 2 rows with +X more expand/collapse
- Parse snippet from web search results for hover card descriptions
- Replace individual Source rendering with grouped SourcesGroup component

* fix(chat): add null guards for server timings edge cases

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(chat): reset contextUsage on thread switch, remove unused context-display

* fix(chat): stop double-counting completion tokens in tool-calling path

* fix(chat): skip metadata events in llm_assist consumers

* fix(chat): hide context usage bar in compare mode

* fix(chat): harden timings pipeline and context usage persistence

Accumulate prompt_ms, predicted_ms, and predicted_n from intermediate
tool-detection passes so the final metadata reflects total server work.
Persist contextUsage in message metadata (Dexie) and restore on thread
load. Add type guard in gguf_stream_chunks for unexpected dict events.
Clear contextUsage when entering compare mode.

* feat(chat): make GGUF stream metadata OpenAI-compatible

* fix(chat): address PR review feedback

* feat(chat): address PR review feedback

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-20 23:42:01 -07:00
..
assets studio: improve onboarding UX, tooltips, and training defaults (#4355) 2026-03-17 07:46:07 -07:00
auth fix: remove old comments (#4292) 2026-03-14 16:50:13 +04:00
core feat(chat): server-side timings, context display & source hover cards (#4467) 2026-03-20 23:42:01 -07:00
loggers Final cleanup 2026-03-12 18:28:04 +00:00
models feat(chat): server-side timings, context display & source hover cards (#4467) 2026-03-20 23:42:01 -07:00
plugins feat(studio): multi-file unstructured seed upload with better backend extraction (#4468) 2026-03-20 13:22:42 -07:00
requirements feat(studio): multi-file unstructured seed upload with better backend extraction (#4468) 2026-03-20 13:22:42 -07:00
routes feat(chat): server-side timings, context display & source hover cards (#4467) 2026-03-20 23:42:01 -07:00
state Final cleanup 2026-03-12 18:28:04 +00:00
tests feat: support GGUF export for non-PEFT models + fix venv_t5 switching for local checkpoints (#4455) 2026-03-20 12:13:18 +04:00
utils feat(chat): server-side timings, context display & source hover cards (#4467) 2026-03-20 23:42:01 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
colab.py Fix Install commands for Windows + 1 line installs (#4447) 2026-03-19 02:09:09 -07:00
main.py studio: web search, KV cache dtype, training progress, inference fixes 2026-03-17 00:30:01 -07:00
run.py Fix Install commands for Windows + 1 line installs (#4447) 2026-03-19 02:09:09 -07:00