Code Monkey home page Code Monkey logo

local-rag-chatbot's Introduction

Local Chatbot Using LM Studio, Chroma DB, and LangChain

The idea for this work stemmed from the requirements related to data privacy in hospital settings. This may be true for many use cases. The outcome of this work is a private conversational agent that runs on the local machine. Here are some details:

LLMs

It can use any LLM from LM Studio. Just change the LLM from LM studio GUI and rerun the server. I am currently using Mistral 7B.

Vector DB

For the Retrieval Augmented Generation (RAG) component, I am using Chroma DB. You may any others.

Embeddings

For the embeddings, I am using sentence-transformers through langchain/HugginFace. These can be switched easily.

Installation and Use

  1. Install miniconda. Download from https://docs.anaconda.com/free/miniconda/index.html
  2. Create a conda environment and activate it.
conda create --name testing-123 python=3.10
conda activate testing-123
  1. Install requirements.
pip install -r requirements.txt
  1. Install LM Studio. Use the following link: https://lmstudio.ai/
  2. Download some LLMs by searching and selecting from the LM studio search panel. I experimented with (1) llama-2-7b-chat.Q8_0.gguf and (2) mistral-7b-instruct-v0.2.Q6_K.gguf.
  3. Run the LM Studio server. Accept all default options.
  4. Create a vector database from PDF files by running the vector-db-create.py. Please specify the appropriate path for the PDF file.
  5. Run qa-only.py. This will help you take care of any errors that may pop up.
  6. Run the conversational agent using the script in RAG-chatbot.py.

local-rag-chatbot's People

Contributors

grasool 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.