TokenChunker
Splits text into fixed-size token chunks. Best for maintaining consistent
chunk sizes and working with token-based models.
FastChunker
SIMD-accelerated byte-based chunking at 100+ GB/s. Best for high-throughput
pipelines where byte size limits are acceptable.
SentenceChunker
Splits text at sentence boundaries. Perfect for maintaining semantic
completeness at the sentence level.
RecursiveChunker
Recursively chunks documents into smaller chunks. Best for long documents
with well-defined structure.
SemanticChunker
Groups content based on semantic similarity. Best for preserving context and
topical coherence.
LateChunker
Chunks using Late Chunking algorithm, best for higher recall in your RAG
applications.
CodeChunker
Splits code based on its structure using ASTs. Ideal for chunking source
code files.
TeraflopAIChunker
Segments text using the TeraflopAI Segmentation API. Ideal for
domain-specific segmentation such as legal documents.
NeuralChunker
Uses a fine-tuned BERT model to split text based on semantic shifts. Great
for topic-coherent chunks.
SlumberChunker
Agentic chunking using generative models (LLMs) via the Genie interface for
S-tier chunk quality. 🦛🧞
TableChunker
Splits large markdown tables into smaller, manageable chunks by row,
preserving headers. Great for tabular data in RAG and LLM pipelines.
Availability
Different chunkers are available depending on your installation:| Chunker | Default | embeddings | "chonkie[all]" | Chonkie JS | API Chunking |
|---|---|---|---|---|---|
| TokenChunker | |||||
| FastChunker | |||||
| SentenceChunker | |||||
| RecursiveChunker | |||||
| TableChunker | |||||
| CodeChunker | |||||
| SemanticChunker | |||||
| LateChunker | |||||
| NeuralChunker | |||||
| SlumberChunker |
Common Interface
All chunkers share a consistent interface:Async Support
Every chunker supports async out of the box — no extra setup required.| Method | Async Equivalent | Description |
|---|---|---|
chunk(text) | achunk(text) | Chunk a single text |
chunk_batch(texts) | achunk_batch(texts) | Chunk a list of texts |
chunk_document(doc) | achunk_document(doc) | Chunk a Document object |
Basic Usage
Concurrent Chunking
Useasyncio.gather to chunk multiple texts concurrently:
How It Works
achunkandachunk_batchrun the synchronous methods in a thread pool viaasyncio.to_thread, so CPU-bound chunking does not block your event loop.achunk_documentgoes further: if the document has pre-existing chunks, it dispatches a concurrentasyncio.gatherover all of them.
Because
achunk and achunk_batch use asyncio.to_thread, they are safe to use in async web frameworks (FastAPI, Starlette, aiohttp, etc.) without blocking the event loop.F.A.Q.
Are all the chunkers thread-safe?
Are all the chunkers thread-safe?
Yes, all the chunkers are thread-safe. Though, the performance might vary
since some chunkers use threading under the hood. So, monitor your
performance accordingly.
Do I need to install anything extra for async support?
Do I need to install anything extra for async support?
No. Async support is built into every chunker via
BaseChunker. Any chunker you import from chonkie already has achunk, achunk_batch, and achunk_document available.Does async chunking improve throughput?
Does async chunking improve throughput?
Yes, especially when chunking many texts concurrently.
achunk offloads work to a thread pool, so multiple coroutines can chunk in parallel without blocking the event loop. For single-text chunking the overhead is minimal.Is it safe to share a chunker instance across async tasks?
Is it safe to share a chunker instance across async tasks?
Which async frameworks are supported?
Which async frameworks are supported?
Any framework that uses
asyncio — FastAPI, Starlette, aiohttp, Sanic, Litestar, and others. The async methods use standard asyncio primitives with no framework-specific dependencies.