Instructions to use roboalchemist/ReaderLM-v2-mlx-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use roboalchemist/ReaderLM-v2-mlx-fp16 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("roboalchemist/ReaderLM-v2-mlx-fp16") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use roboalchemist/ReaderLM-v2-mlx-fp16 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "roboalchemist/ReaderLM-v2-mlx-fp16"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "roboalchemist/ReaderLM-v2-mlx-fp16" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roboalchemist/ReaderLM-v2-mlx-fp16", "messages": [ {"role": "user", "content": "Hello"} ] }'
ReaderLM-v2 MLX (Full Precision)
This is a full-precision (bfloat16) MLX conversion of jinaai/ReaderLM-v2, optimized for Apple Silicon.
Model Details
- Original Model: jinaai/ReaderLM-v2
- Parameters: 1.5B
- Precision: bfloat16 (full precision)
- Format: MLX safetensors
- Size: ~2.9GB
Why Full Precision?
While quantized versions (4-bit, 8-bit) exist for faster inference, this full-precision version offers:
- Highest accuracy for HTML-to-markdown conversion
- Best quality for complex document structures
- No quantization artifacts in output
Usage
from mlx_lm import load, generate
model, tokenizer = load("roboalchemist/ReaderLM-v2-mlx-fp16")
html_content = "<html><body><h1>Hello World</h1><p>This is a test.</p></body></html>"
prompt = f"Extract the main content from the following HTML and convert it to Markdown format:\n```html\n{html_content}\n```"
response = generate(model, tokenizer, prompt=prompt, max_tokens=2048)
print(response)
Conversion Details
Converted using:
mlx_lm.convert --hf-path jinaai/ReaderLM-v2 --mlx-path ./ReaderLM-v2-mlx-fp16
License
This model inherits the CC-BY-NC-4.0 license from the original ReaderLM-v2.
Acknowledgments
- Downloads last month
- 14
Model size
2B params
Tensor type
BF16
·
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for roboalchemist/ReaderLM-v2-mlx-fp16
Base model
jinaai/ReaderLM-v2