Coder Social home page Coder Social logo

thesanjithkumar / local-rag-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonfairbanks/local-rag

0.0 0.0 0.0 24.15 MB

Ingest files for retrieval augmented generation (RAG) with open-source Large Language Models (LLMs), all without 3rd parties or sensitive data leaving your network.

License: GNU General Public License v3.0

Python 97.57% Dockerfile 2.43%

local-rag-example's Introduction

๐Ÿ“š Local RAG

local-rag-demo

GitHub commit activity GitHub last commit GitHub License

Offline, Open-Source RAG

Ingest files for retrieval augmented generation (RAG) with open-source Large Language Models (LLMs), all without 3rd parties or sensitive data leaving your network.

  • Offline Embeddings & LLMs Support (No OpenAI!)
  • Streaming Responses
  • Conversation Memory
  • Chat Export

Pre-Requisites

  • A pre-existing Ollama instance
  • Python 3.10+

Setup

Local:

  • pip install pipenv && pipenv install
  • pipenv shell && streamlit run main.py

Docker:

  • docker compose up -d

Usage

  • Set your Ollama endpoint and model under Settings
  • Upload your documents for processing
  • Once complete, ask questions based on your documents!

To Do

  • Refactor into modules
  • Refactor file processing logic
  • Migrate Chat Stream to Llama-Index
  • Implement Llama-Index Chat Engine with Memory
  • Swap to Llama-Index Chat Engine
  • Function to Handle File Embeddings
  • Allow Users to Set LLM Settings
    • System Prompt
    • Chat Mode
    • top_k
    • chunk_size
    • chunk_overlap
  • Allow Switching of Embedding Model & Settings
  • Delete Files after Index Created/Failed
  • Support Additional Import Options
    • GitHub Repos
    • Websites
  • Remove File Type Limitations for Uploads
  • Show Loaders in UI (File Uploads, Conversions, ...)
  • Export Data (Uploaded Files, Chat History, ...)
  • View and Manage Imported Files
  • About Tab in Sidebar
  • Docker Support
  • Implement Log Library
  • Improve Logging
  • Re-write Docstrings
  • Additional Error Handling
    • Starting a chat without an Ollama model set
    • Incorrect GitHub repos

Known Issues & Bugs

  • Refreshing the page loses all state (expected Streamlit behavior; need to implement local-storage)
  • Files can be uploaded before Ollama config is set, leading to embedding errors
  • Assuming Ollama is hosted on localhost, Models are automatically loaded and selected, but the dropdown does not render the selected option
  • Upon sending a Chat message, the File Processing expander appears to re-run itself (seems something is not using state correctly)

Resources

local-rag-example's People

Contributors

jonfairbanks avatar imgbotapp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.