Explore direct Docling integration
Explore direct docling integration using GraalPy (or something similar).
Some preliminary exploration with GraalPy happened here:
https://github.com/andreaTP/graalpy-build-docling
@Sanne didn't you work with the Graalvm team (or know someone who did) on doing a poc running Docling on Graalvm?
Is this what you were referring to? https://github.com/fniephaus/graalpy-quarkus-summarize
There's also https://www.graalvm.org/python/ and https://github.com/docling-project/docling4j, which was started by @ceberam . Maybe he has some input here too?
@Sanne didn't you work with the Graalvm team (or know someone who did) on doing a poc running Docling on Graalvm?
It wasn't docling, it was https://github.com/microsoft/markitdown - they have a demo in which the entire app and all its dependencies are embedded into a Quarkus application & compiled to native. My understanding is that markitdown and docling are similar tools? I might be wrong, not really used either tool.
(and sorry for the delay in responding!)
@Sanne is this (https://github.com/fniephaus/graalpy-spring-boot-summarize) what you are referring to?
This one:
- https://github.com/fniephaus/graalpy-quarkus-summarize
Thanks!
Research by @galaxyman2424: https://github.com/galaxyman2424/doclingGraalvm/blob/main/DoclingGraalVM%20Technical%20Report.md
Hi,
Below I have linked my repository where I made various attempts at direct integration using GraalVM / GraalPy, as part of a project @edeandrea proposed to myself and some fellow students.
Each folder contains a different environment (gradle, maven, etc), as I tried a few different things to get around some of the dependency issues / conflicts that I encountered. Each attempt has a README explaining more about it and what I encountered. Some of them were early experiments just playing around with GraalVM in general, so those can be ignored.
Didn't end up getting it working, but hopefully this could provide some guidance in the future!
https://github.com/osullc2/GraalVM-Docling-attempts
Hi! I'm one of the students that worked with @edeandrea and @osullc2. Here's my repo: https://github.com/kolya93/docling-java-api
I tried direct Docling integration using GraalPy, focusing on getting Docling installed and running on GraalPy in a WSL2 environment. I confirmed that Docling itself is pure Python with no native extensions, and imports all of PyTorch, but the main challenge was getting PyTorch to compile from source, as no pre-built GraalPy wheel is available for it. The build process was repeatedly killed by the Linux OOM killer due to GraalPy's large JVM memory footprint consuming RAM before the compilation could complete. I was able to make progress by adding a 16GB swapfile and using torch==2.2.1 with PIP_NO_BUILD_ISOLATION=1.
I hope this helps!
Took very long to get back to this but here you have this new experiment: https://github.com/roastedroot/cpython4j Docling integration was the initial use-case and is tested in CI: https://github.com/roastedroot/cpython4j/blob/main/it/src/test/java/io/roastedroot/cpython4j/it/DoclingTest.java
CPython4J dynamically links to any available libpython at runtime rather than targeting a fixed system installation.
Through tight integration with uv, it manages virtual environments, dependency resolution, and even Python installation automatically.
The result: any library that works with standard CPython works here unchanged, with no recompilation and no JVM reimplementation required.