FastAPI + RQ + Redis service that runs OCR on PDFs and images using the LightOnOCR-2-1B vision-language model. Jobs are queued, processed by workers, and results are returned as structured JSON that can be converted to Markdown.
1
stars
2
commits
Python
primary language
Feb 5, 2026
updated
FastAPI + RQ + Redis service that runs OCR on PDFs and images using the LightOnOCR-2-1B vision-language model. Jobs are queued, processed by workers, and results are returned as structured JSON that can be converted to Markdown.
POST /process_file (multipart file upload)GET /jobs/{job_id}GET /healthExample:
curl -X POST "http://localhost:8000/process_file" -F "file=@sample.pdf"
pip install -r requirements.txt
.env.example).uvicorn app.main:app --host 0.0.0.0 --port 8000
cd app
rq worker OCR_TASK_QUEUE
docker-compose up --build
Convert OCR JSON output to Markdown:
python -m app.utils.ocr_to_md path/to/ocr.json
Write to a specific file:
python -m app.utils.ocr_to_md path/to/ocr.json -o output.md
REDIS_HOSTREDIS_PORTREDIS_QUEUE_NAMEHF_TOKEN (optional, for Hugging Face access)This project uses the LightOnOCR-2-1B model from Hugging Face, which is described as a flagship OCR model and is licensed under Apache-2.0. The model card and details are available on Hugging Face.
2 commits
Python
94.7%
Dockerfile
5.3%
FastAPI + RQ + Redis service that runs OCR on PDFs and images using the LightOnOCR-2-1B vision-language model. Jobs are queued, processed by workers, and results are returned as structured JSON that can be converted to Markdown.
1
stars
2
commits
Python
primary language
Feb 5, 2026
updated
FastAPI + RQ + Redis service that runs OCR on PDFs and images using the LightOnOCR-2-1B vision-language model. Jobs are queued, processed by workers, and results are returned as structured JSON that can be converted to Markdown.
POST /process_file (multipart file upload)GET /jobs/{job_id}GET /healthExample:
curl -X POST "http://localhost:8000/process_file" -F "file=@sample.pdf"
pip install -r requirements.txt
.env.example).uvicorn app.main:app --host 0.0.0.0 --port 8000
cd app
rq worker OCR_TASK_QUEUE
docker-compose up --build
Convert OCR JSON output to Markdown:
python -m app.utils.ocr_to_md path/to/ocr.json
Write to a specific file:
python -m app.utils.ocr_to_md path/to/ocr.json -o output.md
REDIS_HOSTREDIS_PORTREDIS_QUEUE_NAMEHF_TOKEN (optional, for Hugging Face access)This project uses the LightOnOCR-2-1B model from Hugging Face, which is described as a flagship OCR model and is licensed under Apache-2.0. The model card and details are available on Hugging Face.
2 commits
Python
94.7%
Dockerfile
5.3%