# quill-of-hermes: LAN OCR that eats PDFs and multi-page TIFFs

*2026-07-30*

> A LAN web service wrapping OvisOCR2 GGUF and llama.cpp — images, PDFs up to 50 pages, and multi-page TIFFs in, Markdown out, with a Hermes skill on top.


OCR as a service usually means cloud APIs, per-page billing, and your documents on someone else's disk. This is the local counterargument: a FastAPI wrapper around [OvisOCR2](https://github.com/01-ai) running GGUF via llama.cpp's `llama-mtmd-cli`, serving your LAN. POST an image, a PDF, or a multi-page TIFF; get back clean Markdown.

The design decisions worth noting: each page is sent to the model independently and results are joined with a horizontal rule, so a 50-page PDF degrades gracefully instead of failing whole. Jobs are serialized to keep the GPU sane, there's a five-minute timeout per page so one bad scan can't wedge the queue, and temp files are cleaned unconditionally. The service deliberately stays separate from llama-swap because multimodal `llama-server` support for this model wasn't proven — `llama-mtmd-cli` was.

Features:

- Accepts PNG/JPEG/WebP, PDF (150 DPI render, up to 50 pages), and multi-page TIFF via ImageMagick
- Returns structured Markdown plus `page_count` and total `elapsed_seconds`
- OpenAI-shape simplicity: single `POST /api/ocr` endpoint, 100 MB upload limit
- Serialized job queue, per-page timeouts, automatic temp-file cleanup
- systemd user service with restart-on-failure; health check at `/health`
- Companion Hermes skill calls the API and *visually verifies* uncertain handwriting, equations, names, and numbers rather than trusting raw output
- LAN-only by design — no auth, so keep it behind your firewall

Source: [github.com/rahlquist/quill-of-hermes](https://github.com/rahlquist/quill-of-hermes) · MIT licensed.

