Skip to content

Block PrefillDecode LiteRT spikes before dead-end loads - #11

Merged
Nostromo-618 merged 1 commit into
mainfrom
fix/litert-prefilldecode-load
Aug 8, 2026
Merged

Block PrefillDecode LiteRT spikes before dead-end loads#11
Nostromo-618 merged 1 commit into
mainfrom
fix/litert-prefilldecode-load

Conversation

@Nostromo-618

Copy link
Copy Markdown
Member

Summary

  • Root cause: Ministral/Qwen3 .litertlm spikes are PrefillDecode models. Default LiteRT Backend.GPU_ARTISAN always uses streaming ModelAssetsStreaming kTfLitePrefillDecode models is not supported yet. Blob buffering does not help (runtime still streams). Probed Backend.GPU non-streaming createEngine path — still fails with null function on current @litert-lm/core web wasm. Chat sendMessage (non-stream) is irrelevant because load never succeeds.
  • Product fix: Mark spikes litertRuntime: 'prefilldecode-unsupported', block AiChat.load() before download, disable Load with “Runtime unsupported”, show a clear pre-load reason (not just Experimental), keep spikes in the catalog for honesty.
  • UI: Stop duplicating the same error in muted progress text + red banner.
  • Docs/tests: Update spike notes; add unit coverage for PrefillDecode detection, error rewrite, and load block.

Test plan

  • pnpm test -- tests/unit/guardrails.spec.ts (includes PrefillDecode block test)
  • Manual: open AI Chat, select Ministral 3 3B LiteRT — Load button shows Runtime unsupported; no download; single clear message (no red+black duplicate)
  • Manual: select Qwen3 0.6B LiteRT spike — same blocked behavior
  • Manual: select Gemma 4 E2B — Load still works
  • Manual: select WebLLM Tiny (Qwen3 0.6B MLC) — Load still works

Made with Cursor

Probe showed Backend.GPU non-stream create still fails (null function), so keep Qwen3/Ministral spikes visible but disable Load with a clear runtime reason and stop duplicating the error in progress + banner.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kilo-code-bot

kilo-code-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Advisory notes (legacy AiChatUI, not in diff — no inline comments):

  1. _renderCapacityNote (ai-chat.js:~2439) does not suppress capacity warnings for loadBlocked models, unlike the Vue component's refreshCapacityNote. A blocked spike could show a misleading "this device may struggle" note alongside the Runtime unsupported banner.
  2. _renderCacheHint (ai-chat.js:~2204) called for blocked models without clearing the hint text — shows "First load downloads model files from the web" even though load is impossible. The Vue component clears cacheHint for blocked models.
  3. _handleSwitchModel (ai-chat.js:~2551) lacks the loadBlocked early-return that _updateSwitchButtonState already enforces at the button level — a defense-in-depth gap. The Vue component's switchModel has this guard.

The legacy AiChatUI is labeled compat/test-only, so these are low-risk, but worth addressing for consistency.

Files Reviewed (5 files)
  • README.md
  • ai-chat.js - new functions, guards, and legacy UI error dedup
  • doc/vdl-ai-chat.md - spike notes updated
  • src/components/VdlAiChatUI.vue - loadBlocked state, error dedup, UI changes
  • tests/unit/guardrails.spec.ts - PrefillDecode block test

Reviewed by deepseek-v4-pro · Input: 82.6K · Output: 18K · Cached: 803.2K

@Nostromo-618
Nostromo-618 merged commit 1c5802a into main Aug 8, 2026
2 checks passed
@Nostromo-618
Nostromo-618 deleted the fix/litert-prefilldecode-load branch August 11, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant