| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Mistral-API compatible document parsing server that converts PDFs, images, and Office documents into clean, formatted Markdown using DeepSeek-OCR.
This project is designed as a drop-in OCR replacement for LLM pipelines (RAG, chatbots, Open WebUI, etc.) that need high-quality extraction from complex documents.
Important: This repository does not ship the model runtime. The Docker Compose setup includes a vLLM container, but you can also point the wrapper at an external vLLM instance if you already run one.
vLLM recipe (DeepSeek-OCR): https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html
Mistral Compatibility
The API structure mirrors Mistral OCR-style endpoints, making integration with existing tools easy.
Smart Hybrid PDF Parsing
Office Support (.docx, .pptx, …)
Converts Office docs to PDF via LibreOffice, then processes the resulting PDF.
High Performance (Async Map-Reduce)
Pages and figure crops are processed concurrently, bounded by a configurable vLLM concurrency limit.
Figure Understanding Detects charts/diagrams, crops them, and asks the Vision model to describe them, inserting the description into the Markdown flow.
Note: The provided Dockerfile already includes LibreOffice and common fonts.
There are two ways to run this:
This starts both services:
Copy and edit the environment file:
cp .env.example .env
# Edit .env (optionally set VLLM_MODEL, CONCURRENT_REQUEST_LIMIT, heuristic knobs, etc.)Notes:
The wrapper talks to vLLM inside the Compose network. compose.yml sets:
Hugging Face cache is persisted:
File storage is persisted:
docker compose up -d --buildView logs:
docker compose logs -fStop:
docker compose downUse this if you already run vLLM elsewhere, want to develop locally, or prefer a venv-based workflow.
This wrapper expects an OpenAI-compatible server at VLLM_BASE_URL (defaults to http://localhost:8000/v1).
uv venv
source .venv/bin/activate
uv pip install -U vllm --torch-backend autovllm serve deepseek-ai/DeepSeek-OCR \
--logits_processors vllm.model_executor.models.deepseek_ocr:NGramPerReqLogitsProcessor \
--no-enable-prefix-caching \
--mm-processor-cache-gb 0Why these flags?
We recommend using uv.
uv syncCopy and edit the environment file:
cp .env.example .env
# Edit .env and set VLLM_BASE_URL (and optionally VLLM_MODEL).env.example (important fields)
uv run uvicorn app:app --host 0.0.0.0 --port 8001 --reloadOpen the Web UI:
This is the main endpoint. It accepts a document object plus optional parsing controls.
Minimal example (remote PDF URL):
curl -X POST "http://localhost:3001/v1/ocr" \
-H "Content-Type: application/json" \
-d '{
"document": {
"type": "document_url",
"document_url": "https://example.com/report.pdf"
},
"pdf_mode": "auto",
"inline_figure_text": true
}'Minimal example (remote image URL):
curl -X POST "http://localhost:3001/v1/ocr" \
-H "Content-Type: application/json" \
-d '{
"document": {
"type": "image_url",
"image_url": {"url": "https://example.com/scan.png"}
}
}'Tip: This server also supports data: URLs (base64-encoded) for document_url and image_url. The built-in web UI uses data: URLs under the hood.
If figure extraction is enabled (default behavior in the UI flow), the pipeline will:
Useful request fields:
Office formats are supported by converting them to PDF using LibreOffice.
If you use Docker, LibreOffice is already included in the image.
Manual install example for Debian/Ubuntu:
sudo apt-get update && sudo apt-get install -y libreofficeIf LibreOffice is missing, Office conversion requests will return an error.
CONCURRENT_REQUEST_LIMIT controls how many requests this server sends to vLLM concurrently.
Higher PDF_TEXT_RENDER_DPI improves OCR quality but increases:
150 DPI is a good starting point; 200–300 may help for small text in scans.
TBD
| Back | FazBrowse Home | New Git URL |