█

AI/TLDR

मुझे पिलाएं कॉफ़ी
मुझे एक कॉफ़ी पिलाएँ

fastRAG

Intel Labs का रिसर्च फ्रेमवर्क, कुशल RAG पाइपलाइन के लिए, जो Haystack components के रूप में बना है और Intel हार्डवेयर के लिए ट्यून किया गया है

RAG Frameworks & Platformsओपन सोर्स
भाषा
Python
लाइसेंस
Apache-2.0
$pip install fastrag
संक्षेप में

fastRAG क्या है?

fastRAG Intel Labs का रिसर्च फ्रेमवर्क, कुशल RAG पाइपलाइन के लिए, जो Haystack components के रूप में बना है और Intel हार्डवेयर के लिए ट्यून किया गया है. यह Retrieval & Knowledge (RAG) टूल्स की RAG Frameworks & Platforms श्रेणी में आता है; ओपन सोर्स है, Python में लिखा गया है और Apache-2.0 लाइसेंस के तहत है।

सारांश

fastRAG, Intel Labs का एक Python रिसर्च फ्रेमवर्क है, जो कुशल और ऑप्टिमाइज़्ड retrieval-augmented generation (RAG) पाइपलाइन बनाने के लिए बनाया गया है। यह Haystack और Hugging Face पर आधारित है, और fastRAG का हर component पूरी तरह Haystack-compatible है। इसलिए आप fastRAG के retrievers, rankers और generators को standard Haystack parts के साथ मिलाकर पाइपलाइन बना सकते हैं, चाहे Python code में या Haystack के YAML pipeline format में।

इसका फ़ोकस compute efficiency पर है। लाइब्रेरी में RAG-oriented components शामिल हैं, जैसे PLAID indexing engine के साथ ColBERT v2 retrieval, Fusion-in-Decoder और REPLUG। REPLUG कई documents retrieve करता है, हर document को prompt के साथ parallel में चलाता है, और नतीजे में मिली token probabilities को ensemble करता है। इससे LLM की context window से सीमित हुए बिना ज़्यादा documents इस्तेमाल किए जा सकते हैं। इसमें int8-optimized embedders और optimized या sparse cross-encoder rankers भी शामिल हैं।

Diagram of REPLUG: a retriever fetches several documents for the test context, each document is prepended to the input and run through a black-box LM, and the output distributions are ensembled into one prediction
REPLUG runs each retrieved document with the prompt in parallel and combines the token probabilities.fastRAG components overview ↗

जनरेशन की तरफ़, fastRAG Intel Extension for PyTorch, Optimum Intel, ONNX Runtime और OpenVINO के ज़रिए Intel Xeon processors पर LLMs चला सकता है। Intel Gaudi accelerators पर Optimum Habana के ज़रिए, या llama.cpp backend पर भी चला सकता है। Intel ने इस repository को archive कर दिया है: अब यह नए patches स्वीकार नहीं करता और Intel इसकी आगे कोई maintenance नहीं देता, इसलिए जो टीमें इस पर निर्भर हैं, उन्हें अपना fork maintain करने का सुझाव दिया जाता है।

यह क्या करता है

Diagram of ColBERT late interaction: a query encoder and a document encoder produce per-token vectors, MaxSim operations match each query token to document tokens, and the results are summed into a score, with document encoding done offline
ColBERT keeps a vector per token and scores documents with MaxSim late interaction.fastRAG components overview ↗
  • PLAIDDocumentStore और ColBERTRetriever के ज़रिए PLAID engine के साथ ColBERT v2 retrieval, साथ ही IndexUpdater, जिससे मौजूदा index में documents जोड़े और हटाए जा सकें
  • REPLUG ensembling inference (ReplugGenerator) और Fusion-in-Decoder, ताकि एक साथ कई retrieved documents पढ़े जा सकें
  • Intel-optimized LLM backends: Gaudi accelerators, ONNX Runtime या OpenVINO पर quantized models, और एक llama.cpp backend
  • Optimized int8 bi-encoder embedders और optimized या sparse cross-encoder rerankers
  • Haystack-compatible components, Python में या Haystack के YAML format में परिभाषित pipelines, और example notebooks जो PLAID, REPLUG, Gaudi, OpenVINO और prompt compression को कवर करते हैं
  • RAG pipeline chat के लिए Chainlit chat demos, और एक multi-modal ReAct agent जो retrievers के बीच चुनाव करता है

शुरू करें

fastRAG के लिए Python 3.8+ और PyTorch 2.0+ चाहिए। इसे PyPI से इंस्टॉल करें (बेहतर होगा कि एक नए virtual environment में), फिर जिन backends की ज़रूरत हो उनके extras जोड़ें, और repository के clone से Chainlit demos चलाएँ।

fastRAG इंस्टॉल करें

PyPI से package इंस्टॉल करें, या source version के लिए repository clone करके pip install . चलाएँ।

