Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Developer releases LLX Markdown streaming renderer for AI chats

AI summary

Developer rsaryev released LLX Markdown, a zero-dependency renderer designed to parse AI chat replies incrementally and repair unfinished Markdown syntax while output is streaming. It adds agent-oriented blocks and supports Mermaid and KaTeX, but does not support remark or rehype plugins. In the developer's benchmark, it completed a 100,000-character reply with 0.25 seconds of total main-thread time, while the scripts were made available for inspection.

In-depth insight

The package targets a common streaming UI problem, but its reported speed advantage and CommonMark and GFM test results are developer claims rather than independently verified results.

I've been building chat UIs for agents and kept running into the same issues with react-markdown: it re-parses the whole reply on every token, so long answers get noticeably slower, and you see raw ** and half-typed [links](htt until the token that closes them arrives. So I wrote my own renderer. It parses incrementally and repairs unfinished syntax while the reply streams: <Markdown streaming={!done}>{text}</Markdown> On a 100k-character reply it takes 0.25 s of main-thread time in total. markdown-to-jsx takes 2.4 s, Streamdown 6.3 s, and react-markdown didn't finish within the 30 s budget. The benchmark scripts are in the repo if you want to check them. The other part is the syntax. Agents often want to show steps, alternatives or pros and cons, and plain Markdown flattens all of that into bullet lists. So on top of GFM I added a few blocks in the same style as GitHub alerts: > [!STEPS] 1. **Back up the database** 2. **Run the migration** There are also tabs, stats, pros/cons, sources, file trees, and Mermaid and KaTeX support. The source still reads fine as plain Markdown when it isn't rendered. The package exports a system-prompt snippet that teaches the model this syntax. It has no dependencies and comes in at 30 KB gzipped. Its parser passes the CommonMark and GFM spec tests. It doesn't support remark/rehype plugins, so if you rely on those, react-markdown is still the better choice. https://github.com/rsaryev/llx-markdown submitted by /u/Awkward-Let-4628 [link] [comments]

#LLX Markdown#react-markdown#markdown-to-jsx#Streamdown#Mermaid#KaTeX

Original · 1 min readRead the original
Group chat

No comments yet. Start the conversation.