Chonkie

🦛 CHONK docs with Chonkie ✨ — The lightweight ingestion library for fast, efficient and robust RAG pipelines

Last verified:

Visit Chonkie

What is Chonkie?

Chonkie is a lightweight, fast, and no-nonsense RAG chunking library designed to split texts into semantically meaningful chunks for retrieval-augmented generation pipelines. It provides a complete data ingestion workflow that includes cleaning, chunking, embedding, refining, and storing data all from one library. The library is built with the philosophy that chunking quality drives RAG quality more than any other ETL step, and it optimizes for throughput rather than generality.

Key features include multiple chunking strategies: TokenChunker for fixed-size token chunks, WordChunker for word-based chunks, SentenceChunker for sentence-based chunks, RecursiveChunker for hierarchical splitting, SemanticChunker and SDPMChunker for semantic similarity-based chunking, and LateChunker for experimental embedding-then-split approach. Chonkie supports all major tokenizers including transformers, tokenizers, and tiktoken, and works with Python, JavaScript, and via API. It includes an embeddings refinery that works out-of-the-box with local models and supports API-based embedding providers.

Chonkie is primarily for AI/ML engineers, data scientists, and developers building RAG pipelines and AI applications that require efficient data preparation. It offers both open-source self-hosted options and Chonkie Labs (Context as a Service) with semantic search, AI chat, deep research agents, and MCP deployments. The library is known for its minimal installation size of around 15-21MB compared to 80-171MB for alternatives, and lightning-fast processing speeds with multi-threading optimizations.

Chonkie pricing

Pricing model: Freemium

The core Chonkie library is completely free and open-source under the MIT license. You can install and use it freely in your projects and self-host the chunking capabilities without any cost. Chonkie Labs (Context as a Service) offers usage-based pricing with a free tier sufficient for testing. The cloud service uses a Chonk-As-You-Go model with per-MB pricing starting at $0.06/MB for rule-based and semantic chunkers. Subscription tiers include Growing Hippo at $25/month and Business Chonkie at $500/month, which offer included credits, lower per-MB rates, priority support, and advanced features like on-prem deployment. No minimum contract or commitment is required, and the pricing page is public without requiring contact sales.

Chonkie pros

  • Completely open-source under MIT license with free core library
  • Lightweight with only 15-21MB default install size vs 80-171MB alternatives
  • 33x faster token chunking than popular alternatives like LangChain
  • Multiple chunking strategies: token, word, sentence, recursive, semantic, SDPM, and late chunking
  • Supports all major tokenizers: transformers, tokenizers, and tiktoken
  • Works in Python, JavaScript, and via RESTful API
  • Zero external dependencies for basic functionality
  • Modular dependency system - install only what you need with extras
  • Built-in embeddings refinery with local model support
  • Comprehensive API with FastAPI and interactive Swagger UI
  • Docker deployment option for production-ready setup
  • Chonkie Labs offers managed Context as a Service with no infrastructure to maintain
  • Supports PDFs, Word docs, markdown, and text files in Labs
  • Three semantic search modes: Fast, Balanced, and Deep
  • MCP integration for connecting to Cursor, Claude, and other AI tools
  • Deterministic chunking - same text always returns same chunks
  • OpenAI-compatible endpoints for easy integration

Chonkie cons

  • Semantic chunking requires installing [semantic] extra with additional dependencies
  • API-based embedding providers require separate extras like [openai]
  • Some benchmark numbers may be optimized and real improvements are less than advertised
  • Code chunker requires installing [code] extra separately
  • Local JavaScript version only supports token and recursive chunking, not other chunkers
  • LateChunker is still experimental and not production-ready
  • No OCR included in open-source version, only in Labs
  • Requires managing your own vector database in self-hosted open-source version
  • Learning curve for choosing the right chunking strategy for specific use cases
  • Primarily focused on RAG use cases, less suitable for other NLP tasks

Frequently asked questions about Chonkie

Why is chunking essential for RAG applications?

