chunking-strategy 0.5.0

Two surfaces. One set of names.

The playground is a tab that compares two chunkers on a file you never upload. The library is the same names on disk: N-way compare, a chunker you wrote, streaming, layout PDFs, audio, video. This site is the map. The repo READMEs stay as the long form; you should not need them to get moving.

What the tab will not do

Colleagues often ask for two things that already exist in Python and will not be faked in JavaScript:

Five minutes

  1. Open the lab. Starter text is already fixed_size vs sentence_based. Click a chunk. Drag the divider under the editor if the paste box is too short, or the sidebar divider if the lists feel tight.
  2. pip install chunking-strategy then:
    from chunking_strategy import create_chunker
    result = create_chunker("sentence_based", max_sentences=2).chunk(open("doc.txt").read())
    print(len(result.chunks), result.quality_score)
  3. Need three names on one file?
    chunking-strategy compare doc.txt -s fixed_size,sentence_based,recursive_character
  4. Need a cut this registry does not have? Copy examples/custom_algorithms/ and register it. Details in Bring your own.

How the two surfaces sit

file ─┬─► lab tab ── A | B ── your eyes │ (22 live names, 150 MB, PDF/Word extract) │ └─► pip chunking-strategy create_chunker / CLI / orchestrator N-way compare · custom · stream · media 40+ names, extras, no tab cap

The contract is browser ⊆ python. Every live lab name is a real pip name. Grey names in the dropdowns ship in the library and stay grey until a real JS port exists. The lab will not invent token counts as chars/4, and it will not run semantic until MiniLM actually loads.

Chapters

PageWhen you open it
The labDrop, extract, knobs, share URL (never the file), Find, sidebar width, source height, privacy.
InstallCore vs extras. Skip [all] unless you need torch, OpenCV, and Tika together.
CLI onlyInstall, chunk to JSON, batch a directory, compare, embed. No Python file.
JSONOutput JSON for pipelines, and json_chunker for JSON/JSONL inputs.
ML and embeddingssemantic cuts, embed vectors, lab MiniLM vs pip [ml].
Config and scaleYAML profiles, workers, streaming, directories.
Logs and debugJSON log lines, debug collect, what is in the zip.
StrategiesAll 43 registry names, lab / grey / pip-only. recursive vs recursive_character.
N-way comparecompare table vs benchmark timings, including custom files.
Bring your own@register_chunker, CLI custom, worked examples.
Python APIcreate_chunker, orchestrator, pipeline, adaptive, metrics, streaming.
FormatsWhat the tab extracts vs what pdf_chunker / Tika / media do on disk.

Still only in the repo

Checked against the library public API and CLI. These pages now cover every command people actually run and every name in chunking_strategy.__all__ that is a getting-started surface. Left as runnable files, not extra HTML:

CLI_REFERENCE.md lists hardware --json and debug system-info. Those flags are not in cli.py. Trust these pages and --help.

The long Markdown in the repo (API_REFERENCE.md, DEBUGGING_GUIDE.md, CUSTOM_ALGORITHMS_GUIDE.md, examples/01_*.py) is still there. These pages are the path you read first.

MIT. Lab matches chunking-strategy==0.5.0. Nothing in the playground is uploaded.