kotaemon icon indicating copy to clipboard operation
kotaemon copied to clipboard

Steps I took to get local app working

Open bfdykstra opened this issue 1 year ago • 9 comments

Hey there! Super cool project. Thought I'd add some of the (yet to be documented) steps that I took to get the application working on my macbook pro with an M1 chip.

I did not use the docker image because it is out of date and because it does not match my amd64 platform

  1. Cloned repo
git clone https://github.com/Cinnamon/kotaemon
cd kotaemon
  1. Create virtual environment and activate it
python -m venv kotaemon-env

source kotaemon-env/bin/activate
  1. add "unstructured==0.15.8" to the dependency array of libs/kotaemon/pyproject.toml
  2. brew install libmagic
  3. open a python session and run
import nltk
nltk.download('averaged_perceptron_tagger')

sources: https://www.nltk.org/data.html https://stackoverflow.com/questions/35861482/nltk-lookup-error

pip install -e "libs/kotaemon[all]"
pip install -e "libs/ktem"
  1. Start up the app using python app.py
  2. SET YOUR API KEYS IN THE APPLICATION, NOT THE .env!!!! Do this for both the LLM resource and the embedding resource
Screenshot 2024-08-27 at 8 48 24 PM

Hope this helps someone else! I've been having a lot of fun using this.

I can add a PR documenting these steps and adding system requirements

bfdykstra avatar Aug 28 '24 03:08 bfdykstra

Thank you so much for the guide ! As the team is small and doesn't have much time dedicated to this (I myself am just a former contributor and no longer a member of the team), this kind of help is highly appreciated 🙇🏼

Yes, please add a PR updating the docs. These are installation instructions for developers so they should go into the README file. It would be nice if you could integrate steps 4->6 right into the code, as our goal is to make it as easy as possible for anyone to set up the app.

Furthermore, we have one-click installation scripts in scripts targeted to non-tech end-users (which we took inspiration from oobabooga/text-generation-webui. So if you have the time and interest, please also update the scripts as well.

lone17 avatar Aug 28 '24 04:08 lone17

Oh, about step 10, setting the keys within the UI is indeed recommended over editing the .env file. The .env file is there to serve use cases where users want to pre-config the models before starting up the app (e.g., deploy the app on HF hub). The file will only be used to populate the db once upon the first run; it will no longer be used in subsequent runs.

lone17 avatar Aug 28 '24 04:08 lone17

Thank you so much for the guide ! As the team is small and doesn't have much time dedicated to this (I myself am just a former contributor and no longer a member of the team), this kind of help is highly appreciated 🙇🏼

Yes, please add a PR updating the docs. These are installation instructions for developers so they should go into the README file. It would be nice if you could integrate steps 4->6 right into the code, as our goal is to make it as easy as possible for anyone to set up the app.

Furthermore, we have one-click installation scripts in scripts targeted to non-tech end-users (which we took inspiration from oobabooga/text-generation-webui. So if you have the time and interest, please also update the scripts as well.

Sweet! I'll see what I can do :)

bfdykstra avatar Aug 28 '24 18:08 bfdykstra

@lone17 Is there a reason that you guys favor using conda?

bfdykstra avatar Aug 28 '24 19:08 bfdykstra

@bfdykstra it was to make the installation self-contained, we wanted to make the app reside entirely within a single folder so that it's easier to manage especially for non-tech users. Moreover, in the case of the one-click installation package, using conda allows us to control the environment and does not interfere with any existing environments in the user's machine. (This decision is also inspired by oobabooga/text-generation-webui)

lone17 avatar Aug 29 '24 02:08 lone17

please help me how to set-up hugging-face models, or ollama

himanshushukla12 avatar Aug 29 '24 11:08 himanshushukla12

Hi @himanshushukla12, check this guide to use Ollama or HF model through text-generation-webui: https://github.com/Cinnamon/kotaemon/blob/main/docs/local_model.md

taprosoft avatar Aug 31 '24 02:08 taprosoft

@taprosoft follow the steps above to get local ollama but no luck. gemma2:2b works fine in ollama

Index Collection

embedding: ollama
max_file_size: 1000
max_number_of_files: 0
private: false
supported_file_types: .png, .jpeg, .jpg, .tiff, .tif, .pdf, .xls, .xlsx, .doc, .docx,
  .pptx, .csv, .html, .mhtml, .txt, .zip

LLM (ollama set to default)

api_key: ollama
base_url: http://localhost:11434/v1/
model: gemma2:2b

Embeddings

api_key: ollama
base_url: http://localhost:11434/v1/
model: nomic-embed-text

I have pulled botht he nomic-embed-text and gemma2:2b

image image

Niko-La avatar Sep 04 '24 05:09 Niko-La

I was able to reproduce the install via building on Linux. Obviously I skipped the brew step. The standard install of the app fails (and I opened a separate bug on that.)

Thanks for the write-up and screenshots!

vap0rtranz avatar Sep 04 '24 13:09 vap0rtranz