Markdown Conversion
Markdown ↗ is essential for text generation and large language models (LLMs) in training and inference because it can provide structured, semantic, human, and machine-readable input. Likewise, Markdown facilitates chunking and structuring input data for better retrieval and synthesis in the context of RAGs, and its simplicity and ease of parsing and rendering make it ideal for AI Agents.
For these reasons, document conversion plays an important role when designing and developing AI applications. Workers AI provides the toMarkdown utility method that developers can use from the env.AI binding or the REST APIs for quick, easy, and convenient conversion and summary of documents in multiple formats to Markdown language.
toMarkdown is free for most format conversions. In some cases, like image conversion, it can use Workers AI models for object detection and summarization, which may incur additional costs if it exceeds the Workers AI free allocation limits. Refer to what models we use and the Workers AI pricing page for more details.
- Browser Rendering /markdown REST API supports markdown conversion if you need to render a dynamic page or application in a real browser before converting it.
- Markdown for Agents allows real-time document conversion for Cloudflare zones using content negotiation headers.