rbehzadan/readerlm

By rbehzadan

โ€ขUpdated over 1 year ago

Lightweight API for converting HTML to Markdown using ReaderLM-v2, powered by llama.cpp

Image
Machine learning & AI
Data science
0

884

rbehzadan/readerlm repository overview

โ ReaderLM Markdown Converter (Dockerized)

๐Ÿš€ A lightweight API for converting HTML to Markdown using ReaderLM-v2, powered by llama.cpp.
Supports OpenAI API format, making it easy to integrate into existing applications.

โ ๐Ÿ›  Features

โœ”๏ธ Runs ReaderLM-v2 for HTML-to-Markdown conversion
โœ”๏ธ OpenAI-compatible API (/v1/chat/completions)
โŒ Multi-arch support (linux/amd64, linux/arm64)
โœ”๏ธ Optimized for CPU inference (no GPU required)
โœ”๏ธ No setup requiredโ€”just docker run ๐Ÿš€


โ ๐Ÿ“ฆ Quick Start

โ 1๏ธโƒฃ Run the API Server
docker run -d --name readerlm-server -p 8080:8080 rbehzadan/readerlm:latest

Starts a containerized HTTP API server at http://localhost:8080.

โ 2๏ธโƒฃ Convert HTML to Markdown (API Request)

Send a request using Python:

import requests

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>"}
]

response = requests.post("http://localhost:8080/v1/chat/completions", json={"messages": messages, "temperature": 0.1})
markdown_output = response.json()["choices"][0]["message"]["content"].strip()

print(markdown_output)
โ ๐Ÿ“ Expected Output
# Hello, world!

This is a test!

โ ๐Ÿ›  Build Locally

To build the Docker image manually:

docker build -t readerlm:local .
docker run -p 8080:8080 readerlm:local

โ ๐Ÿ“œ License & Credits


โ ๐Ÿ“ฌ Contact & Support

If you encounter any issues:

Happy coding! ๐Ÿš€

Tag summary

Content type

Image

Digest

sha256:72af914d7โ€ฆ

Size

1.5 GB

Last updated

over 1 year ago

docker pull rbehzadan/readerlm:v0.1.3