Chunking is absolutely essential for four main reasons: 1) Limited Context Windows - all models have limits on how much text they can process at once, and chunking breaks down large documents into manageable pieces that fit within these limits. 2) Computational Efficiency - processing entire large documents is computationally expensive due to attention mechanisms, and chunking keeps things efficient and memory-friendly. 3) Better Representation - chunks represent each idea as an independent entity, preventing models from conflating concepts. 4) Reduced Hallucination - feeding too much context at once makes models hallucinate by using irrelevant information, and smaller focused chunks reduce this risk.

What makes Chonkie different from other chunking libraries?

Chonkie is opinionated and designed from first principles based on what makes an ideal chunk: reconstructable, independent, and sufficient. It wins when you process millions of documents because chunking quality drives RAG quality more than any other ETL step, and most framework-bundled splitters are optimized for generality rather than throughput. Chonkie is 4x smaller than competitors with minimal dependencies, lightning-fast with multi-threading optimizations, and provides a modular system where you only install what you need.

Does Chonkie support semantic chunking?

Yes, Chonkie includes both SemanticChunker and SDPMChunker (Semantic Double-Pass Merge) in the [semantic] extra. They use embedding models to cut at topical shifts rather than fixed token counts, creating semantically meaningful chunks. The embeddings refinery works out-of-the-box with local models like minishlab/potion-base-8M, and you only need to add extras like [openai] if planning to use API-based embedding providers.

What chunking strategies does Chonkie provide?

Chonkie provides seven chunking methods: TokenChunker splits text into fixed-size token chunks, WordChunker splits based on words, SentenceChunker splits based on sentences, RecursiveChunker splits hierarchically using customizable rules for semantically meaningful chunks, SemanticChunker splits based on semantic similarity, SDPMChunker uses Semantic Double-Pass Merge approach, and LateChunker (experimental) embeds text first then splits for better chunk embeddings.

How do I get started with Chonkie?

Getting started takes two simple steps: First, install the package with pip install chonkie for basic functionality or pip install "chonkie[all]" for all features. For JavaScript, use npm install @chonkiejs/core for local token and recursive chunking. Second, import your desired chunker like from chonkie import TokenChunker, initialize it with chunker = TokenChunker(), and chunk text with chunks = chunker(text). Each chunk has .text and .token_count attributes you can access.

Can I use Chonkie without self-hosting?

Yes, Chonkie Labs offers Context as a Service which is fully managed. You can upload documents and get instant access to semantic search, AI chat, deep research, and MCP deployments without configuring OCR, managing embeddings, maintaining vector databases, or debugging chunking. Everything is accessible via RESTful APIs and OpenAI-compatible endpoints, and you can create a knowledge base and start searching in minutes with no infrastructure to provision.

What file formats does Chonkie support?

In Chonkie Labs, you can upload PDFs, Word documents, markdown files, and text files. The open-source library focuses on text chunking, so you'll need to handle document parsing separately for non-text formats before passing text to the chunkers. The Library handles the chunking, embedding, and storage logic once you have the text content.

How does Chonkie's API work?

The Chonkie API server runs on port 8000 by default and can be started with chonkie serve command. The [api] extra includes FastAPI and uvicorn. Interactive API documentation is available at http://localhost:8000/docs (Swagger UI) or http://localhost:8000/redoc (ReDoc). Endpoints include token, sentence, recursive, semantic, code chunkers and refineries. You can make POST requests to endpoints like /v1/chunk/token with JSON containing text and chunk_size parameters.

What are the system requirements for Chonkie?

Chonkie has minimal system requirements due to its lightweight design. The default installation is only 15-21MB with zero external dependencies for basic functionality. For Python, you need pip to install the package. For additional features like semantic chunking, you'll need the [semantic] extra which includes embedding model dependencies. The API server requires FastAPI and uvicorn from the [api] extra. Docker is available for production deployment with docker compose up.

How does Chonkie Labs MCP integration work?

Chonkie Labs exposes your knowledge bases as Model Context Protocol (MCP) servers, allowing you to connect them to Cursor, Claude, and other MCP-compatible tools for seamless AI integration. You can install AI Agent Skills via npx skills add chonkie-inc/skills which works with Claude Code, Cursor, Copilot, and 20+ agents. This gives developers instant access to documentation and internal resources directly within their IDEs for contextual AI coding.

Categories

Use cases

Browse all AI tools on NeedAnAI