6.3.1
๐ข Spark NLP 6.3.1: LLM Backend Upgrade and Document Processing Improvements
Spark NLP 6.3.1 focuses on strengthening distributed local LLM inference by upgrading the jsl-llamacpp backend to a newer llama.cpp release, while also delivering important improvements in document structure handling and metadata consistency.
This enables you to use the latest LLMs and embeddings compatible with llama.cpp and perform advanced ingestion of tables and images.
๐ฅ Highlights
- Upgraded
jsl-llamacppbackend tollama.cpptag b7247, bringing upstream performance improvements, stability fixes, and expanded model compatibility for local LLM inference. - Improved
Reader2Xannotator capabilities with structural position metadata for tables and images and integration withAutoGGUFVisionModel- For an exhaustive overview on how to use Spark NLP for unstructured document ingestion, see our blog post Evaluating Document AI Frameworks: Spark NLP vs Unstructured for Large-Scale Text Processing
๐ New Features & Enhancements
LLM Backend Upgrade (llama.cpp)
The jsl-llamacpp backend has been upgraded to llama.cpp tag b7247, applying upstream fixes and enabling the use of the latest LLMs. These benefit distributed LLM workloads in Spark NLP and affects the annotators AutoGGUFModel, AutoGGUFEmbeddings, AutoGGUFVisionModel, AutoGGUFReranker:
- Performance and memory improvements, bug fixes from upstream
llama.cppfor offline LLM inference within Spark NLP pipelines - Better support for newer GGUF/GGML model variants. This means you can now load models such as
gpt-oss,Qwen3andembeddinggemma.
Structural Metadata for Document Readers
Previously, our document parsers (HTMLReader, XMLReader, WordReader, PowerPointReader, ExcelReader) relied heavily on positional or page-based coordinates for layout metadata. However, non-PDF formats such as HTML, XML, DOC(X), PPT(X), and XLS(X) do not have fixed pages To ensure deterministic element referencing and structural traceability across all document types, we needed to adopt a unified DOM-like metadata model.
This change standardizes metadata extraction so every element can be uniquely identified and re-located within its source document, independent of visual layout.
These additions enable layout-aware downstream processing and more precise filtering especially for HTML and rich document formats.
Reader2Image Integration with AutoGGUFVisionModel
Previously, you could use Reader2Image to ingest images from various file formats into Spark NLP. However, processing was limited to Spark NLP native VLM implementations (such as Qwen2VLTransformer).
Reader2Image now supports interoperability with our llama.cpp backend with AutoGGUFVisionModel by introducing flexible handling of encoded vs. decoded image bytes and optional prompt output.
- Added a new boolean parameter
useEncodedImageBytesto control whether the image result stores:true: Encoded (compressed) file bytes for models likeAutoGGUFVisionModelfalse: Decoded pixel matrix for models such asQwen2VLTransformer
- outputPromptColumn parameter to optionally output a separate prompt column containing text prompts as Spark NLP Annotations. This is the required format for
AutoGGUFVisionModel.
Platform Setup Documentation
Added official documentation and instructions for setting up and running Spark NLP on Microsoft Fabric, simplifying configuration and improving developer onboarding on the platform. You can see them at Spark NLP - Installation
๐ Bug Fixes
- Sentence metadata is now consistently included in
DocumentAssembleroutputs when using LightPipeline. - Fixed an issue where resetting the cache in
ResourceDownloadercould fail under certain conditions. - Fixed a document parsing bug where some HTML elements (such as section titles or diagnosis entries) could appear multiple times in the parsed output.
- Improved robustness when loading ONNX
BertEmbeddingsmodels with non-standard output tensor names.
โค๏ธ Community Support
- Slack โ real-time discussion with the Spark NLP community and team
- GitHub โ issue tracking, feature requests, and contributions
- Discussions โ community ideas and showcases
- Medium โ latest Spark NLP articles and tutorials
- YouTube โ educational videos and demos
๐ป Installation
Python
pip install spark-nlp==6.3.1
Spark Packages
CPU
spark-shell --packages com.johnsnowlabs.nlp:spark-nlp_2.12:6.3.1
pyspark --packages com.johnsnowlabs.nlp:spark-nlp_2.12:6.3.1
GPU
spark-shell --packages com.johnsnowlabs.nlp:spark-nlp-gpu_2.12:6.3.1
pyspark --packages com.johnsnowlabs.nlp:spark-nlp-gpu_2.12:6.3.1
Apple Silicon
spark-shell --packages com.johnsnowlabs.nlp:spark-nlp-silicon_2.12:6.3.1
pyspark --packages com.johnsnowlabs.nlp:spark-nlp-silicon_2.12:6.3.1
AArch64
spark-shell --packages com.johnsnowlabs.nlp:spark-nlp-aarch64_2.12:6.3.1
pyspark --packages com.johnsnowlabs.nlp:spark-nlp-aarch64_2.12:6.3.1
Maven
Supported on on Apache Spark 3.x.
spark-nlp
<dependency>
<groupId>com.johnsnowlabs.nlp</groupId>
<artifactId>spark-nlp_2.12</artifactId>
<version>6.3.1</version>
</dependency>
spark-nlp-gpu
<dependency>
<groupId>com.johnsnowlabs.nlp</groupId>
<artifactId>spark-nlp-gpu_2.12</artifactId>
<version>6.3.1</version>
</dependency>
spark-nlp-silicon
<dependency>
<groupId>com.johnsnowlabs.nlp</groupId>
<artifactId>spark-nlp-silicon_2.12</artifactId>
<version>6.3.1</version>
</dependency>
spark-nlp-aarch64
<dependency>
<groupId>com.johnsnowlabs.nlp</groupId>
<artifactId>spark-nlp-aarch64_2.12</artifactId>
<version>6.3.1</version>
</dependency>
FAT JARs
- CPU: https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/jars/spark-nlp-assembly-6.3.1.jar
- GPU: https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/jars/spark-nlp-gpu-assembly-6.3.1.jar
- Apple Silicon: https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/jars/spark-nlp-silicon-assembly-6.3.1.jar
- AArch64: https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/jars/spark-nlp-aarch64-assembly-6.3.1.jar
What's Changed
- https://github.com/JohnSnowLabs/spark-nlp/pull/14705 by @danilojsl
- https://github.com/JohnSnowLabs/spark-nlp/pull/14710 by @danilojsl
- https://github.com/JohnSnowLabs/spark-nlp/pull/14711 by @AbdullahMubeenAnwar
- https://github.com/JohnSnowLabs/spark-nlp/pull/14712 by @mehmetbutgul
- https://github.com/JohnSnowLabs/spark-nlp/pull/14713 by @danilojsl
- https://github.com/JohnSnowLabs/spark-nlp/pull/14714 by @mehmetbutgul
- https://github.com/JohnSnowLabs/spark-nlp/pull/14719 by @DevinTDHa
Full Changelog: https://github.com/JohnSnowLabs/spark-nlp/compare/6.3.0...6.3.1