An open API service indexing awesome lists of open source software.

https://github.com/sergiopaniego/rag_local_tutorial

Simple RAG tutorials that can be run locally or using Google Colab (only Pro version).
https://github.com/sergiopaniego/rag_local_tutorial

google-colab langchain llama-index llm ollama open-source rag tutorial whisper

Last synced: 9 months ago
JSON representation

Simple RAG tutorials that can be run locally or using Google Colab (only Pro version).

Awesome Lists containing this project

README

          

# Tutorials for RAG usage with an LLM locally or in Google Colab

Simple RAG tutorials that can be run locally with an LLM or using Google Colab (only Pro version).

These notebooks can be executed locally or in Google Colab.
Either way, you have to install Ollama to run it.

RAG diagram

# Tutorials

* [Extracting details from a file (PDF) using RAG](./example_rag.ipynb)
Open In Colab

* [Extracting details from a YouTube video using RAG](./youtube_rag.ipynb)
Open In Colab

* [Extracting details from an audio using RAG](./whisper_rag.ipynb)
Open In Colab

* [Extracting details from a GitHub repo using RAG](./github_repo_rag.ipynb)
Open In Colab

# Technologies used

For these tutorials, we use LangChain, LlamaIndex, and HuggingFace for generating the RAG application code, Ollama for serving the LLM model, and a Jupyter or Google Colab notebook.


Langchain Logo
LlamaIndex Logo
HuggingFace Logo
Ollama Logo
Jupyter Logo
Google Colab Logo

# Intructions to run the example locally

* Download and install Ollama:

Go to this URL and install it: https://ollama.com/download

* Pull the LLM model. In this case, llama3:

```
ollama pull llama3
```

More details about llama3 in the [official release blog](https://llama.meta.com/llama3/) and in [Ollama documentation](https://ollama.com/library/llama3).

# Intructions to run the example using Google Colab (Pro account needed)

* Install Ollama from the command line:

(Press the button on the bottom-left part of the notebook to open a Terminal)

```
curl -fsSL https://ollama.com/install.sh | sh
```

* Pull the LLM model. In this case, llama3

```
ollama serve & ollama pull llama3
```

* Serve the model locally so the code can access it.

```
ollama serve & ollama run llama3
```

If an error is raised related to docarray, refer to this solution: https://stackoverflow.com/questions/76880224/error-using-using-docarrayinmemorysearch-in-langchain-could-not-import-docarray