Skip to main content

llama-index postprocessor distil integration

Project description

LlamaIndex Postprocessor Integration: Distil

DistilNodePostprocessor reversibly compresses retrieved node text with distil before it reaches the LLM synthesizer.

It runs each node's text through distil's line digest — keeping the head, the tail, and every salient line, and replacing the dropped middle with a single << +N lines, handle=XXXXXXXX >> marker. The original text is written to distil's local handle store, so the exact bytes are recoverable via distil's distil_expand MCP tool or distil.mcp_server.load_restore(handle). Short nodes pass through unchanged.

Installation

pip install llama-index-postprocessor-distil

Usage

from llama_index.postprocessor.distil import DistilNodePostprocessor

postprocessor = DistilNodePostprocessor()

# in a query engine
query_engine = index.as_query_engine(node_postprocessors=[postprocessor])

query_aware (default True) passes the query's terms to distil so lines naming what the query asks for are pinned — this only ever widens the kept set, so it never drops an answer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_postprocessor_distil-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_postprocessor_distil-0.1.0.tar.gz.

File metadata

  • Download URL: llama_index_postprocessor_distil-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llama_index_postprocessor_distil-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a21aa696dabd8e3ff2bd76be32b5b13063dc33461bbc586d3d9db21d06207497
MD5 c69267ba6f42a23f940f403548fecb42
BLAKE2b-256 37bb735ccc90178accb7d6e5dd3897634497d0567baf03361cfb76e05a899f86

See more details on using hashes here.

File details

Details for the file llama_index_postprocessor_distil-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_postprocessor_distil-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llama_index_postprocessor_distil-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6e7ef848533654d17eb1577ef8eeec86c17602bb64480161a0c5bf336399e5f
MD5 f1a9251666e3eb1fbbb858e2bec1acfe
BLAKE2b-256 9ad9a2c14e13ddcd3490622e008ab2956a830bc2fe3dd46ba8356e58187f1b79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page