chunktuner

PyPI version Python versions License: MIT CI Docs

Give it your documents. It tries multiple chunking strategies, measures which setup supports retrieval best, and recommends a configuration for your corpus and use case.


What it does

Chunking choices directly affect RAG quality. chunktuner benchmarks strategies (fixed windows, recursive splits, semantic splits, PDF structure, code AST, and more), scores them with retrieval metrics (token recall, MRR, NDCG) and optional generation metrics (RAGAS), then surfaces a winner.

your docs → try multiple strategies → measure each → recommend the best config

chunktuner project flow: documents through strategies, evaluation, to a recommended configuration


Three ways to use it

Interface Best for
Python library Embedding pipelines, custom grids, CI
CLI (chunk-tune) Interactive tuning from the terminal
MCP server Claude Desktop and other MCP hosts

Install

uv (tool)

uv tool install chunktuner

pip

pip install chunktuner

Library only

uv add chunktuner

Where to go next