Skip to main content

A high-performance static internet index for LLM RAG applications

Project description

llmsearchindex

LLMSearchIndex LLMSearchIndex is a library and search index that provides fully local, internet-scale web search for LLM RAG applications, trained on 203,169,792 web pages sourced from:

This index can be used as external context to significantly improve LLM responses without requiring external API calls at query time.

Demo

You can try out the search at: https://huggingface.co/spaces/zakerytclarke/llmsearchindex demo picture

Installation

pip install llmsearchindex

PyPI: https://pypi.org/project/llmsearchindex/

Model: https://huggingface.co/zakerytclarke/llmindex

Github: https://github.com/zakerytclarke/llmsearchindex

Example Usage:

from llmsearchindex import LLMIndex

# Initializes and downloads index
index = LLMIndex()

# Standard search (Fastest)
results = index.search("who invented sliced bread", top_k=5)

# High-precision search (Reranked)
results = index.search("who invented sliced bread", top_k=5, rerank=True)

for result in results:
  print(result.get('url'))
  print(result.get('text'))
  print(result.get('snippet'))
  print("==="*100)

System requirements

  • ~6 GB RAM
  • ~10 GB disk space
  • CPU inference supported (GPU optional)

Architecture

flowchart LR
    A[User Query] --> B(Embed Sentence Transformers all-MiniLM-L6)
    B --> C(PCA: 384d → 64d)
    C --> D(Binary Quantize)
    X[HuggingFace FineWeb] --> G
    Y[HuggingFace Wikipedia] --> G
    D --> E{FAISS Index}
    E --> G(Fetch Indexed Rows from HuggingFace Server)
    G --> H{Rerank?}
    H -->|Yes| I(Cosine Similarity)
    H -->|No| J[Final Results]
    I --> J
    B -->I

Resources

Embeddings: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2

FAISS Vector search: https://github.com/facebookresearch/faiss

Wikipedia: https://huggingface.co/datasets/wikimedia/wikipedia

FineWeb: https://huggingface.co/datasets/HuggingFaceFW/fineweb

License- MIT License

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

llmsearchindex-1.2.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

llmsearchindex-1.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file llmsearchindex-1.2.0.tar.gz.

File metadata

  • Download URL: llmsearchindex-1.2.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for llmsearchindex-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d35987de7f74ebbdca6ee1f7dd48538168197511841e58a6bbc3b728a2f22a31
MD5 e66144868a36f3782a39a832da857918
BLAKE2b-256 6593142872cd315fee8300e229aa3b6cc0066b86ff0052bdae313a0236d30f25

See more details on using hashes here.

File details

Details for the file llmsearchindex-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: llmsearchindex-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for llmsearchindex-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2fb4d4857e14cedd624867c16b8b69c14895bb4e000f75550fbe13026074e8f
MD5 7a942214142f7cc6c11dc5afdec0fc61
BLAKE2b-256 ae4e87bb3804787046a424e9a1ce695aa901e8bb9425877e4ea67900efcb4a6b

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