SuperAPIAI Directory

chopper_demo

github.com · AI developer platforms

Chopper is a small model for RAG (retrieval-augmented generation) context compression, built from mmBERT or Qwen width-sliced models. It reads retrieved passages and keeps only the snippets relevant to the question (exact quotes, no rewriting), thereby reducing the junk tokens that enter the large model's context. The model also has reranking capabilities, supports multi-hop question answering, and provides a browser demo, a Python package, and MCP integration.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Chopper is an AI tool focused on RAG context cleanup, designed to solve the problem of large amounts of irrelevant tokens occupying the context in retrieval-augmented generation. Using a small encoder model (such as mmBERT 0.31B or 0.14B), it reads the question and all retrieved passages in a single pass and marks each word as keep or discard, thereby retaining only the exact quoted snippets relevant to the question.

Main capabilities:

  • Context compression: compresses retrieved passages into snippets of about 100 tokens instead of the full 3000 tokens, reducing the computational burden on the main model.
  • Reranking: in the same pass, the model can also rank passages, with performance close to dedicated rerankers (such as bge-reranker-v2-m3) and comparable speed.
  • Multi-hop question answering support: when facts are missing, the model can generate follow-up questions and retrieve again, supporting multi-hop reasoning.
  • Multilingual support: provides a Polish-specific version (based on pl-ModernBERT-base) that performs better on Polish documents.
  • Integration methods: provides a Python package (chopper-rag) with support for frameworks such as LangChain, LlamaIndex, and Haystack, and can also be used as an MCP tool for Claude.

Usage:

  • Browser demo: no installation required; try the English or Polish demo directly in the browser. It runs the base model (0.31B) by default, and the small model (0.14B) can also be selected.
  • Python integration: install chopper-rag via pip and call it in a RAG pipeline.
  • MCP integration: after installing chopper-rag[mcp], add it as a Claude tool with the command claude mcp add chopper -- chopper-mcp, and you can call chop_passages, chop_files, or rank_passages.
  • Recommended number of retrieved passages: retrieve 8-20 passages for compression, and up to 50 for reranking; for more, process in batches.

Applicable scenarios:

  • RAG systems that need to handle large numbers of retrieval results, especially multi-hop question answering scenarios.
  • Long conversation memory management, reducing redundant information in the context.
  • Multilingual document processing (especially Polish).
  • Applications that want to reduce the main model's computational cost and improve response speed.

Limitations:

  • During compression, the modelmay lose some necessary information, leading to incomplete answers (in some tests, the proportion of answers retaining all hops was slightly lower than with the full context).
  • For scenarios requiring light pruning (such as removing only a small amount of irrelevant content), Chopper may over-compress, losing 6-9 percentage points of accuracy.
  • As a reranker, its performance is slightly inferior to dedicated rerankers (such as XProvence's nDCG@10 0.985 vs 0.974).
  • The tokenizer of the Polish-specific model supports only Polish; for mixed-language text, the mmBERT version is recommended.
  • Some evaluation results are still under submission for review (such as MTEB results).

License: the code and the mmBERT model use the MIT license, permitting commercial use. The Polish model uses Apache 2.0.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools