llama.cpp/tools/server/webui/src
Pascal 0dbaeaf6c7 webui: incremental MDAST transform caching for streaming performance
Replace full AST re-transformation with per-block caching strategy.
Previously, each streaming chunk triggered processor.run() on the entire
document (12 rehype/remark plugins including KaTeX and highlight.js).

Now transforms individual MDAST nodes and caches results by position hash.
In append-only streaming mode, stable blocks are reused directly from cache,
only the unstable trailing block is re-transformed.

- Add SvelteMap FIFO cache (5000 blocks, evicts oldest 1000 on overflow)
- Add getMdastNodeHash() for MDAST node fingerprinting by position
- Add isAppendMode() to detect streaming append patterns
- Add transformMdastNode() for single-node transformation with cache lookup
- Remove stringifyProcessedNode() (dead code after refactor)

Reduces streaming complexity from O(N × transforms) to O(1) for stable blocks.
Targets 200K token contexts without UI degradation on mobile devices.
2026-02-01 19:44:16 +01:00
..
lib webui: incremental MDAST transform caching for streaming performance 2026-02-01 19:44:16 +01:00
routes webui: apply webui_settings on first load (#18223) 2025-12-23 15:48:03 +01:00
styles feat(webui): improve LaTeX rendering with currency detection (#16508) 2025-11-03 00:41:08 +01:00
app.css feat: Improve Code blocks rendering + add auto scroll + improve global scroll bar behavior 2026-01-26 14:32:40 +01:00
app.d.ts webui: Fix selecting generated output issues during active streaming (#18091) 2025-12-18 11:13:52 +01:00
app.html SvelteKit-based WebUI (#14839) 2025-09-17 19:29:13 +02:00