diff --git a/src/docs/_build/doctrees/auto_examples/Basic-RAG/BasicRAG_ingest.doctree b/src/docs/_build/doctrees/auto_examples/Basic-RAG/BasicRAG_ingest.doctree index ba0ccd3..0c115e5 100644 Binary files a/src/docs/_build/doctrees/auto_examples/Basic-RAG/BasicRAG_ingest.doctree and b/src/docs/_build/doctrees/auto_examples/Basic-RAG/BasicRAG_ingest.doctree differ diff --git a/src/docs/_build/doctrees/environment.pickle b/src/docs/_build/doctrees/environment.pickle index f3bc95d..d5c443c 100644 Binary files a/src/docs/_build/doctrees/environment.pickle and b/src/docs/_build/doctrees/environment.pickle differ diff --git a/src/docs/_build/doctrees/get_started.introduction.doctree b/src/docs/_build/doctrees/get_started.introduction.doctree index 3322b98..d5aef06 100644 Binary files a/src/docs/_build/doctrees/get_started.introduction.doctree and b/src/docs/_build/doctrees/get_started.introduction.doctree differ diff --git a/src/docs/_build/doctrees/get_started.llms.doctree b/src/docs/_build/doctrees/get_started.llms.doctree index 1bd180e..a2cbf15 100644 Binary files a/src/docs/_build/doctrees/get_started.llms.doctree and b/src/docs/_build/doctrees/get_started.llms.doctree differ diff --git a/src/docs/_build/doctrees/grag.components.doctree b/src/docs/_build/doctrees/grag.components.doctree index 4560a35..571b5ab 100644 Binary files a/src/docs/_build/doctrees/grag.components.doctree and b/src/docs/_build/doctrees/grag.components.doctree differ diff --git a/src/docs/_build/html/.buildinfo b/src/docs/_build/html/.buildinfo index 8b0c43e..9b90702 100644 --- a/src/docs/_build/html/.buildinfo +++ b/src/docs/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 58797109ea50b041e451aad9460566a5 +config: 4e9c7fafa68d58ea0265316a26496cf3 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/src/docs/_build/html/_downloads/40ffe2716096f331549183db9c0ece72/Retriver-GUI_jupyter.zip b/src/docs/_build/html/_downloads/40ffe2716096f331549183db9c0ece72/Retriver-GUI_jupyter.zip index 3f00138..ff6acc4 100644 Binary files a/src/docs/_build/html/_downloads/40ffe2716096f331549183db9c0ece72/Retriver-GUI_jupyter.zip and b/src/docs/_build/html/_downloads/40ffe2716096f331549183db9c0ece72/Retriver-GUI_jupyter.zip differ diff --git a/src/docs/_build/html/_downloads/7c6daaeaa6e5520da795fa975d498452/Retriver-GUI_python.zip b/src/docs/_build/html/_downloads/7c6daaeaa6e5520da795fa975d498452/Retriver-GUI_python.zip index d681baf..041127f 100644 Binary files a/src/docs/_build/html/_downloads/7c6daaeaa6e5520da795fa975d498452/Retriver-GUI_python.zip and b/src/docs/_build/html/_downloads/7c6daaeaa6e5520da795fa975d498452/Retriver-GUI_python.zip differ diff --git a/src/docs/_build/html/_downloads/c2aaa4bbe39e5912c7fc7f49997b431e/BasicRAG_ingest.ipynb b/src/docs/_build/html/_downloads/c2aaa4bbe39e5912c7fc7f49997b431e/BasicRAG_ingest.ipynb index 1c420ae..6e74a1b 100644 --- a/src/docs/_build/html/_downloads/c2aaa4bbe39e5912c7fc7f49997b431e/BasicRAG_ingest.ipynb +++ b/src/docs/_build/html/_downloads/c2aaa4bbe39e5912c7fc7f49997b431e/BasicRAG_ingest.ipynb @@ -15,7 +15,7 @@ }, "outputs": [], "source": [ - "from grag.components.multivec_retriever import Retriever\nfrom grag.components.vectordb.deeplake_client import DeepLakeClient\n\nclient = DeepLakeClient(collection_name=\"your_collection_name\")\n\n## Alternatively to use Chroma\n# from grag.components.vectordb.chroma_client import ChromaClient\n# client = ChromaClient(collection_name=\"ci_test\")\n\nretriever = Retriever(vectordb=client)\n\ndir_path = \"data/pdf\" # path to pdf files\nretriever.ingest(dir_path)" + "import asyncio\nfrom pathlib import Path\n\nfrom grag.components.multivec_retriever import Retriever\nfrom grag.components.vectordb.deeplake_client import DeepLakeClient\n\nclient = DeepLakeClient(collection_name=\"your_collection_name\")\n\n## Alternatively to use Chroma\n# from grag.components.vectordb.chroma_client import ChromaClient\n# client = ChromaClient(collection_name=\"ci_test\")\n\nSYNC = True # Run synchronously (slow)\nASYNC = True # Run asynchronously \n\nclient = DeepLakeClient(collection_name=\"ci_test\")\n# client = ChromaClient(collection_name=\"ci_test\")\nretriever = Retriever(vectordb=client)\n\ndir_path = Path(__file__).parents[2] / \"data/test/pdfs/new_papers\"\n\nif SYNC:\n retriever.ingest(dir_path)\nelif ASYNC:\n asyncio.run(retriever.aingest(dir_path))" ] } ], diff --git a/src/docs/_build/html/_downloads/d30c8b1c6e4654b2ad3d2a98fac0be74/Basic-RAG_python.zip b/src/docs/_build/html/_downloads/d30c8b1c6e4654b2ad3d2a98fac0be74/Basic-RAG_python.zip index 5a19eae..11dfc62 100644 Binary files a/src/docs/_build/html/_downloads/d30c8b1c6e4654b2ad3d2a98fac0be74/Basic-RAG_python.zip and b/src/docs/_build/html/_downloads/d30c8b1c6e4654b2ad3d2a98fac0be74/Basic-RAG_python.zip differ diff --git a/src/docs/_build/html/_downloads/e2a35b21e1dc8c39446b86fa5ed88dec/BasicRAG_ingest.py b/src/docs/_build/html/_downloads/e2a35b21e1dc8c39446b86fa5ed88dec/BasicRAG_ingest.py index dab5794..3e5f073 100644 --- a/src/docs/_build/html/_downloads/e2a35b21e1dc8c39446b86fa5ed88dec/BasicRAG_ingest.py +++ b/src/docs/_build/html/_downloads/e2a35b21e1dc8c39446b86fa5ed88dec/BasicRAG_ingest.py @@ -3,6 +3,9 @@ This cookbook demonstrates how to ingest documents into a vector database. """ +import asyncio +from pathlib import Path + from grag.components.multivec_retriever import Retriever from grag.components.vectordb.deeplake_client import DeepLakeClient @@ -12,7 +15,16 @@ # from grag.components.vectordb.chroma_client import ChromaClient # client = ChromaClient(collection_name="ci_test") +SYNC = True # Run synchronously (slow) +ASYNC = True # Run asynchronously + +client = DeepLakeClient(collection_name="ci_test") +# client = ChromaClient(collection_name="ci_test") retriever = Retriever(vectordb=client) -dir_path = "data/pdf" # path to pdf files -retriever.ingest(dir_path) +dir_path = Path(__file__).parents[2] / "data/test/pdfs/new_papers" + +if SYNC: + retriever.ingest(dir_path) +elif ASYNC: + asyncio.run(retriever.aingest(dir_path)) diff --git a/src/docs/_build/html/_downloads/f9939c7be8f2cbb228881fcceb9ea19d/Basic-RAG_jupyter.zip b/src/docs/_build/html/_downloads/f9939c7be8f2cbb228881fcceb9ea19d/Basic-RAG_jupyter.zip index ea7b6d0..021f8f7 100644 Binary files a/src/docs/_build/html/_downloads/f9939c7be8f2cbb228881fcceb9ea19d/Basic-RAG_jupyter.zip and b/src/docs/_build/html/_downloads/f9939c7be8f2cbb228881fcceb9ea19d/Basic-RAG_jupyter.zip differ diff --git a/src/docs/_build/html/_sources/auto_examples/Basic-RAG/BasicRAG_ingest.rst.txt b/src/docs/_build/html/_sources/auto_examples/Basic-RAG/BasicRAG_ingest.rst.txt index 05e28a3..8cca4db 100644 --- a/src/docs/_build/html/_sources/auto_examples/Basic-RAG/BasicRAG_ingest.rst.txt +++ b/src/docs/_build/html/_sources/auto_examples/Basic-RAG/BasicRAG_ingest.rst.txt @@ -21,11 +21,14 @@ Document Ingestion ======================= This cookbook demonstrates how to ingest documents into a vector database. -.. GENERATED FROM PYTHON SOURCE LINES 5-19 +.. GENERATED FROM PYTHON SOURCE LINES 5-31 .. code-block:: Python + import asyncio + from pathlib import Path + from grag.components.multivec_retriever import Retriever from grag.components.vectordb.deeplake_client import DeepLakeClient @@ -35,10 +38,19 @@ This cookbook demonstrates how to ingest documents into a vector database. # from grag.components.vectordb.chroma_client import ChromaClient # client = ChromaClient(collection_name="ci_test") + SYNC = True # Run synchronously (slow) + ASYNC = True # Run asynchronously + + client = DeepLakeClient(collection_name="ci_test") + # client = ChromaClient(collection_name="ci_test") retriever = Retriever(vectordb=client) - dir_path = "data/pdf" # path to pdf files - retriever.ingest(dir_path) + dir_path = Path(__file__).parents[2] / "data/test/pdfs/new_papers" + + if SYNC: + retriever.ingest(dir_path) + elif ASYNC: + asyncio.run(retriever.aingest(dir_path)) .. _sphx_glr_download_auto_examples_Basic-RAG_BasicRAG_ingest.py: diff --git a/src/docs/_build/html/_sources/get_started.introduction.rst.txt b/src/docs/_build/html/_sources/get_started.introduction.rst.txt index fbfe17e..2bfccbd 100644 --- a/src/docs/_build/html/_sources/get_started.introduction.rst.txt +++ b/src/docs/_build/html/_sources/get_started.introduction.rst.txt @@ -4,5 +4,4 @@ GRAG Overview GRAG provides an implementation of Retrieval-Augmented Generation that is completely open-sourced. Retrieval-Augmented Generation -################### - +############################### diff --git a/src/docs/_build/html/_sources/get_started.llms.rst.txt b/src/docs/_build/html/_sources/get_started.llms.rst.txt index 5ed47dc..2157fb8 100644 --- a/src/docs/_build/html/_sources/get_started.llms.rst.txt +++ b/src/docs/_build/html/_sources/get_started.llms.rst.txt @@ -1,14 +1,14 @@ LLMs ===== -GRAG offers two ways to run LLMs locally, +GRAG offers two ways to run LLMs locally: 1. LlamaCPP 2. HuggingFace To run LLMs using HuggingFace ############################# -This is the easiest way to get started but does not offer as much +This is the easiest way to get started, but does not offer as much flexibility. If using a config file (*config.ini*), just change the `model_name` to to the HuggingFace repo id. *Note that if the models are gated, make sure to @@ -16,22 +16,22 @@ provide an auth token* To run LLMs using LlamaCPP ############################# -Steps to start with llama.cpp: +LlamaCPP requires models in the form of `.gguf` file. You can either download these model files online, +or -1. Clone the `llama.cpp `_ repository. - ``git clone https://github.com/ggerganov/llama.cpp.git`` -2. Change directory to `llama.cpp` using `cd llama.cpp` -3. To inference using GPU, which is necessary for most models. - * Make sure you have CUDA installed (check using ``nvcc --version``) - * Follow steps from the `llama.cpp documentation `_. +How to quantize models. +************************ +To quantize the model, run: + ``python -m grag.quantize.quantize`` -*Note: While inferencing if model is not utilizing GPU check the `BLAS=1` in the outputs and* -*if it is not then try reinstalling using*:: +After running the above command, user will be prompted with the following: - CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir +1. **Path** where the user wants to clone the `llama.cpp` repo. You can find the repository, `llama.cpp `_. -*or follow the solution provided by* -`this Stack Overflow post `_ +2. Input the **model path**: -How to quantize models. -************************ +* If user wants to download a model from `HuggingFace `_, the user should provide the repository path from HuggingFace. + +* If the user has the model downloaded locally, then user will be instructed to copy the model and input the name of the model directory. + +3.Finally, the user will be prompted to enter **quantization** settings (recommended Q5_K_M or Q4_K_M, etc.). For more details, check `llama.cpp/examples/quantize/quantize.cpp `_. diff --git a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_CustomPrompt.html b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_CustomPrompt.html index 6dc9510..53b533b 100644 --- a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_CustomPrompt.html +++ b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_CustomPrompt.html @@ -136,7 +136,7 @@
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.html b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.html index 4f35525..69a5ba6 100644 --- a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.html +++ b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.html @@ -152,7 +152,7 @@
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_ingest.html b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_ingest.html index cd87a8c..d58bf61 100644 --- a/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_ingest.html +++ b/src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_ingest.html @@ -100,7 +100,10 @@

Document Ingestion

This cookbook demonstrates how to ingest documents into a vector database.

-
from grag.components.multivec_retriever import Retriever
+
import asyncio
+from pathlib import Path
+
+from grag.components.multivec_retriever import Retriever
 from grag.components.vectordb.deeplake_client import DeepLakeClient
 
 client = DeepLakeClient(collection_name="your_collection_name")
@@ -109,10 +112,19 @@
 # from grag.components.vectordb.chroma_client import ChromaClient
 # client = ChromaClient(collection_name="ci_test")
 
+SYNC = True  # Run synchronously (slow)
+ASYNC = True  # Run asynchronously
+
+client = DeepLakeClient(collection_name="ci_test")
+# client = ChromaClient(collection_name="ci_test")
 retriever = Retriever(vectordb=client)
 
-dir_path = "data/pdf"  # path to pdf files
-retriever.ingest(dir_path)
+dir_path = Path(__file__).parents[2] / "data/test/pdfs/new_papers"
+
+if SYNC:
+    retriever.ingest(dir_path)
+elif ASYNC:
+    asyncio.run(retriever.aingest(dir_path))
 
Built with Sphinx using a diff --git a/src/docs/_build/html/genindex.html b/src/docs/_build/html/genindex.html index 25df669..f063296 100644 --- a/src/docs/_build/html/genindex.html +++ b/src/docs/_build/html/genindex.html @@ -796,7 +796,7 @@

V


-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/get_started.html b/src/docs/_build/html/get_started.html index 2796cb2..9086f5e 100644 --- a/src/docs/_build/html/get_started.html +++ b/src/docs/_build/html/get_started.html @@ -115,7 +115,7 @@

Get Started -

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/get_started.installation.html b/src/docs/_build/html/get_started.installation.html index 0a00b80..541c6db 100644 --- a/src/docs/_build/html/get_started.installation.html +++ b/src/docs/_build/html/get_started.installation.html @@ -107,7 +107,7 @@

Installation -

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/get_started.introduction.html b/src/docs/_build/html/get_started.introduction.html index 33ceb8d..49fdab2 100644 --- a/src/docs/_build/html/get_started.introduction.html +++ b/src/docs/_build/html/get_started.introduction.html @@ -24,9 +24,7 @@ - - - + @@ -49,17 +47,8 @@ Built with Sphinx using a diff --git a/src/docs/_build/html/grag.components.html b/src/docs/_build/html/grag.components.html index 85f171d..3621c76 100644 --- a/src/docs/_build/html/grag.components.html +++ b/src/docs/_build/html/grag.components.html @@ -230,7 +230,7 @@

VectorDB

Class for LLM.

-class grag.components.llm.LLM(model_name='Llama-2-13b-chat', device_map='auto', task='text-generation', max_new_tokens='1024', temperature='0.1', n_batch='1024', n_ctx='6000', n_gpu_layers='-1', std_out='True', base_dir='/home/ubuntu/volume_2k/Capstone_5/models', quantization='Q5_K_M', pipeline='llama_cpp')[source]
+class grag.components.llm.LLM(model_name: str = 'Llama-2-13b-chat', device_map: str = 'auto', task: str = 'text-generation', max_new_tokens: str = '1024', temperature: str = '0.1', n_batch: str = '1024', n_ctx: str = '6000', n_gpu_layers: str = '-1', std_out: bool | str = 'True', base_dir: str = '/home/ubuntu/volume_2k/Capstone_5/models', quantization: str = 'Q5_K_M', pipeline: str = 'llama_cpp')[source]

Bases: object

A class for managing and utilizing large language models (LLMs).

@@ -323,7 +323,7 @@

VectorDB
-hf_pipeline(is_local=False)[source]
+hf_pipeline(is_local: bool | None = False)[source]

Loads the model using Hugging Face transformers.

Parameters:
@@ -340,7 +340,7 @@

VectorDB
-load_model(model_name=None, pipeline=None, quantization=None, is_local=None)[source]
+load_model(model_name: str | None = None, pipeline: str | None = None, quantization: str | None = None, is_local: bool | None = None)[source]

Loads the model based on the specified pipeline and model name.

Parameters:
@@ -1367,7 +1367,7 @@

VectorDB
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/grag.components.vectordb.html b/src/docs/_build/html/grag.components.vectordb.html index d180259..dcee302 100644 --- a/src/docs/_build/html/grag.components.vectordb.html +++ b/src/docs/_build/html/grag.components.vectordb.html @@ -512,7 +512,7 @@

Submodules -

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/grag.html b/src/docs/_build/html/grag.html index 3d822e2..ef3683c 100644 --- a/src/docs/_build/html/grag.html +++ b/src/docs/_build/html/grag.html @@ -315,7 +315,7 @@

GRAG<
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/grag.prompts.html b/src/docs/_build/html/grag.prompts.html index 9ed8c43..fb6ef23 100644 --- a/src/docs/_build/html/grag.prompts.html +++ b/src/docs/_build/html/grag.prompts.html @@ -109,7 +109,7 @@

Prompts
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/grag.quantize.html b/src/docs/_build/html/grag.quantize.html index bde000e..41d8807 100644 --- a/src/docs/_build/html/grag.quantize.html +++ b/src/docs/_build/html/grag.quantize.html @@ -183,7 +183,7 @@

Quantize
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/grag.rag.html b/src/docs/_build/html/grag.rag.html index ad99fd1..33e5322 100644 --- a/src/docs/_build/html/grag.rag.html +++ b/src/docs/_build/html/grag.rag.html @@ -249,7 +249,7 @@

Submodules -

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/index.html b/src/docs/_build/html/index.html index 668d4ae..6ae15b6 100644 --- a/src/docs/_build/html/index.html +++ b/src/docs/_build/html/index.html @@ -129,7 +129,7 @@

Indices and tables -

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with
Sphinx using a diff --git a/src/docs/_build/html/modules.html b/src/docs/_build/html/modules.html index b21505b..3c19dbb 100644 --- a/src/docs/_build/html/modules.html +++ b/src/docs/_build/html/modules.html @@ -162,7 +162,7 @@

grag<
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/objects.inv b/src/docs/_build/html/objects.inv index df9f231..cf01369 100644 Binary files a/src/docs/_build/html/objects.inv and b/src/docs/_build/html/objects.inv differ diff --git a/src/docs/_build/html/py-modindex.html b/src/docs/_build/html/py-modindex.html index 3606c41..258cedd 100644 --- a/src/docs/_build/html/py-modindex.html +++ b/src/docs/_build/html/py-modindex.html @@ -195,7 +195,7 @@

Python Module Index


-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/search.html b/src/docs/_build/html/search.html index 5a404e4..aa067d8 100644 --- a/src/docs/_build/html/search.html +++ b/src/docs/_build/html/search.html @@ -98,7 +98,7 @@
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/_build/html/searchindex.js b/src/docs/_build/html/searchindex.js index 6a90c4d..2eb20b5 100644 --- a/src/docs/_build/html/searchindex.js +++ b/src/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["auto_examples/Basic-RAG/BasicRAG_CustomPrompt", "auto_examples/Basic-RAG/BasicRAG_FewShotPrompt", "auto_examples/Basic-RAG/BasicRAG_ingest", "auto_examples/Basic-RAG/BasicRAG_refine", "auto_examples/Basic-RAG/BasicRAG_stuff", "auto_examples/Basic-RAG/index", "auto_examples/Basic-RAG/sg_execution_times", "auto_examples/Retriver-GUI/index", "auto_examples/Retriver-GUI/retriever_app", "auto_examples/Retriver-GUI/sg_execution_times", "auto_examples_index", "get_started", "get_started.installation", "get_started.llms", "get_started.vectordb", "grag", "grag.components", "grag.components.vectordb", "grag.prompts", "grag.quantize", "grag.rag", "index", "modules", "sg_execution_times"], "filenames": ["auto_examples/Basic-RAG/BasicRAG_CustomPrompt.rst", "auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.rst", "auto_examples/Basic-RAG/BasicRAG_ingest.rst", "auto_examples/Basic-RAG/BasicRAG_refine.rst", "auto_examples/Basic-RAG/BasicRAG_stuff.rst", "auto_examples/Basic-RAG/index.rst", "auto_examples/Basic-RAG/sg_execution_times.rst", "auto_examples/Retriver-GUI/index.rst", "auto_examples/Retriver-GUI/retriever_app.rst", "auto_examples/Retriver-GUI/sg_execution_times.rst", "auto_examples_index.rst", "get_started.rst", "get_started.installation.rst", "get_started.llms.rst", "get_started.vectordb.rst", "grag.rst", "grag.components.rst", "grag.components.vectordb.rst", "grag.prompts.rst", "grag.quantize.rst", "grag.rag.rst", "index.rst", "modules.rst", "sg_execution_times.rst"], "titles": ["Custom Prompts", "Custom Few-Shot Prompts", "Document Ingestion", "Refine Chain", "Stuff Chain", "Basic-RAG Cookbooks", "Computation times", "Retriever-GUI Cookbooks", "Retriever GUI", "Computation times", "Cookbooks", "Get Started", "Installation", "LLMs", "Vector Stores", "GRAG", "Components", "VectorDB", "Prompts", "Quantize", "RAG", "Welcome to GRAG\u2019s documentation!", "grag", "Computation times"], "terms": {"go": [0, 1, 2, 3, 4, 8], "end": [0, 1, 2, 3, 4, 8, 21], "download": [0, 1, 2, 3, 4, 5, 7, 8, 19], "full": [0, 1, 2, 3, 4, 8], "exampl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 23], "code": [0, 1, 2, 3, 4, 5, 7, 8], "thi": [0, 1, 2, 3, 4, 8, 13, 14, 16, 17, 20], "cookbook": [0, 1, 2, 3, 4, 8, 21, 23], "demonstr": [0, 1, 2, 3, 4, 5, 7, 8], "how": [0, 1, 2, 3, 4], "us": [0, 1, 2, 3, 4, 5, 7, 8, 11, 14, 16, 17, 19, 20], "basic": [0, 1, 6, 10, 15, 21, 22, 23], "rag": [0, 1, 3, 4, 6, 10, 15, 21, 22, 23], "from": [0, 1, 2, 3, 4, 6, 8, 9, 12, 13, 16, 17, 19, 23], "grag": [0, 1, 2, 3, 4, 8, 13, 16, 17, 19, 20], "compon": [0, 1, 2, 3, 4, 8, 15, 17, 21, 22], "import": [0, 1, 2, 3, 4, 8], "basic_rag": [0, 1, 3, 4, 20], "basicrag": [0, 1, 3, 4, 15, 20, 22], "custom_prompt": [0, 1, 15, 16, 20], "input_kei": [0, 1, 15, 16], "context": [0, 1, 16], "question": [0, 1], "templat": [0, 15, 16], "answer": [0, 1], "follow": [0, 1, 13], "base": [0, 1, 8, 14, 15, 16, 20], "given": [0, 1, 16, 19], "doc_chain": [0, 1, 3, 4, 15, 16, 20], "stuff": [0, 1, 5, 6, 16, 20], "jupyt": [0, 1, 2, 3, 4, 5, 7, 8], "notebook": [0, 1, 2, 3, 4, 5, 7, 8], "basicrag_customprompt": [0, 6, 23], "ipynb": [0, 1, 2, 3, 4, 8], "python": [0, 1, 2, 3, 4, 5, 7, 8, 13, 21], "sourc": [0, 1, 2, 3, 4, 5, 7, 8, 14, 15, 16, 17, 19, 20], "py": [0, 1, 2, 3, 4, 6, 8, 9, 23], "galleri": [0, 1, 2, 3, 4, 5, 7, 8, 23], "gener": [0, 1, 2, 3, 4, 5, 7, 8, 16, 21], "sphinx": [0, 1, 2, 3, 4, 5, 7, 8], "fewshotprompt": [1, 15, 16, 20, 22], "custom_few_shot_prompt": 1, "output_kei": [1, 15, 16], "example_templ": [1, 15, 16], "prefix": [1, 15, 16], "like": [1, 8, 16, 21], "below": [1, 5, 7], "suffix": [1, 15, 16], "what": [1, 8, 14], "i": [1, 5, 7, 8, 13, 14, 16, 17, 19, 21], "name": [1, 8, 15, 16, 17, 20], "largest": 1, "planet": 1, "jupit": 1, "who": 1, "came": 1, "up": [1, 8, 16], "convolut": 1, "neural": 1, "network": 1, "yann": 1, "lecun": 1, "introduc": 1, "basicrag_fewshotprompt": [1, 6, 23], "vector": [2, 11, 16, 17, 21], "databas": [2, 14, 16, 17], "multivec_retriev": [2, 3, 4, 8, 16], "retriev": [2, 3, 4, 9, 10, 14, 15, 20, 21, 22], "vectordb": [2, 3, 4, 8, 14, 15, 22], "deeplake_cli": [2, 3, 4, 17], "deeplakecli": [2, 3, 4, 14, 16, 17], "client": [2, 3, 4, 8, 14, 15, 16], "collection_nam": [2, 3, 4, 8, 16, 17], "your_collection_nam": 2, "altern": 2, "chroma": [2, 8, 15, 16, 21], "chroma_cli": [2, 17], "chromacli": [2, 16, 17], "ci_test": 2, "dir_path": [2, 14, 16], "data": [2, 11, 16, 17], "pdf": [2, 14, 15, 22], "path": [2, 8, 14, 16, 17, 19], "file": [2, 6, 9, 12, 13, 14, 16, 19, 23], "basicrag_ingest": [2, 6, 23], "test": [3, 4, 17], "__name__": [3, 4, 8], "__main__": [3, 4, 8], "while": [3, 4, 13], "true": [3, 4, 8, 16, 17], "queri": [3, 4, 8, 16, 17], "input": [3, 4, 16], "basicrag_refin": [3, 6, 23], "basicrag_stuff": [4, 6, 23], "custom": [5, 6, 12, 16], "prompt": [5, 6, 15, 20, 21, 22], "refin": [5, 6, 16, 20], "chain": [5, 6, 16, 20], "document": [5, 6, 13, 16, 17, 20], "ingest": [5, 6, 11, 15, 16], "few": [5, 6, 16], "shot": [5, 6, 16], "all": [5, 7, 16, 17, 18, 23], "rag_python": 5, "zip": [5, 7], "rag_jupyt": 5, "00": [6, 9, 23], "000": [6, 9], "total": [6, 9, 23], "execut": [6, 9, 16, 23], "5": [6, 23], "auto_exampl": [6, 9], "mem": [6, 9, 23], "mb": [6, 9, 23], "0": [6, 8, 9, 16, 23], "an": [7, 13, 21], "simpl": [7, 8, 21], "streamlit": [7, 8], "retriv": [7, 9], "gui_python": 7, "gui_jupyt": 7, "stremlit": 8, "o": 8, "sy": 8, "pathlib": 8, "st": 8, "insert": 8, "1": [8, 9, 13, 16], "str": [8, 16, 17, 19, 20], "getcwd": 8, "parent": [8, 14, 16], "class": [8, 16, 17, 20], "pagehom": 8, "manag": [8, 16], "home": [8, 16, 17], "page": [8, 16, 20, 21], "interfac": 8, "interact": [8, 19], "web": 8, "applic": 8, "attribut": 8, "app": 8, "The": [8, 16, 17, 19, 21], "instanc": [8, 16, 19], "hold": 8, "def": 8, "__init__": 8, "self": [8, 16, 17], "initi": [8, 16], "arg": 8, "render_sidebar": 8, "render": 8, "sidebar": 8, "option": [8, 16, 19], "session_st": 8, "metadata_toggl": 8, "toggl": 8, "show": [8, 16, 17], "metadata": [8, 16], "top_k": [8, 15, 16, 17], "number_input": 8, "top": [8, 16, 17], "k": 8, "min_valu": 8, "valu": [8, 16], "3": [8, 16], "step": [8, 13], "render_search_form": 8, "search": [8, 16, 21], "form": 8, "return": [8, 16, 17, 19, 20], "state": 8, "button": 8, "markdown": 8, "enter": 8, "search_form": 8, "text_input": 8, "artifici": 8, "intellig": 8, "form_submit_button": 8, "get_search_result": 8, "_queri": 8, "_top_k": 8, "result": [8, 19], "paramet": [8, 16, 17, 19, 20], "number": [8, 16, 17], "A": [8, 16, 17, 19], "list": [8, 16, 17, 20], "score": [8, 16, 17], "get_chunk": [8, 15, 16, 17], "with_scor": [8, 16, 17], "render_search_result": 8, "displai": 8, "spinner": 8, "similar": [8, 16, 17], "chunk": [8, 16, 17], "has_result": 8, "len": 8, "could": 8, "find": [8, 16], "anyth": 8, "write": 8, "enumer": 8, "expand": 8, "f": 8, "bulb": 8, "similiar": 8, "3f": 8, "page_cont": 8, "check_connect": 8, "check": [8, 13], "connect": [8, 16, 17], "backend": 8, "activ": 8, "fals": [8, 16, 17], "otherwis": 8, "respons": 8, "test_connect": [8, 16, 17], "els": [8, 17], "render_stat": 8, "statist": 8, "detail": [8, 16], "about": [8, 16], "n": [8, 16], "host": [8, 14, 16, 17], "address": [8, 17], "port": [8, 14, 16, 17], "collect": [8, 16, 17], "embed": [8, 11, 15, 17, 22], "type": [8, 16, 17, 20], "embedding_typ": [8, 14, 15, 16, 17], "model": [8, 14, 16, 17, 19, 20], "embedding_model": [8, 14, 15, 16, 17], "doc": [8, 16, 17, 20], "count": 8, "green": 8, "red": 8, "lost": 8, "main": 8, "function": [8, 16, 17, 19], "orchestr": 8, "ui": 8, "tab1": 8, "tab2": 8, "tab": 8, "submit": 8, "repres": 8, "system": 8, "set": [8, 16], "titl": 8, "http": [8, 13], "blog": 8, "io": 8, "your": 8, "look": 8, "alik": 8, "semant": 8, "retriever_app": [8, 9], "gui": [9, 10, 21], "instal": [11, 13, 21], "llm": [11, 15, 18, 20, 21, 22], "To": [11, 14], "run": [11, 14, 21], "huggingfac": [11, 14, 16, 19], "llamacpp": [11, 21], "store": [11, 15, 16, 17, 21], "support": [11, 16, 17, 21], "sinc": [12, 14], "we": 12, "ar": [12, 13, 14], "just": [12, 13], "develop": 12, "phase": 12, "have": [12, 13], "publish": 12, "pypi": 12, "yet": 12, "git": [12, 13, 19], "clone": [12, 13, 19], "repositori": [12, 13, 19], "pip": [12, 13], "For": 12, "e": 12, "moreov": 12, "further": 12, "can": [12, 14], "made": 12, "config": [12, 13, 14, 16], "src": [12, 14], "ini": [12, 13, 14, 16], "offer": [13, 21], "two": 13, "wai": [13, 21], "local": [13, 14, 16, 21], "easiest": 13, "get": [13, 16, 21], "start": [13, 16, 21], "doe": [13, 16], "much": 13, "flexibl": 13, "If": [13, 14, 16], "chang": [13, 14], "model_nam": [13, 15, 16, 20], "repo": 13, "id": [13, 16, 19], "note": 13, "gate": 13, "make": [13, 14, 19, 21], "sure": [13, 14], "provid": [13, 14, 16, 17, 18, 20, 21], "auth": 13, "token": [13, 16], "llama": [13, 16, 19], "cpp": [13, 16, 19], "github": 13, "com": 13, "ggerganov": 13, "directori": [13, 16, 19], "cd": 13, "infer": 13, "gpu": [13, 16], "which": [13, 16], "necessari": 13, "most": [13, 16, 17], "you": 13, "cuda": 13, "nvcc": 13, "version": 13, "inferenc": 13, "util": [13, 15, 22], "bla": 13, "output": [13, 16, 17, 20], "try": 13, "reinstal": 13, "cmake_arg": 13, "dllama_cubla": 13, "upgrad": 13, "forc": 13, "cach": 13, "dir": 13, "solut": [13, 21], "stack": 13, "overflow": 13, "post": 13, "explain": 14, "current": [14, 16], "vectorstor": [14, 17], "deeplak": [14, 15, 16, 21], "server": 14, "either": 14, "move": [14, 16], "script": [14, 16], "run_chroma": 14, "sh": 14, "refer": [14, 16], "clientserv": 14, "default": [14, 16, 17, 19, 20], "8000": [14, 17], "under": 14, "argument": [14, 16, 20], "explicitli": 14, "By": 14, "instructor": [14, 16, 17], "xl": [14, 17], "ani": [14, 16, 21], "__file__": 14, "2": [14, 16], "folder": 14, "contain": [14, 16, 18, 19], "submodul": [15, 16, 22], "embedding_funct": [15, 16, 17], "device_map": [15, 16], "task": [15, 16, 20], "max_new_token": [15, 16], "temperatur": [15, 16], "n_batch": [15, 16], "n_ctx": [15, 16], "n_gpu_lay": [15, 16], "hf_pipelin": [15, 16], "llama_cpp": [15, 16], "load_model": [15, 16], "model_path": [15, 16], "store_path": [15, 16, 17], "id_kei": [15, 16], "splitter": [15, 22], "namespac": [15, 16], "aadd_doc": [15, 16, 17], "add_doc": [15, 16, 17], "aget_chunk": [15, 16, 17], "aget_doc": [15, 16], "aingest": [15, 16], "gen_doc_id": [15, 16], "get_doc": [15, 16], "get_docs_from_chunk": [15, 16], "id_gen": [15, 16], "split_doc": [15, 16], "pars": [15, 22], "parsepdf": [15, 16, 22], "single_text_out": [15, 16], "strategi": [15, 16], "extract_image_block_typ": [15, 16], "infer_table_structur": [15, 16], "extract_imag": [15, 16], "image_output_dir": [15, 16], "add_captions_to_text": [15, 16], "add_captions_to_block": [15, 16], "add_caption_first": [15, 16], "classifi": [15, 16], "load_fil": [15, 16], "partit": [15, 16], "process_imag": [15, 16], "process_t": [15, 16], "process_text": [15, 16], "text_concat": [15, 16], "llm_type": [15, 16], "languag": [15, 16], "filepath": [15, 16], "model_computed_field": [15, 16], "model_config": [15, 16], "model_field": [15, 16], "validate_exampl": [15, 16], "validate_output_kei": [15, 16], "format": [15, 16, 20], "load": [15, 16], "save": [15, 16, 19], "validate_doc_chain": [15, 16], "validate_input_kei": [15, 16], "validate_task": [15, 16], "text": [15, 22], "textsplitt": [15, 16, 22], "chunk_siz": [15, 16], "chunk_overlap": [15, 16], "text_splitt": [15, 16], "find_config_path": [15, 16, 22], "get_config": [15, 16, 22], "stuff_doc": [15, 16, 20, 22], "quantiz": [15, 16, 21, 22], "building_llamacpp": [15, 19, 22], "fetch_model_repo": [15, 19, 22], "get_llamacpp_repo": [15, 19, 22], "quantize_model": [15, 19, 22], "llm_kwarg": [15, 20], "retriever_kwarg": [15, 20], "output_pars": [15, 20], "prompt_match": [15, 20], "refine_cal": [15, 20], "stuff_cal": [15, 20], "delet": [16, 17], "langchain_cli": [16, 17], "object": [16, 20], "sentenc": [16, 17], "transform": [16, 17], "model_typ": 16, "abov": 16, "langchain": [16, 17], "13b": 16, "chat": 16, "auto": 16, "1024": 16, "6000": 16, "std_out": 16, "base_dir": 16, "ubuntu": [16, 17], "volume_2k": [16, 17], "capstone_5": [16, 17], "q5_k_m": 16, "pipelin": 16, "larg": 16, "devic": 16, "map": 16, "dict": [16, 20], "being": 16, "maximum": 16, "new": 16, "int": [16, 17], "sampl": 16, "float": [16, 17], "batch": 16, "size": 16, "layer": 16, "is_loc": 16, "hug": 16, "face": 16, "bool": [16, 17], "whether": 16, "none": [16, 17, 19, 20], "specifi": [16, 19], "f16": 16, "etc": 16, "properti": [16, 20], "doc_id": 16, "8c9040b0b5cd4d7cbc2e737da1b24ebf": 16, "client_kwarg": 16, "multi": 16, "It": [16, 21], "ha": 16, "addit": 16, "link": 16, "kei": 16, "identifi": 16, "storag": 16, "localfilestor": 16, "pair": 16, "multi_vector": 16, "multivectorretriev": 16, "": 16, "produc": 16, "uniqu": 16, "async": [16, 17], "add": [16, 17], "also": [16, 21], "langchain_cor": [16, 20], "cosin": [16, 17], "asynchron": [16, 17], "string": [16, 17, 20], "glob_pattern": 16, "dry_run": 16, "verbos": [16, 17], "parser_kwarg": 16, "glob": 16, "pattern": 16, "progress": [16, 17], "pass": 16, "parser": 16, "take": 16, "method": 16, "more": 16, "hexadecim": 16, "uuid": 16, "one_to_on": 16, "each": [16, 17], "uuid5": 16, "ensur": 16, "singl": [16, 17], "alwai": 16, "same": 16, "split": 16, "them": 16, "smaller": 16, "after": 16, "parse_pdf": 16, "hi_r": 16, "table_as_html": 16, "tabl": 16, "imag": 16, "element": 16, "combin": 16, "better": 16, "accuraci": 16, "extract": 16, "block": 16, "dure": 16, "includ": 16, "figur": 16, "caption": 16, "place": 16, "befor": 16, "correspond": [16, 17], "dictionari": 16, "avail": 16, "its": 16, "process": 16, "configur": 16, "handl": 16, "awar": 16, "concaten": [16, 20], "qa": [16, 20], "nosourc": 16, "en": 16, "prompttempl": 16, "llama2": 16, "respect": 16, "classvar": 16, "computedfieldinfo": 16, "comput": 16, "field": 16, "configdict": 16, "should": [16, 17, 19], "conform": 16, "pydant": 16, "fieldinfo": 16, "annot": 16, "requir": 16, "union": 16, "nonetyp": 16, "exclud": 16, "repr": 16, "defin": 16, "replac": 16, "__fields__": 16, "v1": 16, "classmethod": 16, "v": 16, "valid": 16, "basemodel": 16, "kwarg": [16, 20], "json": 16, "overwrit": 16, "valueerror": 16, "5000": 16, "400": 16, "recurs": 16, "priorit": 16, "so": 16, "overlap": 16, "concat": 16, "load_prompt": 16, "travers": 16, "tree": 16, "current_path": 16, "until": 16, "found": 16, "time": 16, "root": [16, 19], "reach": 16, "filenotfounderror": 16, "rais": 16, "point": 16, "typic": 16, "locat": [16, 19], "cannot": 16, "load_env": 16, "configpars": 16, "call": 16, "read": 16, "nn": [16, 20], "seper": [16, 20], "join": [16, 20], "abstract": 17, "abc": 17, "bar": 17, "tupl": 17, "localhost": 17, "arxiv": 17, "hkunlp": 17, "ip": 17, "deriv": 17, "embedding_modelnam": 17, "chromadb": 17, "httpclient": 17, "api": 17, "langchain_commun": 17, "wrapper": 17, "print": 17, "statu": 17, "random": 17, "integ": 17, "aliv": 17, "read_onli": 17, "core": 17, "differ": 18, "root_path": 19, "attempt": 19, "build": 19, "project": 19, "cmake": 19, "where": 19, "repo_id": 19, "co": 19, "copi": 19, "completedprocess": 19, "pull": 19, "updat": 19, "subprocess": 19, "oper": 19, "model_dir_path": 19, "output_dir": 19, "level": 19, "appli": 19, "basi": 20, "keyword": 20, "static": 20, "call_func": 20, "decor": 20, "match": 20, "relvant": 20, "packag": 21, "easi": 21, "implement": 21, "augment": 21, "variou": 21, "thank": 21, "integrag": 21, "modul": [21, 22], "index": 21, "content": 22, "12": 23, "484": 23, "sphx_glr_auto_examples_basicrag_customprompt": 23, "06": 23, "935": 23, "sphx_glr_auto_examples_basicrag_refin": 23, "03": 23, "036": 23, "sphx_glr_auto_examples_basicrag_ingest": 23, "01": 23, "275": 23, "sphx_glr_auto_examples_basicrag_stuff": 23, "237": 23, "sphx_glr_auto_examples_basicrag_fewshotprompt": 23, "001": 23}, "objects": {"": [[15, 0, 0, "-", "grag"]], "grag": [[16, 0, 0, "-", "components"], [18, 0, 0, "-", "prompts"], [19, 0, 0, "-", "quantize"], [20, 0, 0, "-", "rag"]], "grag.components": [[16, 0, 0, "-", "embedding"], [16, 0, 0, "-", "llm"], [16, 0, 0, "-", "multivec_retriever"], [16, 0, 0, "-", "parse_pdf"], [16, 0, 0, "-", "prompt"], [16, 0, 0, "-", "text_splitter"], [16, 0, 0, "-", "utils"], [17, 0, 0, "-", "vectordb"]], "grag.components.embedding": [[16, 1, 1, "", "Embedding"]], "grag.components.embedding.Embedding": [[16, 2, 1, "", "embedding_function"], [16, 2, 1, "", "embedding_model"], [16, 2, 1, "", "embedding_type"]], "grag.components.llm": [[16, 1, 1, "", "LLM"]], "grag.components.llm.LLM": [[16, 2, 1, "", "device_map"], [16, 3, 1, "", "hf_pipeline"], [16, 3, 1, "", "llama_cpp"], [16, 3, 1, "", "load_model"], [16, 2, 1, "", "max_new_tokens"], [16, 4, 1, "id0", "model_name"], [16, 4, 1, "", "model_path"], [16, 2, 1, "", "n_batch"], [16, 2, 1, "", "n_ctx"], [16, 2, 1, "", "n_gpu_layers"], [16, 2, 1, "", "task"], [16, 2, 1, "", "temperature"]], "grag.components.multivec_retriever": [[16, 1, 1, "", "Retriever"]], "grag.components.multivec_retriever.Retriever": [[16, 3, 1, "", "aadd_docs"], [16, 3, 1, "", "add_docs"], [16, 3, 1, "", "aget_chunk"], [16, 3, 1, "", "aget_doc"], [16, 3, 1, "", "aingest"], [16, 3, 1, "", "gen_doc_ids"], [16, 3, 1, "", "get_chunk"], [16, 3, 1, "", "get_doc"], [16, 3, 1, "", "get_docs_from_chunks"], [16, 3, 1, "", "id_gen"], [16, 2, 1, "", "id_key"], [16, 3, 1, "", "ingest"], [16, 2, 1, "", "namespace"], [16, 2, 1, "", "retriever"], [16, 3, 1, "", "split_docs"], [16, 2, 1, "", "splitter"], [16, 2, 1, "", "store"], [16, 2, 1, "", "store_path"], [16, 2, 1, "", "top_k"], [16, 2, 1, "", "vectordb"]], "grag.components.parse_pdf": [[16, 1, 1, "", "ParsePDF"]], "grag.components.parse_pdf.ParsePDF": [[16, 2, 1, "", "add_caption_first"], [16, 2, 1, "", "add_captions_to_blocks"], [16, 2, 1, "", "add_captions_to_text"], [16, 3, 1, "", "classify"], [16, 2, 1, "", "extract_image_block_types"], [16, 2, 1, "", "extract_images"], [16, 2, 1, "", "image_output_dir"], [16, 2, 1, "", "infer_table_structure"], [16, 3, 1, "", "load_file"], [16, 3, 1, "", "partition"], [16, 3, 1, "", "process_images"], [16, 3, 1, "", "process_tables"], [16, 3, 1, "", "process_text"], [16, 2, 1, "", "single_text_out"], [16, 2, 1, "", "strategy"], [16, 3, 1, "", "text_concat"]], "grag.components.prompt": [[16, 1, 1, "", "FewShotPrompt"], [16, 1, 1, "", "Prompt"]], "grag.components.prompt.FewShotPrompt": [[16, 2, 1, "", "doc_chain"], [16, 2, 1, "id2", "example_template"], [16, 2, 1, "id3", "examples"], [16, 2, 1, "", "filepath"], [16, 2, 1, "id1", "input_keys"], [16, 2, 1, "", "language"], [16, 2, 1, "", "llm_type"], [16, 2, 1, "", "model_computed_fields"], [16, 2, 1, "", "model_config"], [16, 2, 1, "", "model_fields"], [16, 2, 1, "", "name"], [16, 2, 1, "", "output_keys"], [16, 2, 1, "id4", "prefix"], [16, 2, 1, "", "source"], [16, 2, 1, "id5", "suffix"], [16, 2, 1, "", "task"], [16, 3, 1, "", "validate_examples"], [16, 3, 1, "", "validate_output_keys"]], "grag.components.prompt.Prompt": [[16, 2, 1, "id6", "doc_chain"], [16, 2, 1, "id7", "filepath"], [16, 3, 1, "", "format"], [16, 2, 1, "id8", "input_keys"], [16, 2, 1, "id9", "language"], [16, 2, 1, "id10", "llm_type"], [16, 3, 1, "", "load"], [16, 2, 1, "", "model_computed_fields"], [16, 2, 1, "", "model_config"], [16, 2, 1, "", "model_fields"], [16, 2, 1, "id11", "name"], [16, 2, 1, "", "prompt"], [16, 3, 1, "", "save"], [16, 2, 1, "id12", "source"], [16, 2, 1, "id13", "task"], [16, 2, 1, "", "template"], [16, 3, 1, "", "validate_doc_chain"], [16, 3, 1, "", "validate_input_keys"], [16, 3, 1, "", "validate_task"]], "grag.components.text_splitter": [[16, 1, 1, "", "TextSplitter"]], "grag.components.text_splitter.TextSplitter": [[16, 2, 1, "", "chunk_overlap"], [16, 2, 1, "", "chunk_size"], [16, 2, 1, "", "text_splitter"]], "grag.components.utils": [[16, 5, 1, "", "find_config_path"], [16, 5, 1, "", "get_config"], [16, 5, 1, "", "stuff_docs"]], "grag.components.vectordb": [[17, 0, 0, "-", "base"], [17, 0, 0, "-", "chroma_client"], [17, 0, 0, "-", "deeplake_client"]], "grag.components.vectordb.base": [[17, 1, 1, "", "VectorDB"]], "grag.components.vectordb.base.VectorDB": [[17, 3, 1, "", "aadd_docs"], [17, 3, 1, "", "add_docs"], [17, 3, 1, "", "aget_chunk"], [17, 3, 1, "", "delete"], [17, 3, 1, "", "get_chunk"]], "grag.components.vectordb.chroma_client": [[17, 1, 1, "", "ChromaClient"]], "grag.components.vectordb.chroma_client.ChromaClient": [[17, 3, 1, "", "aadd_docs"], [17, 3, 1, "", "add_docs"], [17, 3, 1, "", "aget_chunk"], [17, 2, 1, "", "client"], [17, 2, 1, "", "collection"], [17, 2, 1, "", "collection_name"], [17, 3, 1, "", "delete"], [17, 2, 1, "", "embedding_function"], [17, 2, 1, "", "embedding_model"], [17, 2, 1, "", "embedding_type"], [17, 3, 1, "", "get_chunk"], [17, 2, 1, "", "host"], [17, 2, 1, "", "langchain_client"], [17, 2, 1, "", "port"], [17, 3, 1, "", "test_connection"]], "grag.components.vectordb.deeplake_client": [[17, 1, 1, "", "DeepLakeClient"]], "grag.components.vectordb.deeplake_client.DeepLakeClient": [[17, 3, 1, "", "aadd_docs"], [17, 3, 1, "", "add_docs"], [17, 3, 1, "", "aget_chunk"], [17, 2, 1, "", "client"], [17, 2, 1, "", "collection"], [17, 3, 1, "", "delete"], [17, 2, 1, "", "embedding_function"], [17, 2, 1, "", "embedding_model"], [17, 2, 1, "", "embedding_type"], [17, 3, 1, "", "get_chunk"], [17, 2, 1, "", "langchain_client"], [17, 2, 1, "", "store_path"]], "grag.quantize": [[19, 0, 0, "-", "quantize"], [19, 0, 0, "-", "utils"]], "grag.quantize.utils": [[19, 5, 1, "", "building_llamacpp"], [19, 5, 1, "", "fetch_model_repo"], [19, 5, 1, "", "get_llamacpp_repo"], [19, 5, 1, "", "quantize_model"]], "grag.rag": [[20, 0, 0, "-", "basic_rag"]], "grag.rag.basic_rag": [[20, 1, 1, "", "BasicRAG"]], "grag.rag.basic_rag.BasicRAG": [[20, 2, 1, "", "custom_prompt"], [20, 4, 1, "id0", "doc_chain"], [20, 2, 1, "", "llm_kwargs"], [20, 4, 1, "id1", "model_name"], [20, 3, 1, "", "output_parser"], [20, 3, 1, "", "prompt_matcher"], [20, 3, 1, "", "refine_call"], [20, 2, 1, "", "retriever_kwargs"], [20, 3, 1, "", "stuff_call"], [20, 3, 1, "", "stuff_docs"], [20, 4, 1, "id2", "task"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"custom": [0, 1], "prompt": [0, 1, 16, 18], "few": 1, "shot": 1, "document": [2, 21], "ingest": [2, 14], "refin": 3, "chain": [3, 4], "stuff": 4, "basic": [5, 20], "rag": [5, 20], "cookbook": [5, 7, 10], "comput": [6, 9, 23], "time": [6, 9, 23], "retriev": [7, 8, 16], "gui": [7, 8], "get": 11, "start": 11, "instal": 12, "llm": [13, 16], "To": 13, "run": 13, "us": 13, "huggingfac": 13, "llamacpp": 13, "how": 13, "quantiz": [13, 19], "model": 13, "vector": 14, "store": 14, "support": 14, "chroma": [14, 17], "embed": [14, 16], "data": 14, "grag": [15, 21, 22], "modul": [15, 16, 17, 18, 19, 20], "content": [15, 16, 17, 18, 19, 20, 21], "compon": 16, "vectordb": [16, 17], "pars": 16, "pdf": 16, "text": 16, "splitter": 16, "util": [16, 19], "submodul": [17, 19, 20], "base": 17, "client": 17, "deeplak": 17, "welcom": 21, "": 21, "indic": 21, "tabl": 21}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 60}, "alltitles": {"Custom Prompts": [[0, "custom-prompts"]], "Custom Few-Shot Prompts": [[1, "custom-few-shot-prompts"]], "Document Ingestion": [[2, "document-ingestion"]], "Refine Chain": [[3, "refine-chain"]], "Stuff Chain": [[4, "stuff-chain"]], "Basic-RAG Cookbooks": [[5, "basic-rag-cookbooks"]], "Computation times": [[6, "computation-times"], [9, "computation-times"], [23, "computation-times"]], "Retriever-GUI Cookbooks": [[7, "retriever-gui-cookbooks"]], "Retriever GUI": [[8, "retriever-gui"]], "Get Started": [[11, "get-started"]], "Installation": [[12, "installation"]], "LLMs": [[13, "llms"]], "To run LLMs using HuggingFace": [[13, "to-run-llms-using-huggingface"]], "To run LLMs using LlamaCPP": [[13, "to-run-llms-using-llamacpp"]], "How to quantize models.": [[13, "how-to-quantize-models"]], "Vector Stores": [[14, "vector-stores"]], "Supported Vector Stores": [[14, "supported-vector-stores"]], "Chroma": [[14, "chroma"]], "Embeddings": [[14, "embeddings"]], "Data Ingestion": [[14, "data-ingestion"]], "GRAG": [[15, "grag"]], "Module contents": [[15, "module-grag"], [16, "module-grag.components"], [17, "module-grag.components.vectordb"], [18, "module-grag.prompts"], [19, "module-grag.quantize"], [20, "module-grag.rag"]], "Components": [[16, "components"]], "VectorDB": [[16, "vectordb"], [17, "vectordb"]], "Embedding": [[16, "module-grag.components.embedding"]], "LLM": [[16, "module-grag.components.llm"]], "Retriever": [[16, "module-grag.components.multivec_retriever"]], "Parse PDF": [[16, "module-grag.components.parse_pdf"]], "Prompt": [[16, "module-grag.components.prompt"]], "Text Splitter": [[16, "module-grag.components.text_splitter"]], "Utils": [[16, "module-grag.components.utils"], [19, "module-grag.quantize.utils"]], "Submodules": [[17, "submodules"], [19, "submodules"], [20, "submodules"]], "Base": [[17, "module-grag.components.vectordb.base"]], "Chroma Client": [[17, "module-grag.components.vectordb.chroma_client"]], "Deeplake Client": [[17, "module-grag.components.vectordb.deeplake_client"]], "Prompts": [[18, "prompts"]], "Quantize": [[19, "quantize"], [19, "id1"]], "RAG": [[20, "rag"]], "Basic RAG": [[20, "module-grag.rag.basic_rag"]], "grag": [[22, "grag"]], "Welcome to GRAG\u2019s documentation!": [[21, "welcome-to-grag-s-documentation"]], "Contents:": [[21, null]], "Indices and tables": [[21, "indices-and-tables"]], "Cookbooks": [[10, "cookbooks"]]}, "indexentries": {"grag": [[15, "module-grag"]], "module": [[15, "module-grag"], [16, "module-grag.components"], [16, "module-grag.components.embedding"], [16, "module-grag.components.llm"], [16, "module-grag.components.multivec_retriever"], [16, "module-grag.components.parse_pdf"], [16, "module-grag.components.prompt"], [16, "module-grag.components.text_splitter"], [16, "module-grag.components.utils"], [17, "module-grag.components.vectordb"], [17, "module-grag.components.vectordb.base"], [17, "module-grag.components.vectordb.chroma_client"], [17, "module-grag.components.vectordb.deeplake_client"], [18, "module-grag.prompts"], [19, "module-grag.quantize"], [19, "module-grag.quantize.quantize"], [19, "module-grag.quantize.utils"], [20, "module-grag.rag"], [20, "module-grag.rag.basic_rag"]], "embedding (class in grag.components.embedding)": [[16, "grag.components.embedding.Embedding"]], "fewshotprompt (class in grag.components.prompt)": [[16, "grag.components.prompt.FewShotPrompt"]], "llm (class in grag.components.llm)": [[16, "grag.components.llm.LLM"]], "parsepdf (class in grag.components.parse_pdf)": [[16, "grag.components.parse_pdf.ParsePDF"]], "prompt (class in grag.components.prompt)": [[16, "grag.components.prompt.Prompt"]], "retriever (class in grag.components.multivec_retriever)": [[16, "grag.components.multivec_retriever.Retriever"]], "textsplitter (class in grag.components.text_splitter)": [[16, "grag.components.text_splitter.TextSplitter"]], "aadd_docs() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.aadd_docs"]], "add_caption_first (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.add_caption_first"]], "add_captions_to_blocks (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.add_captions_to_blocks"]], "add_captions_to_text (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.add_captions_to_text"]], "add_docs() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.add_docs"]], "aget_chunk() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.aget_chunk"]], "aget_doc() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.aget_doc"]], "aingest() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.aingest"]], "chunk_overlap (grag.components.text_splitter.textsplitter attribute)": [[16, "grag.components.text_splitter.TextSplitter.chunk_overlap"]], "chunk_size (grag.components.text_splitter.textsplitter attribute)": [[16, "grag.components.text_splitter.TextSplitter.chunk_size"]], "classify() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.classify"]], "device_map (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.device_map"]], "doc_chain (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.doc_chain"]], "doc_chain (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.doc_chain"], [16, "id6"]], "embedding_function (grag.components.embedding.embedding attribute)": [[16, "grag.components.embedding.Embedding.embedding_function"]], "embedding_model (grag.components.embedding.embedding attribute)": [[16, "grag.components.embedding.Embedding.embedding_model"]], "embedding_type (grag.components.embedding.embedding attribute)": [[16, "grag.components.embedding.Embedding.embedding_type"]], "example_template (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.example_template"], [16, "id2"]], "examples (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.examples"], [16, "id3"]], "extract_image_block_types (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.extract_image_block_types"]], "extract_images (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.extract_images"]], "filepath (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.filepath"]], "filepath (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.filepath"], [16, "id7"]], "find_config_path() (in module grag.components.utils)": [[16, "grag.components.utils.find_config_path"]], "format() (grag.components.prompt.prompt method)": [[16, "grag.components.prompt.Prompt.format"]], "gen_doc_ids() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.gen_doc_ids"]], "get_chunk() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.get_chunk"]], "get_config() (in module grag.components.utils)": [[16, "grag.components.utils.get_config"]], "get_doc() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.get_doc"]], "get_docs_from_chunks() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.get_docs_from_chunks"]], "grag.components": [[16, "module-grag.components"]], "grag.components.embedding": [[16, "module-grag.components.embedding"]], "grag.components.llm": [[16, "module-grag.components.llm"]], "grag.components.multivec_retriever": [[16, "module-grag.components.multivec_retriever"]], "grag.components.parse_pdf": [[16, "module-grag.components.parse_pdf"]], "grag.components.prompt": [[16, "module-grag.components.prompt"]], "grag.components.text_splitter": [[16, "module-grag.components.text_splitter"]], "grag.components.utils": [[16, "module-grag.components.utils"]], "hf_pipeline() (grag.components.llm.llm method)": [[16, "grag.components.llm.LLM.hf_pipeline"]], "id_gen() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.id_gen"]], "id_key (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.id_key"]], "image_output_dir (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.image_output_dir"]], "infer_table_structure (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.infer_table_structure"]], "ingest() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.ingest"]], "input_keys (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.input_keys"], [16, "id1"]], "input_keys (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.input_keys"], [16, "id8"]], "language (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.language"]], "language (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.language"], [16, "id9"]], "llama_cpp() (grag.components.llm.llm method)": [[16, "grag.components.llm.LLM.llama_cpp"]], "llm_type (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.llm_type"]], "llm_type (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.llm_type"], [16, "id10"]], "load() (grag.components.prompt.prompt class method)": [[16, "grag.components.prompt.Prompt.load"]], "load_file() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.load_file"]], "load_model() (grag.components.llm.llm method)": [[16, "grag.components.llm.LLM.load_model"]], "max_new_tokens (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.max_new_tokens"]], "model_computed_fields (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.model_computed_fields"]], "model_computed_fields (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.model_computed_fields"]], "model_config (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.model_config"]], "model_config (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.model_config"]], "model_fields (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.model_fields"]], "model_fields (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.model_fields"]], "model_name (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.model_name"]], "model_name (grag.components.llm.llm property)": [[16, "id0"]], "model_path (grag.components.llm.llm property)": [[16, "grag.components.llm.LLM.model_path"]], "n_batch (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.n_batch"]], "n_ctx (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.n_ctx"]], "n_gpu_layers (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.n_gpu_layers"]], "name (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.name"]], "name (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.name"], [16, "id11"]], "namespace (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.namespace"]], "output_keys (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.output_keys"]], "partition() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.partition"]], "prefix (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.prefix"], [16, "id4"]], "process_images() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.process_images"]], "process_tables() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.process_tables"]], "process_text() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.process_text"]], "prompt (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.prompt"]], "retriever (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.retriever"]], "save() (grag.components.prompt.prompt method)": [[16, "grag.components.prompt.Prompt.save"]], "single_text_out (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.single_text_out"]], "source (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.source"]], "source (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.source"], [16, "id12"]], "split_docs() (grag.components.multivec_retriever.retriever method)": [[16, "grag.components.multivec_retriever.Retriever.split_docs"]], "splitter (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.splitter"]], "store (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.store"]], "store_path (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.store_path"]], "strategy (grag.components.parse_pdf.parsepdf attribute)": [[16, "grag.components.parse_pdf.ParsePDF.strategy"]], "stuff_docs() (in module grag.components.utils)": [[16, "grag.components.utils.stuff_docs"]], "suffix (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.suffix"], [16, "id5"]], "task (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.task"]], "task (grag.components.prompt.fewshotprompt attribute)": [[16, "grag.components.prompt.FewShotPrompt.task"]], "task (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.task"], [16, "id13"]], "temperature (grag.components.llm.llm attribute)": [[16, "grag.components.llm.LLM.temperature"]], "template (grag.components.prompt.prompt attribute)": [[16, "grag.components.prompt.Prompt.template"]], "text_concat() (grag.components.parse_pdf.parsepdf method)": [[16, "grag.components.parse_pdf.ParsePDF.text_concat"]], "text_splitter (grag.components.text_splitter.textsplitter attribute)": [[16, "grag.components.text_splitter.TextSplitter.text_splitter"]], "top_k (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.top_k"]], "validate_doc_chain() (grag.components.prompt.prompt class method)": [[16, "grag.components.prompt.Prompt.validate_doc_chain"]], "validate_examples() (grag.components.prompt.fewshotprompt class method)": [[16, "grag.components.prompt.FewShotPrompt.validate_examples"]], "validate_input_keys() (grag.components.prompt.prompt class method)": [[16, "grag.components.prompt.Prompt.validate_input_keys"]], "validate_output_keys() (grag.components.prompt.fewshotprompt class method)": [[16, "grag.components.prompt.FewShotPrompt.validate_output_keys"]], "validate_task() (grag.components.prompt.prompt class method)": [[16, "grag.components.prompt.Prompt.validate_task"]], "vectordb (grag.components.multivec_retriever.retriever attribute)": [[16, "grag.components.multivec_retriever.Retriever.vectordb"]], "chromaclient (class in grag.components.vectordb.chroma_client)": [[17, "grag.components.vectordb.chroma_client.ChromaClient"]], "deeplakeclient (class in grag.components.vectordb.deeplake_client)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient"]], "vectordb (class in grag.components.vectordb.base)": [[17, "grag.components.vectordb.base.VectorDB"]], "aadd_docs() (grag.components.vectordb.base.vectordb method)": [[17, "grag.components.vectordb.base.VectorDB.aadd_docs"]], "aadd_docs() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.aadd_docs"]], "aadd_docs() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.aadd_docs"]], "add_docs() (grag.components.vectordb.base.vectordb method)": [[17, "grag.components.vectordb.base.VectorDB.add_docs"]], "add_docs() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.add_docs"]], "add_docs() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.add_docs"]], "aget_chunk() (grag.components.vectordb.base.vectordb method)": [[17, "grag.components.vectordb.base.VectorDB.aget_chunk"]], "aget_chunk() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.aget_chunk"]], "aget_chunk() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.aget_chunk"]], "client (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.client"]], "client (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.client"]], "collection (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.collection"]], "collection (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.collection"]], "collection_name (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.collection_name"]], "delete() (grag.components.vectordb.base.vectordb method)": [[17, "grag.components.vectordb.base.VectorDB.delete"]], "delete() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.delete"]], "delete() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.delete"]], "embedding_function (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.embedding_function"]], "embedding_function (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_function"]], "embedding_model (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.embedding_model"]], "embedding_model (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_model"]], "embedding_type (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.embedding_type"]], "embedding_type (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_type"]], "get_chunk() (grag.components.vectordb.base.vectordb method)": [[17, "grag.components.vectordb.base.VectorDB.get_chunk"]], "get_chunk() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.get_chunk"]], "get_chunk() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.get_chunk"]], "grag.components.vectordb": [[17, "module-grag.components.vectordb"]], "grag.components.vectordb.base": [[17, "module-grag.components.vectordb.base"]], "grag.components.vectordb.chroma_client": [[17, "module-grag.components.vectordb.chroma_client"]], "grag.components.vectordb.deeplake_client": [[17, "module-grag.components.vectordb.deeplake_client"]], "host (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.host"]], "langchain_client (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.langchain_client"]], "langchain_client (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.langchain_client"]], "port (grag.components.vectordb.chroma_client.chromaclient attribute)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.port"]], "store_path (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[17, "grag.components.vectordb.deeplake_client.DeepLakeClient.store_path"]], "test_connection() (grag.components.vectordb.chroma_client.chromaclient method)": [[17, "grag.components.vectordb.chroma_client.ChromaClient.test_connection"]], "grag.prompts": [[18, "module-grag.prompts"]], "building_llamacpp() (in module grag.quantize.utils)": [[19, "grag.quantize.utils.building_llamacpp"]], "fetch_model_repo() (in module grag.quantize.utils)": [[19, "grag.quantize.utils.fetch_model_repo"]], "get_llamacpp_repo() (in module grag.quantize.utils)": [[19, "grag.quantize.utils.get_llamacpp_repo"]], "grag.quantize": [[19, "module-grag.quantize"]], "grag.quantize.quantize": [[19, "module-grag.quantize.quantize"]], "grag.quantize.utils": [[19, "module-grag.quantize.utils"]], "quantize_model() (in module grag.quantize.utils)": [[19, "grag.quantize.utils.quantize_model"]], "basicrag (class in grag.rag.basic_rag)": [[20, "grag.rag.basic_rag.BasicRAG"]], "custom_prompt (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.custom_prompt"]], "doc_chain (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.doc_chain"]], "doc_chain (grag.rag.basic_rag.basicrag property)": [[20, "id0"]], "grag.rag": [[20, "module-grag.rag"]], "grag.rag.basic_rag": [[20, "module-grag.rag.basic_rag"]], "llm_kwargs (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.llm_kwargs"]], "model_name (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.model_name"]], "model_name (grag.rag.basic_rag.basicrag property)": [[20, "id1"]], "output_parser() (grag.rag.basic_rag.basicrag static method)": [[20, "grag.rag.basic_rag.BasicRAG.output_parser"]], "prompt_matcher() (grag.rag.basic_rag.basicrag method)": [[20, "grag.rag.basic_rag.BasicRAG.prompt_matcher"]], "refine_call() (grag.rag.basic_rag.basicrag method)": [[20, "grag.rag.basic_rag.BasicRAG.refine_call"]], "retriever_kwargs (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.retriever_kwargs"]], "stuff_call() (grag.rag.basic_rag.basicrag method)": [[20, "grag.rag.basic_rag.BasicRAG.stuff_call"]], "stuff_docs() (grag.rag.basic_rag.basicrag static method)": [[20, "grag.rag.basic_rag.BasicRAG.stuff_docs"]], "task (grag.rag.basic_rag.basicrag attribute)": [[20, "grag.rag.basic_rag.BasicRAG.task"]], "task (grag.rag.basic_rag.basicrag property)": [[20, "id2"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["auto_examples/Basic-RAG/BasicRAG_CustomPrompt", "auto_examples/Basic-RAG/BasicRAG_FewShotPrompt", "auto_examples/Basic-RAG/BasicRAG_ingest", "auto_examples/Basic-RAG/BasicRAG_refine", "auto_examples/Basic-RAG/BasicRAG_stuff", "auto_examples/Basic-RAG/index", "auto_examples/Basic-RAG/sg_execution_times", "auto_examples/Retriver-GUI/index", "auto_examples/Retriver-GUI/retriever_app", "auto_examples/Retriver-GUI/sg_execution_times", "auto_examples_index", "get_started", "get_started.installation", "get_started.introduction", "get_started.llms", "get_started.vectordb", "grag", "grag.components", "grag.components.vectordb", "grag.prompts", "grag.quantize", "grag.rag", "index", "modules", "sg_execution_times"], "filenames": ["auto_examples/Basic-RAG/BasicRAG_CustomPrompt.rst", "auto_examples/Basic-RAG/BasicRAG_FewShotPrompt.rst", "auto_examples/Basic-RAG/BasicRAG_ingest.rst", "auto_examples/Basic-RAG/BasicRAG_refine.rst", "auto_examples/Basic-RAG/BasicRAG_stuff.rst", "auto_examples/Basic-RAG/index.rst", "auto_examples/Basic-RAG/sg_execution_times.rst", "auto_examples/Retriver-GUI/index.rst", "auto_examples/Retriver-GUI/retriever_app.rst", "auto_examples/Retriver-GUI/sg_execution_times.rst", "auto_examples_index.rst", "get_started.rst", "get_started.installation.rst", "get_started.introduction.rst", "get_started.llms.rst", "get_started.vectordb.rst", "grag.rst", "grag.components.rst", "grag.components.vectordb.rst", "grag.prompts.rst", "grag.quantize.rst", "grag.rag.rst", "index.rst", "modules.rst", "sg_execution_times.rst"], "titles": ["Custom Prompts", "Custom Few-Shot Prompts", "Document Ingestion", "Refine Chain", "Stuff Chain", "Basic-RAG Cookbooks", "Computation times", "Retriever-GUI Cookbooks", "Retriever GUI", "Computation times", "Cookbooks", "Get Started", "Installation", "GRAG Overview", "LLMs", "Vector Stores", "GRAG", "Components", "VectorDB", "Prompts", "Quantize", "RAG", "Welcome to GRAG\u2019s documentation!", "grag", "Computation times"], "terms": {"go": [0, 1, 2, 3, 4, 8], "end": [0, 1, 2, 3, 4, 8, 22], "download": [0, 1, 2, 3, 4, 5, 7, 8, 14, 20], "full": [0, 1, 2, 3, 4, 8], "exampl": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, 16, 17, 24], "code": [0, 1, 2, 3, 4, 5, 7, 8], "thi": [0, 1, 2, 3, 4, 8, 14, 15, 17, 18, 21], "cookbook": [0, 1, 2, 3, 4, 8, 22, 24], "demonstr": [0, 1, 2, 3, 4, 5, 7, 8], "how": [0, 1, 2, 3, 4], "us": [0, 1, 2, 3, 4, 5, 7, 8, 11, 15, 17, 18, 20, 21], "basic": [0, 1, 6, 10, 16, 22, 23, 24], "rag": [0, 1, 3, 4, 6, 10, 16, 22, 23, 24], "from": [0, 1, 2, 3, 4, 6, 8, 9, 12, 14, 17, 18, 20, 24], "grag": [0, 1, 2, 3, 4, 8, 14, 17, 18, 20, 21], "compon": [0, 1, 2, 3, 4, 8, 16, 18, 22, 23], "import": [0, 1, 2, 3, 4, 8], "basic_rag": [0, 1, 3, 4, 21], "basicrag": [0, 1, 3, 4, 16, 21, 23], "custom_prompt": [0, 1, 16, 17, 21], "input_kei": [0, 1, 16, 17], "context": [0, 1, 17], "question": [0, 1], "templat": [0, 16, 17], "answer": [0, 1], "follow": [0, 1, 14], "base": [0, 1, 8, 15, 16, 17, 21], "given": [0, 1, 17, 20], "doc_chain": [0, 1, 3, 4, 16, 17, 21], "stuff": [0, 1, 5, 6, 17, 21], "jupyt": [0, 1, 2, 3, 4, 5, 7, 8], "notebook": [0, 1, 2, 3, 4, 5, 7, 8], "basicrag_customprompt": [0, 6, 24], "ipynb": [0, 1, 2, 3, 4, 8], "python": [0, 1, 2, 3, 4, 5, 7, 8, 14, 22], "sourc": [0, 1, 2, 3, 4, 5, 7, 8, 13, 15, 16, 17, 18, 20, 21], "py": [0, 1, 2, 3, 4, 6, 8, 9, 24], "galleri": [0, 1, 2, 3, 4, 5, 7, 8, 24], "gener": [0, 1, 2, 3, 4, 5, 7, 8, 17, 22], "sphinx": [0, 1, 2, 3, 4, 5, 7, 8], "fewshotprompt": [1, 16, 17, 21, 23], "custom_few_shot_prompt": 1, "output_kei": [1, 16, 17], "example_templ": [1, 16, 17], "prefix": [1, 16, 17], "like": [1, 8, 17, 22], "below": [1, 5, 7], "suffix": [1, 16, 17], "what": [1, 8, 15], "i": [1, 5, 7, 8, 13, 14, 15, 17, 18, 20, 22], "name": [1, 8, 14, 16, 17, 18, 21], "largest": 1, "planet": 1, "jupit": 1, "who": 1, "came": 1, "up": [1, 8, 17], "convolut": 1, "neural": 1, "network": 1, "yann": 1, "lecun": 1, "introduc": 1, "basicrag_fewshotprompt": [1, 6, 24], "vector": [2, 11, 17, 18, 22], "databas": [2, 15, 17, 18], "multivec_retriev": [2, 3, 4, 8, 17], "retriev": [2, 3, 4, 9, 10, 15, 16, 21, 22, 23], "vectordb": [2, 3, 4, 8, 15, 16, 23], "deeplake_cli": [2, 3, 4, 18], "deeplakecli": [2, 3, 4, 15, 17, 18], "client": [2, 3, 4, 8, 15, 16, 17], "collection_nam": [2, 3, 4, 8, 17, 18], "your_collection_nam": 2, "altern": 2, "chroma": [2, 8, 16, 17, 22], "chroma_cli": [2, 18], "chromacli": [2, 17, 18], "ci_test": 2, "dir_path": [2, 15, 17], "data": [2, 11, 17, 18], "pdf": [2, 15, 16, 23], "path": [2, 8, 14, 15, 17, 18, 20], "file": [6, 9, 12, 14, 15, 17, 20, 24], "basicrag_ingest": [2, 6, 24], "test": [2, 3, 4, 18], "__name__": [3, 4, 8], "__main__": [3, 4, 8], "while": [3, 4], "true": [2, 3, 4, 8, 17, 18], "queri": [3, 4, 8, 17, 18], "input": [3, 4, 14, 17], "basicrag_refin": [3, 6, 24], "basicrag_stuff": [4, 6, 24], "custom": [5, 6, 12, 17], "prompt": [5, 6, 14, 16, 21, 22, 23], "refin": [5, 6, 17, 21], "chain": [5, 6, 17, 21], "document": [5, 6, 17, 18, 21], "ingest": [5, 6, 11, 16, 17], "few": [5, 6, 17], "shot": [5, 6, 17], "all": [5, 7, 17, 18, 19, 24], "rag_python": 5, "zip": [5, 7], "rag_jupyt": 5, "00": [6, 9, 24], "000": [6, 9], "total": [6, 9, 24], "execut": [6, 9, 17, 24], "5": [6, 24], "auto_exampl": [6, 9], "mem": [6, 9, 24], "mb": [6, 9, 24], "0": [6, 8, 9, 17, 24], "an": [7, 13, 14, 22], "simpl": [7, 8, 22], "streamlit": [7, 8], "retriv": [7, 9], "gui_python": 7, "gui_jupyt": 7, "stremlit": 8, "o": 8, "sy": 8, "pathlib": [2, 8], "st": 8, "insert": 8, "1": [8, 9, 17], "str": [8, 17, 18, 20, 21], "getcwd": 8, "parent": [2, 8, 15, 17], "class": [8, 17, 18, 21], "pagehom": 8, "manag": [8, 17], "home": [8, 17, 18], "page": [8, 17, 21, 22], "interfac": 8, "interact": [8, 20], "web": 8, "applic": 8, "attribut": 8, "app": 8, "The": [8, 17, 18, 20, 22], "instanc": [8, 17, 20], "hold": 8, "def": 8, "__init__": 8, "self": [8, 17, 18], "initi": [8, 17], "arg": 8, "render_sidebar": 8, "render": 8, "sidebar": 8, "option": [8, 17, 20], "session_st": 8, "metadata_toggl": 8, "toggl": 8, "show": [8, 17, 18], "metadata": [8, 17], "top_k": [8, 16, 17, 18], "number_input": 8, "top": [8, 17, 18], "k": 8, "min_valu": 8, "valu": [8, 17], "3": [8, 14, 17], "step": 8, "render_search_form": 8, "search": [8, 17, 22], "form": [8, 14], "return": [8, 17, 18, 20, 21], "state": 8, "button": 8, "markdown": 8, "enter": [8, 14], "search_form": 8, "text_input": 8, "artifici": 8, "intellig": 8, "form_submit_button": 8, "get_search_result": 8, "_queri": 8, "_top_k": 8, "result": [8, 20], "paramet": [8, 17, 18, 20, 21], "number": [8, 17, 18], "A": [8, 17, 18, 20], "list": [8, 17, 18, 21], "score": [8, 17, 18], "get_chunk": [8, 16, 17, 18], "with_scor": [8, 17, 18], "render_search_result": 8, "displai": 8, "spinner": 8, "similar": [8, 17, 18], "chunk": [8, 17, 18], "has_result": 8, "len": 8, "could": 8, "find": [8, 14, 17], "anyth": 8, "write": 8, "enumer": 8, "expand": 8, "f": 8, "bulb": 8, "similiar": 8, "3f": 8, "page_cont": 8, "check_connect": 8, "check": [8, 14], "connect": [8, 17, 18], "backend": 8, "activ": 8, "fals": [8, 17, 18], "otherwis": 8, "respons": 8, "test_connect": [8, 17, 18], "els": [8, 18], "render_stat": 8, "statist": 8, "detail": [8, 14, 17], "about": [8, 17], "n": [8, 17], "host": [8, 15, 17, 18], "address": [8, 18], "port": [8, 15, 17, 18], "collect": [8, 17, 18], "embed": [8, 11, 16, 18, 23], "type": [8, 17, 18, 21], "embedding_typ": [8, 15, 16, 17, 18], "model": [8, 15, 17, 18, 20, 21], "embedding_model": [8, 15, 16, 17, 18], "doc": [8, 17, 18, 21], "count": 8, "green": 8, "red": 8, "lost": 8, "main": 8, "function": [8, 17, 18, 20], "orchestr": 8, "ui": 8, "tab1": 8, "tab2": 8, "tab": 8, "submit": 8, "repres": 8, "system": 8, "set": [8, 14, 17], "titl": 8, "http": 8, "blog": 8, "io": 8, "your": 8, "look": 8, "alik": 8, "semant": 8, "retriever_app": [8, 9], "gui": [9, 10, 22], "instal": [11, 22], "llm": [11, 16, 19, 21, 22, 23], "To": [11, 15], "run": [2, 11, 15, 22], "huggingfac": [11, 15, 17, 20], "llamacpp": [11, 22], "store": [11, 16, 17, 18, 22], "support": [11, 17, 18, 22], "sinc": [12, 15], "we": 12, "ar": [12, 14, 15], "just": [12, 14], "develop": 12, "phase": 12, "have": 12, "publish": 12, "pypi": 12, "yet": 12, "git": [12, 20], "clone": [12, 14, 20], "repositori": [12, 14, 20], "pip": 12, "For": [12, 14], "e": 12, "moreov": 12, "further": 12, "can": [12, 14, 15], "made": 12, "config": [12, 14, 15, 17], "src": [12, 15], "ini": [12, 14, 15, 17], "offer": [14, 22], "two": 14, "wai": [14, 22], "local": [14, 15, 17, 22], "easiest": 14, "get": [14, 17, 22], "start": [14, 17, 22], "doe": [14, 17], "much": 14, "flexibl": 14, "If": [14, 15, 17], "chang": [14, 15], "model_nam": [14, 16, 17, 21], "repo": 14, "id": [14, 17, 20], "note": 14, "gate": 14, "make": [14, 15, 20, 22], "sure": [14, 15], "provid": [13, 14, 15, 17, 18, 19, 21, 22], "auth": 14, "token": [14, 17], "llama": [14, 17, 20], "cpp": [14, 17, 20], "github": [], "com": [], "ggerganov": [], "directori": [14, 17, 20], "cd": [], "infer": [], "gpu": 17, "which": 17, "necessari": [], "most": [17, 18], "you": 14, "cuda": [], "nvcc": [], "version": [], "inferenc": [], "util": [16, 23], "bla": [], "output": [17, 18, 21], "try": [], "reinstal": [], "cmake_arg": [], "dllama_cubla": [], "upgrad": [], "forc": [], "cach": [], "dir": [], "solut": 22, "stack": [], "overflow": [], "post": [], "explain": 15, "current": [15, 17], "vectorstor": [15, 18], "deeplak": [15, 16, 17, 22], "server": 15, "either": [14, 15], "move": [15, 17], "script": [15, 17], "run_chroma": 15, "sh": 15, "refer": [15, 17], "clientserv": 15, "default": [15, 17, 18, 20, 21], "8000": [15, 18], "under": 15, "argument": [15, 17, 21], "explicitli": 15, "By": 15, "instructor": [15, 17, 18], "xl": [15, 18], "ani": [15, 17, 22], "__file__": [2, 15], "2": [2, 15, 17], "folder": 15, "contain": [15, 17, 19, 20], "submodul": [16, 17, 23], "embedding_funct": [16, 17, 18], "device_map": [16, 17], "task": [16, 17, 21], "max_new_token": [16, 17], "temperatur": [16, 17], "n_batch": [16, 17], "n_ctx": [16, 17], "n_gpu_lay": [16, 17], "hf_pipelin": [16, 17], "llama_cpp": [16, 17], "load_model": [16, 17], "model_path": [16, 17], "store_path": [16, 17, 18], "id_kei": [16, 17], "splitter": [16, 23], "namespac": [16, 17], "aadd_doc": [16, 17, 18], "add_doc": [16, 17, 18], "aget_chunk": [16, 17, 18], "aget_doc": [16, 17], "aingest": [2, 16, 17], "gen_doc_id": [16, 17], "get_doc": [16, 17], "get_docs_from_chunk": [16, 17], "id_gen": [16, 17], "split_doc": [16, 17], "pars": [16, 23], "parsepdf": [16, 17, 23], "single_text_out": [16, 17], "strategi": [16, 17], "extract_image_block_typ": [16, 17], "infer_table_structur": [16, 17], "extract_imag": [16, 17], "image_output_dir": [16, 17], "add_captions_to_text": [16, 17], "add_captions_to_block": [16, 17], "add_caption_first": [16, 17], "classifi": [16, 17], "load_fil": [16, 17], "partit": [16, 17], "process_imag": [16, 17], "process_t": [16, 17], "process_text": [16, 17], "text_concat": [16, 17], "llm_type": [16, 17], "languag": [16, 17], "filepath": [16, 17], "model_computed_field": [16, 17], "model_config": [16, 17], "model_field": [16, 17], "validate_exampl": [16, 17], "validate_output_kei": [16, 17], "format": [16, 17, 21], "load": [16, 17], "save": [16, 17, 20], "validate_doc_chain": [16, 17], "validate_input_kei": [16, 17], "validate_task": [16, 17], "text": [16, 23], "textsplitt": [16, 17, 23], "chunk_siz": [16, 17], "chunk_overlap": [16, 17], "text_splitt": [16, 17], "find_config_path": [16, 17, 23], "get_config": [16, 17, 23], "stuff_doc": [16, 17, 21, 23], "quantiz": [16, 17, 22, 23], "building_llamacpp": [16, 20, 23], "fetch_model_repo": [16, 20, 23], "get_llamacpp_repo": [16, 20, 23], "quantize_model": [16, 20, 23], "llm_kwarg": [16, 21], "retriever_kwarg": [16, 21], "output_pars": [16, 21], "prompt_match": [16, 21], "refine_cal": [16, 21], "stuff_cal": [16, 21], "delet": [17, 18], "langchain_cli": [17, 18], "object": [17, 21], "sentenc": [17, 18], "transform": [17, 18], "model_typ": 17, "abov": [14, 17], "langchain": [17, 18], "13b": 17, "chat": 17, "auto": 17, "1024": 17, "6000": 17, "std_out": 17, "base_dir": 17, "ubuntu": [17, 18], "volume_2k": [17, 18], "capstone_5": [17, 18], "q5_k_m": [14, 17], "pipelin": 17, "larg": 17, "devic": 17, "map": 17, "dict": [17, 21], "being": 17, "maximum": 17, "new": 17, "int": [17, 18], "sampl": 17, "float": [17, 18], "batch": 17, "size": 17, "layer": 17, "is_loc": 17, "hug": 17, "face": 17, "bool": [17, 18], "whether": 17, "none": [17, 18, 20, 21], "specifi": [17, 20], "f16": 17, "etc": [14, 17], "properti": [17, 21], "doc_id": 17, "8c9040b0b5cd4d7cbc2e737da1b24ebf": 17, "client_kwarg": 17, "multi": 17, "It": [17, 22], "ha": [14, 17], "addit": 17, "link": 17, "kei": 17, "identifi": 17, "storag": 17, "localfilestor": 17, "pair": 17, "multi_vector": 17, "multivectorretriev": 17, "": 17, "produc": 17, "uniqu": 17, "async": [2, 17, 18], "add": [17, 18], "also": [17, 22], "langchain_cor": [17, 21], "cosin": [17, 18], "asynchron": [2, 17, 18], "string": [17, 18, 21], "glob_pattern": 17, "dry_run": 17, "verbos": [17, 18], "parser_kwarg": 17, "glob": 17, "pattern": 17, "progress": [17, 18], "pass": 17, "parser": 17, "take": 17, "method": 17, "more": [14, 17], "hexadecim": 17, "uuid": 17, "one_to_on": 17, "each": [17, 18], "uuid5": 17, "ensur": 17, "singl": [17, 18], "alwai": 17, "same": 17, "split": 17, "them": 17, "smaller": 17, "after": [14, 17], "parse_pdf": 17, "hi_r": 17, "table_as_html": 17, "tabl": 17, "imag": 17, "element": 17, "combin": 17, "better": 17, "accuraci": 17, "extract": 17, "block": 17, "dure": 17, "includ": 17, "figur": 17, "caption": 17, "place": 17, "befor": 17, "correspond": [17, 18], "dictionari": 17, "avail": 17, "its": 17, "process": 17, "configur": 17, "handl": 17, "awar": 17, "concaten": [17, 21], "qa": [17, 21], "nosourc": 17, "en": 17, "prompttempl": 17, "llama2": 17, "respect": 17, "classvar": 17, "computedfieldinfo": 17, "comput": 17, "field": 17, "configdict": 17, "should": [14, 17, 18, 20], "conform": 17, "pydant": 17, "fieldinfo": 17, "annot": 17, "requir": [14, 17], "union": 17, "nonetyp": 17, "exclud": 17, "repr": 17, "defin": 17, "replac": 17, "__fields__": 17, "v1": 17, "classmethod": 17, "v": 17, "valid": 17, "basemodel": 17, "kwarg": [17, 21], "json": 17, "overwrit": 17, "valueerror": 17, "5000": 17, "400": 17, "recurs": 17, "priorit": 17, "so": 17, "overlap": 17, "concat": 17, "load_prompt": 17, "travers": 17, "tree": 17, "current_path": 17, "until": 17, "found": 17, "time": 17, "root": [17, 20], "reach": 17, "filenotfounderror": 17, "rais": 17, "point": 17, "typic": 17, "locat": [17, 20], "cannot": 17, "load_env": 17, "configpars": 17, "call": 17, "read": 17, "nn": [17, 21], "seper": [17, 21], "join": [17, 21], "abstract": 18, "abc": 18, "bar": 18, "tupl": 18, "localhost": 18, "arxiv": 18, "hkunlp": 18, "ip": 18, "deriv": 18, "embedding_modelnam": 18, "chromadb": 18, "httpclient": 18, "api": 18, "langchain_commun": 18, "wrapper": 18, "print": 18, "statu": 18, "random": 18, "integ": 18, "aliv": 18, "read_onli": 18, "core": 18, "differ": 19, "root_path": 20, "attempt": 20, "build": 20, "project": 20, "cmake": 20, "where": [14, 20], "repo_id": 20, "co": 20, "copi": [14, 20], "completedprocess": 20, "pull": 20, "updat": 20, "subprocess": 20, "oper": 20, "model_dir_path": 20, "output_dir": 20, "level": 20, "appli": 20, "basi": 21, "keyword": 21, "static": 21, "call_func": 21, "decor": 21, "match": 21, "relvant": 21, "packag": 22, "easi": 22, "implement": [13, 22], "augment": 22, "variou": 22, "thank": 22, "integrag": 22, "modul": [22, 23], "index": 22, "content": 23, "12": 24, "484": 24, "sphx_glr_auto_examples_basicrag_customprompt": 24, "06": 24, "935": 24, "sphx_glr_auto_examples_basicrag_refin": 24, "03": 24, "036": 24, "sphx_glr_auto_examples_basicrag_ingest": 24, "01": 24, "275": 24, "sphx_glr_auto_examples_basicrag_stuff": 24, "237": 24, "sphx_glr_auto_examples_basicrag_fewshotprompt": 24, "001": 24, "asyncio": 2, "sync": 2, "synchron": 2, "slow": 2, "new_pap": 2, "elif": 2, "complet": 13, "open": 13, "gguf": 14, "onlin": 14, "m": 14, "command": 14, "user": 14, "want": 14, "here": [], "instruct": 14, "final": 14, "recommend": 14, "q4_k_m": 14}, "objects": {"": [[16, 0, 0, "-", "grag"]], "grag": [[17, 0, 0, "-", "components"], [19, 0, 0, "-", "prompts"], [20, 0, 0, "-", "quantize"], [21, 0, 0, "-", "rag"]], "grag.components": [[17, 0, 0, "-", "embedding"], [17, 0, 0, "-", "llm"], [17, 0, 0, "-", "multivec_retriever"], [17, 0, 0, "-", "parse_pdf"], [17, 0, 0, "-", "prompt"], [17, 0, 0, "-", "text_splitter"], [17, 0, 0, "-", "utils"], [18, 0, 0, "-", "vectordb"]], "grag.components.embedding": [[17, 1, 1, "", "Embedding"]], "grag.components.embedding.Embedding": [[17, 2, 1, "", "embedding_function"], [17, 2, 1, "", "embedding_model"], [17, 2, 1, "", "embedding_type"]], "grag.components.llm": [[17, 1, 1, "", "LLM"]], "grag.components.llm.LLM": [[17, 2, 1, "", "device_map"], [17, 3, 1, "", "hf_pipeline"], [17, 3, 1, "", "llama_cpp"], [17, 3, 1, "", "load_model"], [17, 2, 1, "", "max_new_tokens"], [17, 4, 1, "id0", "model_name"], [17, 4, 1, "", "model_path"], [17, 2, 1, "", "n_batch"], [17, 2, 1, "", "n_ctx"], [17, 2, 1, "", "n_gpu_layers"], [17, 2, 1, "", "task"], [17, 2, 1, "", "temperature"]], "grag.components.multivec_retriever": [[17, 1, 1, "", "Retriever"]], "grag.components.multivec_retriever.Retriever": [[17, 3, 1, "", "aadd_docs"], [17, 3, 1, "", "add_docs"], [17, 3, 1, "", "aget_chunk"], [17, 3, 1, "", "aget_doc"], [17, 3, 1, "", "aingest"], [17, 3, 1, "", "gen_doc_ids"], [17, 3, 1, "", "get_chunk"], [17, 3, 1, "", "get_doc"], [17, 3, 1, "", "get_docs_from_chunks"], [17, 3, 1, "", "id_gen"], [17, 2, 1, "", "id_key"], [17, 3, 1, "", "ingest"], [17, 2, 1, "", "namespace"], [17, 2, 1, "", "retriever"], [17, 3, 1, "", "split_docs"], [17, 2, 1, "", "splitter"], [17, 2, 1, "", "store"], [17, 2, 1, "", "store_path"], [17, 2, 1, "", "top_k"], [17, 2, 1, "", "vectordb"]], "grag.components.parse_pdf": [[17, 1, 1, "", "ParsePDF"]], "grag.components.parse_pdf.ParsePDF": [[17, 2, 1, "", "add_caption_first"], [17, 2, 1, "", "add_captions_to_blocks"], [17, 2, 1, "", "add_captions_to_text"], [17, 3, 1, "", "classify"], [17, 2, 1, "", "extract_image_block_types"], [17, 2, 1, "", "extract_images"], [17, 2, 1, "", "image_output_dir"], [17, 2, 1, "", "infer_table_structure"], [17, 3, 1, "", "load_file"], [17, 3, 1, "", "partition"], [17, 3, 1, "", "process_images"], [17, 3, 1, "", "process_tables"], [17, 3, 1, "", "process_text"], [17, 2, 1, "", "single_text_out"], [17, 2, 1, "", "strategy"], [17, 3, 1, "", "text_concat"]], "grag.components.prompt": [[17, 1, 1, "", "FewShotPrompt"], [17, 1, 1, "", "Prompt"]], "grag.components.prompt.FewShotPrompt": [[17, 2, 1, "", "doc_chain"], [17, 2, 1, "id2", "example_template"], [17, 2, 1, "id3", "examples"], [17, 2, 1, "", "filepath"], [17, 2, 1, "id1", "input_keys"], [17, 2, 1, "", "language"], [17, 2, 1, "", "llm_type"], [17, 2, 1, "", "model_computed_fields"], [17, 2, 1, "", "model_config"], [17, 2, 1, "", "model_fields"], [17, 2, 1, "", "name"], [17, 2, 1, "", "output_keys"], [17, 2, 1, "id4", "prefix"], [17, 2, 1, "", "source"], [17, 2, 1, "id5", "suffix"], [17, 2, 1, "", "task"], [17, 3, 1, "", "validate_examples"], [17, 3, 1, "", "validate_output_keys"]], "grag.components.prompt.Prompt": [[17, 2, 1, "id6", "doc_chain"], [17, 2, 1, "id7", "filepath"], [17, 3, 1, "", "format"], [17, 2, 1, "id8", "input_keys"], [17, 2, 1, "id9", "language"], [17, 2, 1, "id10", "llm_type"], [17, 3, 1, "", "load"], [17, 2, 1, "", "model_computed_fields"], [17, 2, 1, "", "model_config"], [17, 2, 1, "", "model_fields"], [17, 2, 1, "id11", "name"], [17, 2, 1, "", "prompt"], [17, 3, 1, "", "save"], [17, 2, 1, "id12", "source"], [17, 2, 1, "id13", "task"], [17, 2, 1, "", "template"], [17, 3, 1, "", "validate_doc_chain"], [17, 3, 1, "", "validate_input_keys"], [17, 3, 1, "", "validate_task"]], "grag.components.text_splitter": [[17, 1, 1, "", "TextSplitter"]], "grag.components.text_splitter.TextSplitter": [[17, 2, 1, "", "chunk_overlap"], [17, 2, 1, "", "chunk_size"], [17, 2, 1, "", "text_splitter"]], "grag.components.utils": [[17, 5, 1, "", "find_config_path"], [17, 5, 1, "", "get_config"], [17, 5, 1, "", "stuff_docs"]], "grag.components.vectordb": [[18, 0, 0, "-", "base"], [18, 0, 0, "-", "chroma_client"], [18, 0, 0, "-", "deeplake_client"]], "grag.components.vectordb.base": [[18, 1, 1, "", "VectorDB"]], "grag.components.vectordb.base.VectorDB": [[18, 3, 1, "", "aadd_docs"], [18, 3, 1, "", "add_docs"], [18, 3, 1, "", "aget_chunk"], [18, 3, 1, "", "delete"], [18, 3, 1, "", "get_chunk"]], "grag.components.vectordb.chroma_client": [[18, 1, 1, "", "ChromaClient"]], "grag.components.vectordb.chroma_client.ChromaClient": [[18, 3, 1, "", "aadd_docs"], [18, 3, 1, "", "add_docs"], [18, 3, 1, "", "aget_chunk"], [18, 2, 1, "", "client"], [18, 2, 1, "", "collection"], [18, 2, 1, "", "collection_name"], [18, 3, 1, "", "delete"], [18, 2, 1, "", "embedding_function"], [18, 2, 1, "", "embedding_model"], [18, 2, 1, "", "embedding_type"], [18, 3, 1, "", "get_chunk"], [18, 2, 1, "", "host"], [18, 2, 1, "", "langchain_client"], [18, 2, 1, "", "port"], [18, 3, 1, "", "test_connection"]], "grag.components.vectordb.deeplake_client": [[18, 1, 1, "", "DeepLakeClient"]], "grag.components.vectordb.deeplake_client.DeepLakeClient": [[18, 3, 1, "", "aadd_docs"], [18, 3, 1, "", "add_docs"], [18, 3, 1, "", "aget_chunk"], [18, 2, 1, "", "client"], [18, 2, 1, "", "collection"], [18, 3, 1, "", "delete"], [18, 2, 1, "", "embedding_function"], [18, 2, 1, "", "embedding_model"], [18, 2, 1, "", "embedding_type"], [18, 3, 1, "", "get_chunk"], [18, 2, 1, "", "langchain_client"], [18, 2, 1, "", "store_path"]], "grag.quantize": [[20, 0, 0, "-", "quantize"], [20, 0, 0, "-", "utils"]], "grag.quantize.utils": [[20, 5, 1, "", "building_llamacpp"], [20, 5, 1, "", "fetch_model_repo"], [20, 5, 1, "", "get_llamacpp_repo"], [20, 5, 1, "", "quantize_model"]], "grag.rag": [[21, 0, 0, "-", "basic_rag"]], "grag.rag.basic_rag": [[21, 1, 1, "", "BasicRAG"]], "grag.rag.basic_rag.BasicRAG": [[21, 2, 1, "", "custom_prompt"], [21, 4, 1, "id0", "doc_chain"], [21, 2, 1, "", "llm_kwargs"], [21, 4, 1, "id1", "model_name"], [21, 3, 1, "", "output_parser"], [21, 3, 1, "", "prompt_matcher"], [21, 3, 1, "", "refine_call"], [21, 2, 1, "", "retriever_kwargs"], [21, 3, 1, "", "stuff_call"], [21, 3, 1, "", "stuff_docs"], [21, 4, 1, "id2", "task"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"custom": [0, 1], "prompt": [0, 1, 17, 19], "few": 1, "shot": 1, "document": [2, 22], "ingest": [2, 15], "refin": 3, "chain": [3, 4], "stuff": 4, "basic": [5, 21], "rag": [5, 21], "cookbook": [5, 7, 10], "comput": [6, 9, 24], "time": [6, 9, 24], "retriev": [7, 8, 13, 17], "gui": [7, 8], "get": 11, "start": 11, "instal": 12, "llm": [14, 17], "To": 14, "run": 14, "us": 14, "huggingfac": 14, "llamacpp": 14, "how": 14, "quantiz": [14, 20], "model": 14, "vector": 15, "store": 15, "support": 15, "chroma": [15, 18], "embed": [15, 17], "data": 15, "grag": [13, 16, 22, 23], "modul": [16, 17, 18, 19, 20, 21], "content": [16, 17, 18, 19, 20, 21, 22], "compon": 17, "vectordb": [17, 18], "pars": 17, "pdf": 17, "text": 17, "splitter": 17, "util": [17, 20], "submodul": [18, 20, 21], "base": 18, "client": 18, "deeplak": 18, "welcom": 22, "": 22, "indic": 22, "tabl": 22, "overview": 13, "augment": 13, "gener": 13}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx": 60}, "alltitles": {"Custom Prompts": [[0, "custom-prompts"]], "Custom Few-Shot Prompts": [[1, "custom-few-shot-prompts"]], "Document Ingestion": [[2, "document-ingestion"]], "Refine Chain": [[3, "refine-chain"]], "Stuff Chain": [[4, "stuff-chain"]], "Basic-RAG Cookbooks": [[5, "basic-rag-cookbooks"]], "Computation times": [[6, "computation-times"], [9, "computation-times"], [24, "computation-times"]], "Retriever-GUI Cookbooks": [[7, "retriever-gui-cookbooks"]], "Retriever GUI": [[8, "retriever-gui"]], "Cookbooks": [[10, "cookbooks"]], "Get Started": [[11, "get-started"]], "Installation": [[12, "installation"]], "Vector Stores": [[15, "vector-stores"]], "Supported Vector Stores": [[15, "supported-vector-stores"]], "Chroma": [[15, "chroma"]], "Embeddings": [[15, "embeddings"]], "Data Ingestion": [[15, "data-ingestion"]], "GRAG": [[16, "grag"]], "Module contents": [[16, "module-grag"], [17, "module-grag.components"], [18, "module-grag.components.vectordb"], [19, "module-grag.prompts"], [20, "module-grag.quantize"], [21, "module-grag.rag"]], "Components": [[17, "components"]], "VectorDB": [[17, "vectordb"], [18, "vectordb"]], "Embedding": [[17, "module-grag.components.embedding"]], "LLM": [[17, "module-grag.components.llm"]], "Retriever": [[17, "module-grag.components.multivec_retriever"]], "Parse PDF": [[17, "module-grag.components.parse_pdf"]], "Prompt": [[17, "module-grag.components.prompt"]], "Text Splitter": [[17, "module-grag.components.text_splitter"]], "Utils": [[17, "module-grag.components.utils"], [20, "module-grag.quantize.utils"]], "Submodules": [[18, "submodules"], [20, "submodules"], [21, "submodules"]], "Base": [[18, "module-grag.components.vectordb.base"]], "Chroma Client": [[18, "module-grag.components.vectordb.chroma_client"]], "Deeplake Client": [[18, "module-grag.components.vectordb.deeplake_client"]], "Prompts": [[19, "prompts"]], "Quantize": [[20, "quantize"], [20, "id1"]], "RAG": [[21, "rag"]], "Basic RAG": [[21, "module-grag.rag.basic_rag"]], "Welcome to GRAG\u2019s documentation!": [[22, "welcome-to-grag-s-documentation"]], "Contents:": [[22, null]], "Indices and tables": [[22, "indices-and-tables"]], "grag": [[23, "grag"]], "GRAG Overview": [[13, "grag-overview"]], "Retrieval-Augmented Generation": [[13, "retrieval-augmented-generation"]], "LLMs": [[14, "llms"]], "To run LLMs using HuggingFace": [[14, "to-run-llms-using-huggingface"]], "To run LLMs using LlamaCPP": [[14, "to-run-llms-using-llamacpp"]], "How to quantize models.": [[14, "how-to-quantize-models"]]}, "indexentries": {"grag": [[16, "module-grag"]], "module": [[16, "module-grag"], [17, "module-grag.components"], [17, "module-grag.components.embedding"], [17, "module-grag.components.llm"], [17, "module-grag.components.multivec_retriever"], [17, "module-grag.components.parse_pdf"], [17, "module-grag.components.prompt"], [17, "module-grag.components.text_splitter"], [17, "module-grag.components.utils"], [18, "module-grag.components.vectordb"], [18, "module-grag.components.vectordb.base"], [18, "module-grag.components.vectordb.chroma_client"], [18, "module-grag.components.vectordb.deeplake_client"], [19, "module-grag.prompts"], [20, "module-grag.quantize"], [20, "module-grag.quantize.quantize"], [20, "module-grag.quantize.utils"], [21, "module-grag.rag"], [21, "module-grag.rag.basic_rag"]], "embedding (class in grag.components.embedding)": [[17, "grag.components.embedding.Embedding"]], "fewshotprompt (class in grag.components.prompt)": [[17, "grag.components.prompt.FewShotPrompt"]], "llm (class in grag.components.llm)": [[17, "grag.components.llm.LLM"]], "parsepdf (class in grag.components.parse_pdf)": [[17, "grag.components.parse_pdf.ParsePDF"]], "prompt (class in grag.components.prompt)": [[17, "grag.components.prompt.Prompt"]], "retriever (class in grag.components.multivec_retriever)": [[17, "grag.components.multivec_retriever.Retriever"]], "textsplitter (class in grag.components.text_splitter)": [[17, "grag.components.text_splitter.TextSplitter"]], "aadd_docs() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.aadd_docs"]], "add_caption_first (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.add_caption_first"]], "add_captions_to_blocks (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.add_captions_to_blocks"]], "add_captions_to_text (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.add_captions_to_text"]], "add_docs() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.add_docs"]], "aget_chunk() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.aget_chunk"]], "aget_doc() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.aget_doc"]], "aingest() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.aingest"]], "chunk_overlap (grag.components.text_splitter.textsplitter attribute)": [[17, "grag.components.text_splitter.TextSplitter.chunk_overlap"]], "chunk_size (grag.components.text_splitter.textsplitter attribute)": [[17, "grag.components.text_splitter.TextSplitter.chunk_size"]], "classify() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.classify"]], "device_map (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.device_map"]], "doc_chain (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.doc_chain"]], "doc_chain (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.doc_chain"], [17, "id6"]], "embedding_function (grag.components.embedding.embedding attribute)": [[17, "grag.components.embedding.Embedding.embedding_function"]], "embedding_model (grag.components.embedding.embedding attribute)": [[17, "grag.components.embedding.Embedding.embedding_model"]], "embedding_type (grag.components.embedding.embedding attribute)": [[17, "grag.components.embedding.Embedding.embedding_type"]], "example_template (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.example_template"], [17, "id2"]], "examples (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.examples"], [17, "id3"]], "extract_image_block_types (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.extract_image_block_types"]], "extract_images (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.extract_images"]], "filepath (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.filepath"]], "filepath (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.filepath"], [17, "id7"]], "find_config_path() (in module grag.components.utils)": [[17, "grag.components.utils.find_config_path"]], "format() (grag.components.prompt.prompt method)": [[17, "grag.components.prompt.Prompt.format"]], "gen_doc_ids() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.gen_doc_ids"]], "get_chunk() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.get_chunk"]], "get_config() (in module grag.components.utils)": [[17, "grag.components.utils.get_config"]], "get_doc() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.get_doc"]], "get_docs_from_chunks() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.get_docs_from_chunks"]], "grag.components": [[17, "module-grag.components"]], "grag.components.embedding": [[17, "module-grag.components.embedding"]], "grag.components.llm": [[17, "module-grag.components.llm"]], "grag.components.multivec_retriever": [[17, "module-grag.components.multivec_retriever"]], "grag.components.parse_pdf": [[17, "module-grag.components.parse_pdf"]], "grag.components.prompt": [[17, "module-grag.components.prompt"]], "grag.components.text_splitter": [[17, "module-grag.components.text_splitter"]], "grag.components.utils": [[17, "module-grag.components.utils"]], "hf_pipeline() (grag.components.llm.llm method)": [[17, "grag.components.llm.LLM.hf_pipeline"]], "id_gen() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.id_gen"]], "id_key (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.id_key"]], "image_output_dir (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.image_output_dir"]], "infer_table_structure (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.infer_table_structure"]], "ingest() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.ingest"]], "input_keys (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.input_keys"], [17, "id1"]], "input_keys (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.input_keys"], [17, "id8"]], "language (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.language"]], "language (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.language"], [17, "id9"]], "llama_cpp() (grag.components.llm.llm method)": [[17, "grag.components.llm.LLM.llama_cpp"]], "llm_type (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.llm_type"]], "llm_type (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.llm_type"], [17, "id10"]], "load() (grag.components.prompt.prompt class method)": [[17, "grag.components.prompt.Prompt.load"]], "load_file() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.load_file"]], "load_model() (grag.components.llm.llm method)": [[17, "grag.components.llm.LLM.load_model"]], "max_new_tokens (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.max_new_tokens"]], "model_computed_fields (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.model_computed_fields"]], "model_computed_fields (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.model_computed_fields"]], "model_config (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.model_config"]], "model_config (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.model_config"]], "model_fields (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.model_fields"]], "model_fields (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.model_fields"]], "model_name (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.model_name"]], "model_name (grag.components.llm.llm property)": [[17, "id0"]], "model_path (grag.components.llm.llm property)": [[17, "grag.components.llm.LLM.model_path"]], "n_batch (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.n_batch"]], "n_ctx (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.n_ctx"]], "n_gpu_layers (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.n_gpu_layers"]], "name (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.name"]], "name (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.name"], [17, "id11"]], "namespace (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.namespace"]], "output_keys (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.output_keys"]], "partition() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.partition"]], "prefix (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.prefix"], [17, "id4"]], "process_images() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.process_images"]], "process_tables() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.process_tables"]], "process_text() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.process_text"]], "prompt (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.prompt"]], "retriever (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.retriever"]], "save() (grag.components.prompt.prompt method)": [[17, "grag.components.prompt.Prompt.save"]], "single_text_out (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.single_text_out"]], "source (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.source"]], "source (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.source"], [17, "id12"]], "split_docs() (grag.components.multivec_retriever.retriever method)": [[17, "grag.components.multivec_retriever.Retriever.split_docs"]], "splitter (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.splitter"]], "store (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.store"]], "store_path (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.store_path"]], "strategy (grag.components.parse_pdf.parsepdf attribute)": [[17, "grag.components.parse_pdf.ParsePDF.strategy"]], "stuff_docs() (in module grag.components.utils)": [[17, "grag.components.utils.stuff_docs"]], "suffix (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.suffix"], [17, "id5"]], "task (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.task"]], "task (grag.components.prompt.fewshotprompt attribute)": [[17, "grag.components.prompt.FewShotPrompt.task"]], "task (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.task"], [17, "id13"]], "temperature (grag.components.llm.llm attribute)": [[17, "grag.components.llm.LLM.temperature"]], "template (grag.components.prompt.prompt attribute)": [[17, "grag.components.prompt.Prompt.template"]], "text_concat() (grag.components.parse_pdf.parsepdf method)": [[17, "grag.components.parse_pdf.ParsePDF.text_concat"]], "text_splitter (grag.components.text_splitter.textsplitter attribute)": [[17, "grag.components.text_splitter.TextSplitter.text_splitter"]], "top_k (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.top_k"]], "validate_doc_chain() (grag.components.prompt.prompt class method)": [[17, "grag.components.prompt.Prompt.validate_doc_chain"]], "validate_examples() (grag.components.prompt.fewshotprompt class method)": [[17, "grag.components.prompt.FewShotPrompt.validate_examples"]], "validate_input_keys() (grag.components.prompt.prompt class method)": [[17, "grag.components.prompt.Prompt.validate_input_keys"]], "validate_output_keys() (grag.components.prompt.fewshotprompt class method)": [[17, "grag.components.prompt.FewShotPrompt.validate_output_keys"]], "validate_task() (grag.components.prompt.prompt class method)": [[17, "grag.components.prompt.Prompt.validate_task"]], "vectordb (grag.components.multivec_retriever.retriever attribute)": [[17, "grag.components.multivec_retriever.Retriever.vectordb"]], "chromaclient (class in grag.components.vectordb.chroma_client)": [[18, "grag.components.vectordb.chroma_client.ChromaClient"]], "deeplakeclient (class in grag.components.vectordb.deeplake_client)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient"]], "vectordb (class in grag.components.vectordb.base)": [[18, "grag.components.vectordb.base.VectorDB"]], "aadd_docs() (grag.components.vectordb.base.vectordb method)": [[18, "grag.components.vectordb.base.VectorDB.aadd_docs"]], "aadd_docs() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.aadd_docs"]], "aadd_docs() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.aadd_docs"]], "add_docs() (grag.components.vectordb.base.vectordb method)": [[18, "grag.components.vectordb.base.VectorDB.add_docs"]], "add_docs() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.add_docs"]], "add_docs() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.add_docs"]], "aget_chunk() (grag.components.vectordb.base.vectordb method)": [[18, "grag.components.vectordb.base.VectorDB.aget_chunk"]], "aget_chunk() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.aget_chunk"]], "aget_chunk() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.aget_chunk"]], "client (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.client"]], "client (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.client"]], "collection (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.collection"]], "collection (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.collection"]], "collection_name (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.collection_name"]], "delete() (grag.components.vectordb.base.vectordb method)": [[18, "grag.components.vectordb.base.VectorDB.delete"]], "delete() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.delete"]], "delete() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.delete"]], "embedding_function (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.embedding_function"]], "embedding_function (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_function"]], "embedding_model (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.embedding_model"]], "embedding_model (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_model"]], "embedding_type (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.embedding_type"]], "embedding_type (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.embedding_type"]], "get_chunk() (grag.components.vectordb.base.vectordb method)": [[18, "grag.components.vectordb.base.VectorDB.get_chunk"]], "get_chunk() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.get_chunk"]], "get_chunk() (grag.components.vectordb.deeplake_client.deeplakeclient method)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.get_chunk"]], "grag.components.vectordb": [[18, "module-grag.components.vectordb"]], "grag.components.vectordb.base": [[18, "module-grag.components.vectordb.base"]], "grag.components.vectordb.chroma_client": [[18, "module-grag.components.vectordb.chroma_client"]], "grag.components.vectordb.deeplake_client": [[18, "module-grag.components.vectordb.deeplake_client"]], "host (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.host"]], "langchain_client (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.langchain_client"]], "langchain_client (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.langchain_client"]], "port (grag.components.vectordb.chroma_client.chromaclient attribute)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.port"]], "store_path (grag.components.vectordb.deeplake_client.deeplakeclient attribute)": [[18, "grag.components.vectordb.deeplake_client.DeepLakeClient.store_path"]], "test_connection() (grag.components.vectordb.chroma_client.chromaclient method)": [[18, "grag.components.vectordb.chroma_client.ChromaClient.test_connection"]], "grag.prompts": [[19, "module-grag.prompts"]], "building_llamacpp() (in module grag.quantize.utils)": [[20, "grag.quantize.utils.building_llamacpp"]], "fetch_model_repo() (in module grag.quantize.utils)": [[20, "grag.quantize.utils.fetch_model_repo"]], "get_llamacpp_repo() (in module grag.quantize.utils)": [[20, "grag.quantize.utils.get_llamacpp_repo"]], "grag.quantize": [[20, "module-grag.quantize"]], "grag.quantize.quantize": [[20, "module-grag.quantize.quantize"]], "grag.quantize.utils": [[20, "module-grag.quantize.utils"]], "quantize_model() (in module grag.quantize.utils)": [[20, "grag.quantize.utils.quantize_model"]], "basicrag (class in grag.rag.basic_rag)": [[21, "grag.rag.basic_rag.BasicRAG"]], "custom_prompt (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.custom_prompt"]], "doc_chain (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.doc_chain"]], "doc_chain (grag.rag.basic_rag.basicrag property)": [[21, "id0"]], "grag.rag": [[21, "module-grag.rag"]], "grag.rag.basic_rag": [[21, "module-grag.rag.basic_rag"]], "llm_kwargs (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.llm_kwargs"]], "model_name (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.model_name"]], "model_name (grag.rag.basic_rag.basicrag property)": [[21, "id1"]], "output_parser() (grag.rag.basic_rag.basicrag static method)": [[21, "grag.rag.basic_rag.BasicRAG.output_parser"]], "prompt_matcher() (grag.rag.basic_rag.basicrag method)": [[21, "grag.rag.basic_rag.BasicRAG.prompt_matcher"]], "refine_call() (grag.rag.basic_rag.basicrag method)": [[21, "grag.rag.basic_rag.BasicRAG.refine_call"]], "retriever_kwargs (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.retriever_kwargs"]], "stuff_call() (grag.rag.basic_rag.basicrag method)": [[21, "grag.rag.basic_rag.BasicRAG.stuff_call"]], "stuff_docs() (grag.rag.basic_rag.basicrag static method)": [[21, "grag.rag.basic_rag.BasicRAG.stuff_docs"]], "task (grag.rag.basic_rag.basicrag attribute)": [[21, "grag.rag.basic_rag.BasicRAG.task"]], "task (grag.rag.basic_rag.basicrag property)": [[21, "id2"]]}}) \ No newline at end of file diff --git a/src/docs/_build/html/sg_execution_times.html b/src/docs/_build/html/sg_execution_times.html index 624bdb1..7d73d51 100644 --- a/src/docs/_build/html/sg_execution_times.html +++ b/src/docs/_build/html/sg_execution_times.html @@ -133,7 +133,7 @@
-

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erica Pham, Kunal Inglunkar.

+

© Copyright 2024, Arjun Bingly, Sanchit Vijay, Erika Pham, Kunal Inglunkar.

Built with Sphinx using a diff --git a/src/docs/get_started.introduction.rst b/src/docs/get_started.introduction.rst index fbfe17e..2bfccbd 100644 --- a/src/docs/get_started.introduction.rst +++ b/src/docs/get_started.introduction.rst @@ -4,5 +4,4 @@ GRAG Overview GRAG provides an implementation of Retrieval-Augmented Generation that is completely open-sourced. Retrieval-Augmented Generation -################### - +############################### diff --git a/src/docs/get_started.llms.rst b/src/docs/get_started.llms.rst index 5ed47dc..2157fb8 100644 --- a/src/docs/get_started.llms.rst +++ b/src/docs/get_started.llms.rst @@ -1,14 +1,14 @@ LLMs ===== -GRAG offers two ways to run LLMs locally, +GRAG offers two ways to run LLMs locally: 1. LlamaCPP 2. HuggingFace To run LLMs using HuggingFace ############################# -This is the easiest way to get started but does not offer as much +This is the easiest way to get started, but does not offer as much flexibility. If using a config file (*config.ini*), just change the `model_name` to to the HuggingFace repo id. *Note that if the models are gated, make sure to @@ -16,22 +16,22 @@ provide an auth token* To run LLMs using LlamaCPP ############################# -Steps to start with llama.cpp: +LlamaCPP requires models in the form of `.gguf` file. You can either download these model files online, +or -1. Clone the `llama.cpp `_ repository. - ``git clone https://github.com/ggerganov/llama.cpp.git`` -2. Change directory to `llama.cpp` using `cd llama.cpp` -3. To inference using GPU, which is necessary for most models. - * Make sure you have CUDA installed (check using ``nvcc --version``) - * Follow steps from the `llama.cpp documentation `_. +How to quantize models. +************************ +To quantize the model, run: + ``python -m grag.quantize.quantize`` -*Note: While inferencing if model is not utilizing GPU check the `BLAS=1` in the outputs and* -*if it is not then try reinstalling using*:: +After running the above command, user will be prompted with the following: - CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir +1. **Path** where the user wants to clone the `llama.cpp` repo. You can find the repository, `llama.cpp `_. -*or follow the solution provided by* -`this Stack Overflow post `_ +2. Input the **model path**: -How to quantize models. -************************ +* If user wants to download a model from `HuggingFace `_, the user should provide the repository path from HuggingFace. + +* If the user has the model downloaded locally, then user will be instructed to copy the model and input the name of the model directory. + +3.Finally, the user will be prompted to enter **quantization** settings (recommended Q5_K_M or Q4_K_M, etc.). For more details, check `llama.cpp/examples/quantize/quantize.cpp `_.