mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-12-02 01:53:18 +00:00
b00718bcc9d524088cf88cd1873d581e8499aea5
* upgrade endpoint to docling v2 Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> * fix Containerfile Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Docling Serve
Running Docling as an API service.
Note
This is an unstable draft implementation which will quickly evolve.
Development
Install the dependencies
# Install poetry if not already available
curl -sSL https://install.python-poetry.org | python3 -
# Install dependencies
poetry install
# Run the server
poetry run uvicorn docling_serve.app:app --reload
Example payload (http source):
curl -X 'POST' \
'http://127.0.0.1:8000/convert' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"http_source": {
"url": "https://arxiv.org/pdf/2206.01062"
}
}'
Cuda GPU Support
For GPU support try the following:
# Create a virtual env
python3 -m venv venv
# Activate the venv
source venv/bin/active
# Install torch with the special index
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
# Install the package
pip install -e .
# Run the server
poetry run uvicorn docling_serve.app:app --reload
Languages
Python
93.2%
Makefile
5.1%
Dockerfile
1.7%