# Repository Briefing: drmingler/docling-api
> Source: https://repoforai.com/repo/drmingler/docling-api (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/drmingler/docling-api
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B (58/100 · Maintenance 12/35 · Adoption 20/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, GPU, API
- **Momentum**: 1,509 ★ total (+0 24h / +0 7d) · 348 forks
- **Topics**: `api`, `fastapi`, `markdown-parser`, `pdf-chatbot`, `pdf-conversion`, `pdf-converter`, `pdf-parser`, `pdf-parsing`, `pdf-to-markdown`
- **When to Use**: Best for: Self-hosted RAG ingestion teams that need a shared HTTP service for parsing mixed document batches, with OCR and trackable background jobs. Skip if: You need a vector database or end-to-end retrieval stack, or a single Python application can call Docling directly without running Redis and Celery workers.

## Overview
```text
### Architecture & Core Mechanics
Docling-api is the document conversion service at the front of a RAG pipeline, not a database or retrieval engine. The Python 3.12 FastAPI application runs at `main:app` under Uvicorn and accepts multipart uploads through `python-multipart`. Docling performs the parsing and Markdown conversion; the API exposes both request/response conversion and asynchronous job submission with status polling.

Celery workers run background jobs, Redis serves as the default broker and result backend, and Flower provides task and worker visibility. `CELERY_BROKER_URL` and `CELERY_RESULT_BACKEND` can be set independently or fall back to `REDIS_HOST`. The root layout separates `document_converter/` from `worker/`, and the local worker entrypoint is `worker.celery_config`. HTTP is the integration boundary; chunking, indexing, and retrieval belong downstream.

### Key Capabilities & Differentiators
Supported inputs include PDF, DOCX, PPTX, HTML, CSV, AsciiDoc, Markdown, and JPG, PNG, TIFF, and BMP images. The conversion pipeline extracts text, tables, and images and supports multilingual OCR, including English, French, German, Spanish, Italian, and Portuguese. Clients can set `image_resolution_scale` from 1 to 4 and use `extract_tables_as_images` when a visual representation of the table is needed.

Single documents and batches are supported in both synchronous and asynchronous modes. For example, `POST /documents/convert` returns a single conversion in the request, while `POST /conversion-jobs` and `POST /batch-conversion-jobs` submit background work. Both modes enforce configurable upload limits, defaulting to 100 MB per file and 500 MB per batch, and return HTTP 413 on oversized uploads. Those limits constrain input size, not conversion time or peak memory.

### Trade-offs & Limitations
Compared with embedding Docling directly in a Python application, this service provides a shared HTTP contract, queued conversion, and worker monitoring. The cost is operating Redis and workers alongside the API. The examples alongside Marker, PyPDF, and PyMuPDF4LLM are useful for inspecting output, but they do not establish an accuracy or throughput ranking. Compare reading order, table structure, and OCR quality on the documents your downstream system will actually ingest.

Use synchronous requests where conversion reliably fits the caller's timeout; queue slower scans and larger batches. CPU mode avoids a GPU runtime dependency, while GPU mode is worth testing when sustained throughput is the bottleneck. Size workers against peak load: concurrent conversions and higher image resolution can increase memory demand, and no fixed VRAM requirement or measured speedup is specified. The MIT license covers the repository code; review dependency and model-artifact terms separately.

### Hardware & Deployment Guide
For a CPU deployment, run `docker compose up --build --scale celery_worker=1`. The default Compose API runs `uvicorn --port 8080 --host 0.0.0.0 main:app` as UID/GID `10001:10001` with `no-new-privileges`, and mounts a named volume at `/models`. For GPU processing, use `docker compose -f docker-compose.gpu.yml up --build --scale celery_worker=3` on a GPU-capable Docker host. Three workers is an example, not a hardware sizing recommendation.

A native setup uses Python 3.12, Poetry, Redis, Uvicorn, and a Celery worker; Flower is optional. Use `/health` for API liveness and `/health/ready` for broker reachability. Neither probe proves that a worker can complete a conversion, so add a representative test job to deployment verification. Restrict network access to Redis and Flower, and check model availability before assuming the service can start in an air-gapped environment. The package manifest lists version `0.1.0`; no GitHub release milestones are listed, so pin a tested commit for repeatable deployments.
```

## Key Capabilities
```text
- API surface: FastAPI exposes synchronous single and batch conversion plus asynchronous jobs with status polling.
- Conversion engine: Docling handles text, tables, images, and multilingual OCR across PDFs, Office files, web documents, and raster images.
- Output controls: `image_resolution_scale` accepts 1–4; `extract_tables_as_images` controls table image extraction.
- Queue configuration: Celery broker and result URLs can be configured separately; both fall back to `REDIS_HOST`.
- Upload limits: Defaults are 100 MB per file and 500 MB per batch, with HTTP 413 on oversized uploads in either execution mode.
- Operational probes: `/health` checks API liveness, `/health/ready` checks broker reachability, and Flower monitors Celery tasks and workers.
```

## Quick Start / Clone
```bash
curl -sSL https://install.python-poetry.org | python3 -
```
