Skip to main content

Static hybrid SPLADE and BM25 search for Sphinx documentation.

Project description

Sphinx SpladeX

SpladeX adds static, client-side hybrid search to Sphinx HTML documentation. At build time it extracts pages and documented objects, creates SPLADE sparse vectors plus a BM25 index, and writes assets into _static. At search time the browser loads only those assets: it does not run or download a model.

Install

pip install sphinx-spladex

Development

Install the test and release tools, then run the release check:

pip install -e ".[dev]"
scripts/release-check.sh

Enable

Add the extension to conf.py:

extensions = ["spladex"]

The default model is Arvind0101/static-query-splade-code-docs. The model must include a static_query_weights.pt file containing a one-dimensional query_weights tensor matching the tokenizer vocabulary.

spladex_model_name = "Arvind0101/static-query-splade-code-docs"
spladex_device = "cpu"
spladex_max_length = 256
spladex_top_k_terms = 96
spladex_min_weight = 0.0
spladex_semantic_weight = 0.6
spladex_bm25_weight = 0.4
spladex_rrf_k = 60

After sphinx-build -b html docs docs/_build/html, the generated site includes _static/model_semantic_index.json and _static/model_static_query_assets.json.

SpladeX reads tokenizer.json, tokenizer_config.json, and static_query_weights.pt during the documentation build. It bundles their tokenization rules and aligned weights into the local query-assets file; search never requests those source files or a model from Hugging Face.

SpladeX replaces the standard Sphinx results with semantic hybrid results while retaining the usual Sphinx search-page presentation. It does not show relevance scores or provide a mode switch.

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

sphinx_spladex-0.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

sphinx_spladex-0.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_spladex-0.1.1.tar.gz.

File metadata

  • Download URL: sphinx_spladex-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sphinx_spladex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 61595a5b6db989d1ad4fcde2f9bcff42189b678c4a3019aec31929a529f56c7e
MD5 54817e099b34878f23cd4b8eaff067de
BLAKE2b-256 62ffa036aebf3d377ee65b7f64a950263644bdf1bf7079dcbf21c1a92379e814

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_spladex-0.1.1.tar.gz:

Publisher: publish.yml on arvindajaybharadwaj/sphinx-spladex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_spladex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sphinx_spladex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sphinx_spladex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c0be93997d73b81d3be189605b6502d535795002cf605babf4735a06865ce92
MD5 199ddd81ecb1439b1374680e618035a1
BLAKE2b-256 114f8652b6eee122cbd23c2165cc0c4841342513e8f5a63fc7a7954bab2f812d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_spladex-0.1.1-py3-none-any.whl:

Publisher: publish.yml on arvindajaybharadwaj/sphinx-spladex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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