Instructions to use rbehzadan/ReaderLM-v2.gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use rbehzadan/ReaderLM-v2.gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rbehzadan/ReaderLM-v2.gguf", filename="ReaderLM-v2-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use rbehzadan/ReaderLM-v2.gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf rbehzadan/ReaderLM-v2.gguf:Q4_K_M
Use Docker
docker model run hf.co/rbehzadan/ReaderLM-v2.gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use rbehzadan/ReaderLM-v2.gguf with Ollama:
ollama run hf.co/rbehzadan/ReaderLM-v2.gguf:Q4_K_M
- Unsloth Studio new
How to use rbehzadan/ReaderLM-v2.gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rbehzadan/ReaderLM-v2.gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rbehzadan/ReaderLM-v2.gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rbehzadan/ReaderLM-v2.gguf to start chatting
- Docker Model Runner
How to use rbehzadan/ReaderLM-v2.gguf with Docker Model Runner:
docker model run hf.co/rbehzadan/ReaderLM-v2.gguf:Q4_K_M
- Lemonade
How to use rbehzadan/ReaderLM-v2.gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rbehzadan/ReaderLM-v2.gguf:Q4_K_M
Run and chat with the model
lemonade run user.ReaderLM-v2.gguf-Q4_K_M
List all available models
lemonade list
ReaderLM-v2 GGUF Quantized Models for llama.cpp
This repository contains GGUF quantized versions of the ReaderLM-v2 model by Jina AI. These models are optimized for llama.cpp, making them efficient to run on CPUs and GPUs.
Model Information
ReaderLM-v2 is a 1.5 billion parameter model designed for HTML-to-Markdown and HTML-to-JSON conversion. It supports 29 languages and can handle up to 512,000 tokens in combined input and output length.
The model is useful for extracting structured data from web pages and various NLP applications.
Available Quantized Models
| Model File | Quantization Type | Size | Description |
|---|---|---|---|
ReaderLM-v2-Q4_K_M.gguf |
Q4_K_M | 986MB | Lower precision, optimized for CPU performance |
ReaderLM-v2-Q8_0.gguf |
Q8_0 | 1.6GB | Higher precision, better quality |
These quantized versions balance performance and accuracy, making them suitable for different hardware setups.
Usage
Running the Model with llama.cpp
Clone and build llama.cpp:
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp mkdir build && cd build cmake .. make -j$(nproc)Run the model:
./llama-cli --model ReaderLM-v2-Q4_K_M.gguf --no-conversation --no-display-prompt --temp 0 --prompt '<|im_start|>system Convert the HTML to Markdown. <|im_end|> <|im_start|>user <html><body><h1>Hello, world!</h1></body></html> <|im_end|> <|im_start|>assistant' 2>/dev/nullReplace
ReaderLM-v2-Q4_K_M.ggufwithReaderLM-v2-Q8_0.gguffor better quality at the cost of performance.
Using the Model in Python with llama-cpp-python
pip install llama-cpp-python
model_path = "./models/ReaderLM-v2-Q4_K_M.gguf"
llm = Llama(model_path=model_path, chat_format="chatml")
output = llm.create_chat_completion(
messages = [
{"role": "system", "content": "Convert the HTML to Markdown."},
{
"role": "user",
"content": "<html><body><h1>Hello, world!</h1><p>This is a test!</p></body></html>"
}
],
temperature=0.1,
)
print(output['choices'][0]['message']['content'].strip())
Hardware Requirements
- Q4_K_M (986MB): Runs well on CPUs with 8GB RAM or more
- Q8_0 (1.6GB): Requires 16GB RAM for smooth performance
For GPU acceleration, compile llama.cpp with CUDA support.
Credits
- Original Model: Jina AI - ReaderLM-v2
- Quantization: Performed using llama.cpp
License
This model is released under Creative Commons Attribution-NonCommercial 4.0 (CC-BY-NC-4.0). See LICENSE for details.
Last updated: January 31, 2025
- Downloads last month
- 11
4-bit
8-bit