somnath-das commited on
Commit
054210d
Β·
verified Β·
1 Parent(s): 02fd9ab

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +132 -3
README.md CHANGED
@@ -1,3 +1,132 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+ # OnLLM 🧠
6
+ OnLLM is the platform to run `Large Language Model` (LLM) or SLM models using `OnnxRuntime` directly on low-end devices like low power computers, mobile phones etc. It is cross-platform using Kivy & open-source.
7
+
8
+ > The name is derived from: `On` from Onnx + `LLM`. Our approach is always local & offline first (you will need internet to download the model files for the first time). Arificial Intelligence (AI) to be accesible to everyone.
9
+
10
+ ### Features
11
+ 1. βœ…οΈ An inbuild chatbot to chat with the AI model(s).
12
+ 2. βœ…οΈ A local offline RAG to query on our selected document (pdf/docx) directly in the chatbot.
13
+ 2. βœ…οΈ No trackers, no Ads, No data collection, completely Private.
14
+
15
+ [![GitHub Downloads](https://img.shields.io/github/downloads/daslearning-org/OnLLM/total)](https://github.com/daslearning-org/OnLLM/releases)
16
+ [![YouTube Video Views](https://img.shields.io/youtube/views/D-KwL59GgKA)](https://www.youtube.com/watch?v=D-KwL59GgKA)
17
+
18
+ ## πŸ“½οΈ Demo
19
+ You can click on the below Image or this [Youtube Link](https://www.youtube.com/watch?v=D-KwL59GgKA) to see the demo. Please let me know in the comments, how do you feel about this App. <br>
20
+ [![OnLLM-YouTube](./docs/images/thumb.png)](https://www.youtube.com/watch?v=D-KwL59GgKA)
21
+
22
+ ## πŸ–§ Our Scematic Architecture
23
+ To be added...
24
+
25
+ ## πŸ§‘β€πŸ’» Quickstart Guide
26
+
27
+ ### πŸ“± Download & Run the Android App
28
+ You can check the [Releases](https://github.com/daslearning-org/OnLLM/tags) and downlaod the latest version of the android app (APK file) on your phone.
29
+
30
+ ### πŸ’» Download & Run the Windows or Linux App
31
+ You can check the [Releases](https://github.com/daslearning-org/OnLLM/releases) and downlaod the latest version of the application on your computer. If you are on `Windows`, download the `OnLLM_X.X.X.exe` file & double click to run it. If you are on `Linux`, download `OnLLM_Linux_XXX` file and run it.
32
+
33
+ #### Notes:
34
+ - Some Antivirus softwares might give you detection alert for the exe (happens for PyInstaller apps), you need to add an exception in that case.
35
+ - On Linux you may need to change file permission to execute it.
36
+ ```bash
37
+ chmod +x OnLLM_Linux_XXX
38
+ ./OnLLM_Linux_XXX
39
+ ```
40
+
41
+ ### 🐍 Run with Python
42
+
43
+ 1. Clone the repo
44
+ ```bash
45
+ git clone https://github.com/daslearning-org/OnLLM.git
46
+ ```
47
+
48
+ 2. Run the application
49
+ ```bash
50
+ cd OnLLM/app/
51
+ pip install -r requirements.txt # virtual environment is recommended
52
+ python main.py
53
+ ```
54
+
55
+ ## 🦾 Build your own App
56
+ The Kivy project has a great tool named [Buildozer](https://buildozer.readthedocs.io/en/latest/) which can make mobile apps for `Android` & `iOS`
57
+
58
+ ### πŸ“± Build Android App
59
+ A Linux environment is recommended for the app development. If you are on Windows, you may use `WSL` or any `Virtual Machine`. As of now the `buildozer` tool works on Python version `3.11` at maximum. I am going to use Python `3.11`
60
+
61
+ #### Install Rust & Add that in path
62
+ ```bash
63
+ curl https://sh.rustup.rs -sSf | sh # then follow the prompt
64
+ export PATH="$HOME/.cargo/bin:$PATH"
65
+ # optional
66
+ rustup default stable
67
+ ```
68
+
69
+ #### Install other dependencies & build APK
70
+ ```bash
71
+ # add the python repository
72
+ sudo add-apt-repository ppa:deadsnakes/ppa
73
+ sudo apt update
74
+
75
+ # install all dependencies.
76
+ sudo apt install -y ant autoconf automake ccache cmake g++ gcc libbz2-dev libffi-dev libltdl-dev libtool libssl-dev lbzip2 make ninja-build openjdk-17-jdk patch patchelf pkg-config protobuf-compiler python3.11 python3.11-venv python3.11-dev
77
+
78
+ # optionally we can default to python 3.11
79
+ sudo ln -sf /usr/bin/python3.11 /usr/bin/python3
80
+ sudo ln -sf /usr/bin/python3.11 /usr/bin/python
81
+ sudo ln -sf /usr/bin/python3.11-config /usr/bin/python3-config
82
+
83
+ # optionally you may check the java installation with below commands
84
+ java -version
85
+ javac -version
86
+
87
+ # install python modules
88
+ git clone https://github.com/daslearning-org/OnLLM.git
89
+ cd OnLLM/app/
90
+ python3.11 -m venv .env # create python virtual environment
91
+ source .env/bin/activate
92
+ pip install -r req_android.txt
93
+
94
+ # build the android apk
95
+ buildozer android debug # this may take a good amount of time for the first time & will generate the apk in the bin directory
96
+ ```
97
+
98
+ ### πŸ–³ Build Computer Application (Windows / Linux / MacOS)
99
+ A `Python` virtual environment is recommended and will use `PyInstaller` to package it.
100
+
101
+ ```bash
102
+ # install pyinstaller
103
+ git clone https://github.com/daslearning-org/OnLLM.git
104
+ cd OnLLM/app/
105
+ python3.11 -m venv .env # create python virtual environment
106
+ source .env/bin/activate
107
+ pip install -r requirements.txt
108
+ pip install pyinstaller
109
+
110
+ # then update the spec file as needed
111
+ # then build your app which will be native to the OS i.e. Linux or Windows or MAC
112
+ pyinstaller desktopApp.spec
113
+ ```
114
+
115
+ ## πŸ”— LLM Models used in this project
116
+
117
+ ### LLM (QA) models:
118
+ The models are being taken from different sources & below are the models available as on today. Size is the compressed size (approax). Few models which are marked with warning (⚠️) symbol may be very slow or unresponsive on `Android` or low power devices.
119
+
120
+ | Model | Size | Android | Desktop |
121
+ | :---- | :--- | :-----: | :-----: |
122
+ | [SmolLM2-135M](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) | 95MB | βœ…οΈ | βœ…οΈ |
123
+ | [SmolLM2-360M](https://huggingface.co/HuggingFaceTB/SmolLM2-360M-Instruct) | 241MB | βœ…οΈ | βœ…οΈ |
124
+ | [Gemma3-1B](https://huggingface.co/onnx-community/gemma-3-1b-it-ONNX) | 645MB | ⚠️ | βœ…οΈ |
125
+
126
+ ### Embed models (Document RAG):
127
+ It follows the same priciples as above.
128
+
129
+ | Model | Size | Android | Desktop |
130
+ | :---- | :--- | :-----: | :-----: |
131
+ | [all-MiniLM-L6-V2](https://huggingface.co/onnx-models/all-MiniLM-L6-v2-onnx) | 85MB | βœ…οΈ | βœ…οΈ |
132
+