---
source_url: "https://jina.ai/models/ReaderLM-v2/"
title: ReaderLM-v2 - Search Foundation Models
mirrored_at: 2026-08-10T01:00:59.375Z
host: jina.ai
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/jina.ai/models/ReaderLM-v2/index"
---

> **Original source:** https://jina.ai/models/ReaderLM-v2/

Available via

I/O graph 1

HTML

**ReaderLM-v2**

Markdown

I/O graph 2

HTML

**ReaderLM-v2**

Instruction

JSON

I/O graph 3

HTML

**ReaderLM-v2**

Instruction

Markdown

Choose models to compare

ReaderLM-v2

reader-lm-1.5b

_cancel_

Publications (1)

#### Overview

ReaderLM-v2 is a 1.5B parameter language model that converts raw HTML into markdown or JSON, handling up to 512K tokens combined input/output length with support for 29 languages. Unlike its predecessor that treated HTML-to-markdown as a 'selective-copy' task, v2 approaches it as a translation process, enabling superior handling of complex elements like code fences, nested lists, tables, and LaTeX equations. The model maintains consistent performance across varying context lengths and introduces direct HTML-to-JSON generation capabilities with predefined schemas.

#### Methods

Built on Qwen2.5-1.5B-Instruction, ReaderLM-v2's training involved a html-markdown-1m dataset of ten millions HTML documents, averaging 56,000 tokens each. The training process included: 1) long-context pretraining using ring-zag attention and RoPE to expand context from 32K to 256K tokens, 2) supervised fine-tuning with refined datasets, 3) direct preference optimization for output alignment, and 4) self-play reinforcement tuning. Data preparation followed a three-step pipeline (Draft-Refine-Critique) powered by Qwen2.5-32B-Instruction, with specialized models trained for specific tasks before merging via linear parameter interpolation.

#### Performance

In comprehensive benchmarks, ReaderLM-v2 outperforms larger models like Qwen2.5-32B-Instruct and Gemini2-flash-expr on HTML-to-Markdown tasks. For main content extraction, it achieves ROUGE-L of 0.84, Jaro-Winkler of 0.82, and significantly lower Levenshtein distance (0.22) compared to competitors. In HTML-to-JSON tasks, it maintains competitive performance with F1 scores of 0.81 and 98% pass rate. The model processes at 67 tokens/s input and 36 tokens/s output on a T4 GPU, with significantly reduced degeneration issues through contrastive loss training.

#### Best Practice

The model is accessible through a Google Colab notebook demonstrating HTML-to-markdown conversion, JSON extraction, and instruction-following. For HTML-to-Markdown tasks, users can input raw HTML without prefix instructions, while JSON extraction requires specific schema formatting. The create\_prompt helper function facilitates easy prompt creation for both tasks. While the model works on Colab's free T4 GPU tier (requiring vllm and triton), it has limitations without bfloat16 or flash attention 2 support. RTX 3090/4090 is recommended for production use. The model will be available on AWS SageMaker, Azure, and GCP marketplace, licensed under CC BY-NC 4.0 for non-commercial use.

Blogs that mention this model

[

January 15, 2025 • 17 minutes read

ReaderLM v2: Frontier Small Language Model for HTML to Markdown and JSON

ReaderLM-v2 is a 1.5B small language model for HTML-to-Markdown conversion and HTML-to-JSON extraction with exceptional quality.





](https://jina.ai/news/readerlm-v2-frontier-small-language-model-for-html-to-markdown-and-json)[

May 25, 2025 • 21 minutes read

What We Learned at ICLR2025

We collect some most interesting papers in ICLR 2025, featuring TIPS, FlexPrefill, Zero-Shot Rerankers, SVD-LLM, Hymba etc.





](https://jina.ai/news/what-we-learned-at-iclr2025)[

May 07, 2025 • 9 minutes read

Model Soup’s Recipe for Embeddings

Boost robustness and performance with model soups: averaging weights. No extra cost, better results.





](https://jina.ai/news/model-soups-recipe-for-embeddings)[

April 08, 2025 • 21 minutes read

jina-reranker-m0: Multilingual Multimodal Document Reranker

Introducing jina-reranker-m0, our new multilingual multimodal reranker for retrieving visual documents, with SOTA performance on multilingual long documents and code searching tasks.





](https://jina.ai/news/jina-reranker-m0-multilingual-multimodal-document-reranker)[

January 31, 2025 • 14 minutes read

A Practical Guide to Deploying Search Foundation Models in Production

We offer detailed cost and performance breakdowns for three deployment strategies: Jina API, self-hosted K8s, and AWS SageMaker, to help you make the right decision.





](https://jina.ai/news/a-practical-guide-to-deploying-search-foundation-models-in-production)