bashbash
pip install fastrag

ज़रूरी extras जोड़ें

Optional extras Intel-optimized backends, document stores और ColBERT/PLAID engine लाते हैं।

bashbash
pip install fastrag[intel]      # Intel optimized backend [Optimum-intel, IPEX]
pip install fastrag[openvino]   # Intel optimized backend using OpenVINO
pip install fastrag[qdrant]     # Support for Qdrant store
pip install fastrag[colbert]    # Support for ColBERT+PLAID; requires FAISS
pip install fastrag[faiss-cpu]  # CPU-based Faiss library

Configs और demos के लिए repo clone करें

Pipeline configs, example notebooks और Chainlit demos repository में हैं, इसलिए उसे clone करें और source से इंस्टॉल करें।

bashbash
git clone https://github.com/IntelLabs/fastRAG.git
cd fastRAG
pip install .

एक सामान्य chat शुरू करें

config/regular_chat.yaml text generation के लिए एक Hugging Face LLM लोड करता है; इसे no-RAG Chainlit app के साथ चलाएँ।

bashbash
CONFIG=config/regular_chat.yaml chainlit run fastrag/ui/chainlit_no_rag.py
The fastRAG chat demo in Chainlit: the chatbot shows a retrieved Forrest Gump poster, the agent describes the image and answers follow-up questions, and a retrieved text document about Jenny's last name is displayed
The Chainlit chat demo answering follow-up questions from a retrieved image and a retrieved document.fastRAG demo docs ↗

RAG pipeline के साथ chat करें

RAG chat को ऐसे config के साथ लॉन्च करें जिसमें वे retrieval tools लिखे हों जिन्हें chat model call कर सकता है, और हर tool एक Haystack YAML pipeline से समर्थित हो।

bashbash
CONFIG=config/rag_pipeline_chat.yaml chainlit run fastrag/ui/chainlit_pipeline.py

Multi-modal agent आज़माएँ

Multi-modal demo ReAct prompting इस्तेमाल करता है, ताकि LLaVA-based agent तय कर सके कि कौन-सा retriever call करना है। examples फ़ोल्डर में मिलने वाली matching notebook इसे चरण-दर-चरण बनाती है।

bashbash
CONFIG=config/visual_chat_agent.yaml chainlit run fastrag/ui/chainlit_multi_modal_agent.py

कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।

कब इस्तेमाल करें

  • ColBERT/PLAID retrieval, Fusion-in-Decoder और REPLUG जैसी कुशल RAG तकनीकों पर रिसर्च करें और उनकी तुलना करें, सब एक ही Haystack pipeline में
  • Intel Xeon CPUs या Intel Gaudi accelerators पर quantized LLMs के साथ RAG pipelines चलाएँ
  • मौजूदा Haystack pipeline में बिना उसे दोबारा लिखे optimized retrievers, rankers या generators जोड़ें
  • ऐसा chat assistant या multi-modal agent प्रोटोटाइप करें जो सवालों के जवाब देने के लिए documents और images retrieve करे
The fastRAG multi-modal ReAct agent in Chainlit reasoning in steps, choosing an imageRetriever tool and then a finishAnswer tool before replying that the image of a man on a bench is from the movie Forrest Gump
The multi-modal agent demo picks a retriever tool, observes the result and composes a final answer.fastRAG demo docs ↗

How fastRAG compares

fastRAG alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.

टूलस्टारयह क्या करता है
Dify★ 162kLLM और RAG ऐप विज़ुअल कैनवास पर बनाने के लिए ओपन सोर्स प्लेटफ़ॉर्म
graphify★ 156kकोड, डॉक्स, PDF और इमेज वाले फ़ोल्डर को एक ऐसे नॉलेज ग्राफ़ में बदलें जिसमें query की जा सके
RAGFlow★ 95.1kगहरी डॉक्यूमेंट समझ और स्रोत से जुड़े, ट्रेस किए जा सकने वाले उद्धरणों वाला ओपन सोर्स RAG engine
Context7★ 65.8kनवीनतम, वर्ज़न-विशिष्ट लाइब्रेरी डॉक्स सीधे आपके कोडिंग एजेंट के प्रॉम्प्ट में
Pathway★ 61.9kडेटा बदलने के साथ-साथ अपडेट रहने वाली Python ETL और RAG पाइपलाइन
LightRAG★ 41kग्राफ़-आधारित RAG, जो आपके दस्तावेज़ों को क्वेरी योग्य नॉलेज ग्राफ़ में बदल देता है
PageIndex★ 40.9kVectorless, reasoning-based RAG जो लंबे डॉक्युमेंट से tree index बनाता है
fastRAG★ 1.8kIntel Labs का रिसर्च फ्रेमवर्क, कुशल RAG पाइपलाइन के लिए, जो Haystack components के रूप में बना है और Intel हार्डवेयर के लिए ट्यून किया गया है