{"name":"docling-api: Scalable Document to Markdown Conversion Server","description":"docling-api is a robust and scalable backend server designed for converting a wide array of document formats, including PDFs, DOCX, and images, into Markdown. Built with FastAPI, Celery, and Redis, it supports both CPU and GPU processing, making it ideal for large-scale workflows requiring efficient text, table, and image extraction, along with OCR capabilities. This service offers flexible synchronous and asynchronous API endpoints for single and batch document conversions.","github":"https://github.com/drmingler/docling-api","url":"https://osrepos.com/repo/drmingler-docling-api","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/drmingler-docling-api","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/drmingler-docling-api.md","json":"https://osrepos.com/repo/drmingler-docling-api.json","topics":["Python","API","FastAPI","Markdown Conversion","PDF Parser","Document Processing","OCR","Scalable Backend"],"keywords":["Python","API","FastAPI","Markdown Conversion","PDF Parser","Document Processing","OCR","Scalable Backend"],"stars":null,"summary":"docling-api is a robust and scalable backend server designed for converting a wide array of document formats, including PDFs, DOCX, and images, into Markdown. Built with FastAPI, Celery, and Redis, it supports both CPU and GPU processing, making it ideal for large-scale workflows requiring efficient text, table, and image extraction, along with OCR capabilities. This service offers flexible synchronous and asynchronous API endpoints for single and batch document conversions.","content":"## Introduction\n`docling-api` is an advanced backend server that provides a highly efficient and scalable solution for converting diverse document formats into Markdown. Leveraging IBM's powerful [Docling](https://github.com/DS4SD/docling){:target=\"_blank\"} parser, alongside FastAPI, Celery, and Redis, this service excels at transforming PDFs, DOCX, PPTX, HTML, images, and more into structured Markdown. It supports both CPU and GPU processing modes, with GPU recommended for optimal performance in production, making it perfect for complex, large-scale document processing tasks. The project also highlights its superior parsing capabilities compared to other libraries through visual comparisons.\n\n## Installation\nSetting up `docling-api` is straightforward, whether you prefer a local environment or a Dockerized deployment.\n\n### Local Setup (Prerequisites: Python 3.8+, Poetry, Redis server)\n\n1.  **Install Poetry:**\n    bash\n    curl -sSL https://install.python-poetry.org | python3 -\n    \n\n2.  **Clone and Setup Project:**\n    bash\n    git clone https://github.com/drmingler/docling-api.git\n    cd docling-api\n    poetry install\n    \n\n3.  **Configure Environment:**\n    Create a `.env` file in the project root:\n    bash\n    REDIS_HOST=redis://localhost:6379/0\n    ENV=development\n    \n\n4.  **Start Redis Server:**\n    *   **For MacOS:**\n        bash\n        brew install redis\n        brew services start redis\n        \n    *   **For Ubuntu/Debian:**\n        bash\n        sudo apt-get install redis-server\n        sudo service redis-server start\n        \n\n5.  **Start Application Components:**\n    *   Start FastAPI server:\n        bash\n        poetry run uvicorn main:app --reload --port 8080\n        \n    *   Start Celery worker (new terminal):\n        bash\n        poetry run celery -A worker.celery_config worker --pool=solo -n worker_primary --loglevel=info\n        \n    *   Start Flower dashboard (optional, new terminal):\n        bash\n        poetry run celery -A worker.celery_config flower --port=5555\n        \n\n### Docker Setup\n\n1.  **Clone the repository:**\n    bash\n    git clone https://github.com/drmingler/docling-api.git\n    cd docling-api\n    \n\n2.  **Create a `.env` file:**\n    bash\n    REDIS_HOST=redis://redis:6379/0\n    ENV=production\n    \n\n3.  **CPU Mode:**\n    bash\n    docker-compose -f docker-compose.cpu.yml up --build --scale celery_worker=1\n    \n\n4.  **GPU Mode (Recommended for production):**\n    bash\n    docker-compose -f docker-compose.gpu.yml up --build --scale celery_worker=3\n    \n\n## Examples\nThe `docling-api` provides flexible API endpoints for various conversion needs.\n\n### Synchronous Conversion (Single Document):\nbash\ncurl -X POST \"http://localhost:8080/documents/convert\" \\\n  -H \"accept: application/json\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F \"document=@/path/to/document.pdf\" \\\n  -F \"extract_tables_as_images=true\" \\\n  -F \"image_resolution_scale=4\"\n\n\n### Asynchronous Conversion (Single Document):\n1.  Submit document:\n    bash\n    curl -X POST \"http://localhost:8080/conversion-jobs\" \\\n      -H \"accept: application/json\" \\\n      -H \"Content-Type: multipart/form-data\" \\\n      -F \"document=@/path/to/document.pdf\"\n    \n2.  Check status (replace `{job_id}`):\n    bash\n    curl -X GET \"http://localhost:8080/conversion-jobs/{job_id}\" \\\n      -H \"accept: application/json\"\n    \n\n### Batch Processing (Asynchronous):\nbash\ncurl -X POST \"http://localhost:8080/batch-conversion-jobs\" \\\n  -H \"accept: application/json\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F \"documents=@/path/to/document1.pdf\" \\\n  -F \"documents=@/path/to/document2.pdf\"\n\n\n## Why Use It\n`docling-api` stands out as a powerful solution for document-to-Markdown conversion due to several key advantages:\n*   **Extensive Format Support**: It handles a wide range of inputs, including PDFs, DOCX, PPTX, HTML, various image formats, and more, ensuring broad applicability.\n*   **Advanced Conversion Capabilities**: Beyond basic text extraction, it offers robust table detection and extraction, image processing, and multi-language OCR, providing comprehensive content conversion.\n*   **Scalability and Performance**: Designed for large-scale workflows, it leverages Celery for distributed task processing and supports both CPU and GPU modes, with GPU acceleration significantly boosting performance for demanding tasks.\n*   **Flexible API**: With synchronous, asynchronous, and batch processing endpoints, developers can integrate the service seamlessly into diverse applications, with job tracking for long-running tasks.\n*   **Ease of Deployment**: The project provides clear instructions for both local setup and Docker deployment, simplifying integration into existing infrastructures.\n*   **Quality Output**: Visual comparisons in the repository demonstrate its superior Markdown output quality compared to other parsing libraries.\n\n## Links\n*   GitHub Repository: [https://github.com/drmingler/docling-api](https://github.com/drmingler/docling-api){:target=\"_blank\"}\n*   Docling (IBM's advanced document parser): [https://github.com/DS4SD/docling](https://github.com/DS4SD/docling){:target=\"_blank\"}","metrics":{"detailViews":13,"githubClicks":12},"dates":{"published":null,"modified":"2026-01-30T20:01:27.000Z"}}