Skip to content

A very basic first attempt at RAG with ollama and Phi-3 Mini

Notifications You must be signed in to change notification settings

mcleodchris/rag-experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Local) RAG Experiment

A python script that is an experiment in using local files to augment querying a LLM (or SLM, in this case). Uses ollama and the phi3:mini model. Should be able to parse HTML, PDF, and text files, but I've only tried with HTML so far.

Runs on a Raspberry Pi 5, but is painfully slow at the moment:

  • takes a couple of minutes to tokenise the input files (a few hundred HTML files in my case)
  • can take several minutes to return an answer, depending on the query

I'd like to improve this performance one day. The idea of having an "at-home" chatbot able to pull info from my personal files sounds appealing.

Outputs the full input and API response for debugging purposes.

Built using ChatGPT (4o) and GitHub Copilot, as I've preciously only written ~20 lines of basic python code, so there's probably plenty scope for optimisation.

To get started:

  1. Install ollama
  2. Pull the Phi3-Mini model
  3. Add a .env file. Set DOCS_LOCATION=<path to your source files>
  4. Install the script dependencies: pip install -r requirements.txt
  5. Run python dingus.py

About

A very basic first attempt at RAG with ollama and Phi-3 Mini

Topics

Resources

Stars

Watchers

Forks

Languages