Docling/docs/examples
Gabe Goodhart c605edd8e9
feat: OllamaVlmModel for Granite Vision 3.2 (#1337)
* build: Add ollama sdk dependency

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* feat: Add option plumbing for OllamaVlmOptions in pipeline_options

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* feat: Full implementation of OllamaVlmModel

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* feat: Connect "granite_vision_ollama" pipeline option to CLI

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* Revert "build: Add ollama sdk dependency"

After consideration, we're going to use the generic OpenAI API instead
of the Ollama-specific API to avoid duplicate work.

This reverts commit bc6b366468cdd66b52540aac9c7d8b584ab48ad0.

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* refactor: Move OpenAI API call logic into utils.utils

This will allow reuse of this logic in a generic VLM model

NOTE: There is a subtle change here in the ordering of the text prompt and
the image in the call to the OpenAI API. When run against Ollama, this
ordering makes a big difference. If the prompt comes before the image, the
result is terse and not usable whereas the prompt coming after the image
works as expected and matches the non-OpenAI chat API.

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* refactor: Refactor from Ollama SDK to generic OpenAI API

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* fix: Linting, formatting, and bug fixes

The one bug fix was in the timeout arg to openai_image_request. Otherwise,
this is all style changes to get MyPy and black passing cleanly.

Branch: OllamaVlmModel

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>

* remove model from download enum

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* generalize input args for other API providers

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* rename and refactor

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add example

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* require flag for remote services

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* disable example from CI

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add examples to docs

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

---------

Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Co-authored-by: Michele Dolfi <dol@zurich.ibm.com>
2025-04-10 18:03:04 +02:00
..
backend_csv.ipynb feat: Add support for CSV input with new backend to transform CSV files to DoclingDocument (#945) 2025-02-14 08:55:09 +01:00
backend_xml_rag.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
batch_convert.py docs(examples): batch conversion doc raises_on_error (#1147) 2025-03-25 11:14:39 +01:00
custom_convert.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
develop_formula_understanding.py docs: Enrichment models (#1097) 2025-03-04 14:24:38 +01:00
develop_picture_enrichment.py docs: Enrichment models (#1097) 2025-03-04 14:24:38 +01:00
export_figures.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
export_multimodal.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
export_tables.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
full_page_ocr.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
hybrid_chunking.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
index.md docs: add architecture outline (#341) 2024-11-15 12:52:41 +01:00
inspect_picture_content.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
minimal_vlm_pipeline.py feat(SmolDocling): Support MLX acceleration in VLM pipeline (#1199) 2025-03-19 15:38:54 +01:00
minimal.py chore: various minor docs fixes (#169) 2024-10-22 15:29:36 +02:00
pictures_description_api.py docs: Examples for picture descriptions (#951) 2025-02-13 08:33:12 +01:00
pictures_description.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rag_azuresearch.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rag_haystack.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rag_langchain.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rag_llamaindex.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rag_weaviate.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
rapidocr_with_custom_models.py docs: Introduce example with custom models for RapidOCR (#874) 2025-02-04 10:07:00 +01:00
retrieval_qdrant.ipynb chore: move to docling-project org (#1160) 2025-03-14 12:35:29 +01:00
run_md.py feat: Support AsciiDoc and Markdown input format (#168) 2024-10-23 16:14:26 +02:00
run_with_accelerator.py feat: Support cuda:n GPU device allocation (#694) 2025-02-17 11:31:13 +01:00
run_with_formats.py feat: Add support for CSV input with new backend to transform CSV files to DoclingDocument (#945) 2025-02-14 08:55:09 +01:00
tesseract_lang_detection.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
translate.py fix: Test cases for RTL programmatic PDFs and fixes for the formula model (#903) 2025-02-07 08:43:31 +01:00
visual_grounding.ipynb docs: add visual grounding example (#1270) 2025-04-02 14:03:19 +02:00
vlm_pipeline_api_model.py feat: OllamaVlmModel for Granite Vision 3.2 (#1337) 2025-04-10 18:03:04 +02:00