LlamaIndex Node Parser Chonkie Integration
This package provides an integration between LlamaIndex and Chonkie, a powerful and flexible chunking library.
Installation
pip install llama-index-node_parser-chonkie
Quick Start
from llama_index.core import Document
from llama_index.node_parser.chonkie import Chunker
# Create a chunker (defaults to 'recursive')
chunker = Chunker(chunk_size=512)
# Create a document
doc = Document(text="Your long text here...")
# Get nodes
nodes = chunker.get_nodes_from_documents([doc])
Supported Chunkers
The Chunker acts as a wrapper for various Chonkie chunking strategies. You can specify the strategy using the chunker parameter:
chunker |
Description |
|---|---|
recursive |
(Default) Recursively splits text based on a hierarchy of separators. |
sentence |
Splits text into sentences. |
token |
Splits text into chunks based on token counts. |
word |
Splits text based on word counts. |
semantic |
Splits text based on semantic similarity. |
late |
Late chunking strategy. |
neural |
Neural-based chunking. |
code |
Optimized for source code. |
fast |
High-performance basic chunking. |
run the following code to see the full list of valid aliases:
from llama_index.node_parser import Chunker
print(Chunker.valid_chunkers)
Advanced Configuration
You can pass any keyword arguments accepted by the underlying Chonkie chunker directly to Chunker:
chunker = Chunker(
chunker="semantic",
chunk_size=512,
embedding_model="all-MiniLM-L6-v2",
threshold=0.5,
)
Integration with Node Parsing
You can use Chunker directly to parse documents into nodes:
from llama_index.core import Document
from llama_index.node_parser.chonkie import Chunker
chunker = Chunker(chunk_size=512)
doc = Document(text="Your long text here...")
nodes = chunker.get_nodes_from_documents([doc])
or you can also use it as a component within the Ingestion pipeline:
from llama_index.core import Document
from llama_index.core.ingestion import IngestionPipeline
from llama_index.node_parser.chonkie import Chunker
pipeline = IngestionPipeline(
transformations=[
Chunker("recursive", chunk_size=512),
# ... other transformations
]
)
nodes = pipeline.run(documents=[Document.example()])
Metadata
Release files for llama-index-node-parser-chonkie 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llama_index_node_parser_chonkie-0.2.0.tar.gz | 6.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_node_parser_chonkie-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / llama_index_node_parser_chonkie-0.2.0.tar.gz
| Download URL | llama_index_node_parser_chonkie-0.2.0.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d8e61d478c4f70b2c74561a204d5663d03d6787c1ed58e471894b09ca593408
|
|
BLAKE2b-256 checksum How to use checksums |
fc925bb43afc0fb1d89caff42b85968edbca4811518a97307aafee84f1a44e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_node_parser_chonkie-0.2.0-py3-none-any.whl
| Download URL | llama_index_node_parser_chonkie-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2823c96c77b7668827ebe457bdc464b4b7a870fd63bf116b6b1cb69072d5c70
|
|
BLAKE2b-256 checksum How to use checksums |
45dcb2da3720ff3b6aa29adcd2a150f00959b33d0c501915c498d5d3cda4973a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-node-parser-chonkie 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.