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.0.tar.gz (5.5 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.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sphinx_spladex-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 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.0.tar.gz
Algorithm Hash digest
SHA256 b4f394a2798dc0e9766777d63ef4cf047ccbbf6a9403c3acd82dd15fba1fbb64
MD5 a96e99eea3890a0e43fca788927da60f
BLAKE2b-256 2ae95d9c54fcf43c72bef2146885a64bbfb9ba26d1e5458f90ebac8769b5bb65

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_spladex-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_spladex-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bc5e3eb9f06db0e167b87900fe43c749825bc56e32ae63b204eae966cf378da
MD5 3816395df664b4f1ea2571fc167317bd
BLAKE2b-256 09422e5e634d139ccfa776d5f702e002d2836d092b2fd434be2dba62bedecdd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_spladex-0.1.0-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