New npm package for automatic recovery of broken streaming markdown
Remend is a new standalone npm package that intelligently detects and completes unterminated Markdown blocks during token-by-token AI streaming, ensuring clean and stable rendering output. It works as a pre-processor with any Markdown renderer and handles complex edge cases like unclosed fences, incomplete formatting markers, and nested syntax.
is a new standalone package that brings intelligent incomplete Markdown handling to any application.Remend
Previously part of 's Markdown termination logic, Remend is now a standalone library () you can use in any application.Streamdownnpm i remend
AI models stream Markdown token-by-token, which often produces incomplete syntax that breaks rendering. For example:
Without correction, these patterns fail to render, leak raw Markdown, or disrupt layout:
Remend automatically detects and completes unterminated Markdown blocks, ensuring clean, stable output during streaming.
As the stream continues and the actual closing markers arrive, the content seamlessly updates, giving users a polished experience even mid-stream.
It works with any Markdown renderer as a pre-processor. For example:
Remend powers the markdown rendering in Streamdown and has been battle-tested in production AI applications. It includes intelligent rules to avoid false positives and handles complex edge cases like:
To get started, either use it through or install it standalone with:Streamdown
Why it matters
Unclosed fences
Half-finished bold/italic markers
Unterminated links or lists
Mathematical expressions with underscores in LaTeX blocks
Product codes and variable names with asterisks/underscores
List items with formatting markers
Nested brackets in links
Source: original entry ↗
More from Vercel
Follow Vercel to get its new changes in your feed and email digest.
Updates to Hobby and Pro Terms of Service
Vercel is updating Terms of Service for Hobby and Pro customers effective October 19, 2026, clarifying credit policies, managed accounts, auto-renewal practices, and adding statutory cancellation and refund rights for UK and EU consumers, including protections for service changes with negative impact.
Mercury 3 now available on AI Gateway
Inception's Mercury 3 model is now available on Vercel's AI Gateway with 50% launch pricing and generation speeds exceeding 1,000 tokens per second. The model enables parallel text refinement with a 1M-token context window, ideal for real-time applications like browser agents and customer support.
MiniMax M3.1 Flash now available on AI Gateway for free
MiniMax M3.1 Flash, an open-weight multimodal model with 1M-token context window for coding and agentic work, is now available on Vercel's AI Gateway at no cost through October 20. The model excels at complex agent tasks, coding applications, and cybersecurity work, and can be used through multiple APIs and coding agents.