docling separation

This commit is contained in:
Pavel committed 2026-08-27 17:36:38 +04:00
1 parent e101c0a7f1
commit d7a7d4d084
12 files changed
+100 -13

No files matched your search

@@ -96,6 +96,13 @@ To run the DocsGPT backend locally, you'll need to set up a Python environment a
pip install -r application/requirements.txt
```
Optionally add the docling parser engine (OCR, `structured` output for
`read_document`; the default anydoc engine does not need it):
```bash
pip install -r application/requirements-docling.txt
```
5. **Run the Backend:**
For local development, run the ASGI composition under uvicorn. It serves the **whole** application, hot-reloads on source changes, and matches the production runtime:
+1 -1
View File
@@ -206,7 +206,7 @@ for the engines and flows.
| Setting | Default | Description |
| --- | --- | --- |
| `DOC_PARSER_ENGINE` | `anydoc` | Parser engine: `anydoc` (fast Rust converter, no ML models) or `docling` (layout/table models, OCR, structured output; heavy optional install). Files anydoc cannot read fall back to Docling when installed. |
| `DOC_PARSER_ENGINE` | `anydoc` | Parser engine: `anydoc` (fast Rust converter, no ML models) or `docling` (layout/table models, OCR, structured output). Files anydoc cannot read fall back to Docling when installed. Docling is an optional extra: `pip install -r application/requirements-docling.txt`, or Docker builds with `--build-arg INSTALL_DOCLING=true`. |
| `DOCLING_OCR_ENABLED` | `false` | OCR for source ingestion (Docling only). |
| `DOCLING_OCR_ATTACHMENTS_ENABLED` | `false` | OCR for chat attachments (Docling only). |
| `ATTACHMENT_PDF_TEXT_FAST_PATH` | `true` | Under the `docling` engine, read PDF attachments through their text layer (pypdfium2) and only hand scans to Docling. Not needed under `anydoc`. |
+23
View File
@@ -41,6 +41,29 @@ sources, and the fallback for files anydoc rejects. Without Docling those
formats use the standard parsers, and images are only read when
`PARSE_IMAGE_REMOTE=true`.
## Installing the docling engine
docling is not part of the base install. Add it when you need OCR,
`.adoc`/`.vtt`/`.xml` source parsing, or `read_document`'s `structured`
output:
```bash
pip install -r application/requirements-docling.txt
```
Docker images build without it by default; opt in with the build argument:
```bash
docker build --build-arg INSTALL_DOCLING=true ./application
```
`deployment/docker-compose.yaml` forwards the same switch, so setting
`INSTALL_DOCLING=true` in `.env` (or the shell) bakes docling into locally
built backend and worker images. `setup.sh` writes it automatically when you
answer yes to the OCR question. Either way no code changes are needed —
docling is picked up as the fallback engine as soon as it is importable, and
`DOC_PARSER_ENGINE=docling` makes it the primary one.
## Docling OCR
OCR is optional, Docling-only, and controlled by two settings: