lauro1 commited on
Commit
1a2ff35
β€’
1 Parent(s): faca43f
Files changed (1) hide show
  1. README.md +10 -233
README.md CHANGED
@@ -1,233 +1,10 @@
1
- <a name="readme-top"></a>
2
- <br />
3
-
4
- <div align="center">
5
- <a href="https://github.com/mithril-security/blind_chat">
6
- <img src="https://github.com/mithril-security/blindai/raw/main/docs/assets/logo.png" alt="Logo" width="80" height="80">
7
- </a>
8
-
9
- <h1 align="center">BlindChat</h1>
10
-
11
- [![Website][website-shield]][website-url]
12
- [![Blog][blog-shield]][blog-url]
13
-
14
- </div>
15
-
16
- <p align="center">
17
- <b>Open-source and privacy-by-design alternative to ChatGPT</b><br /><br />
18
- <!--
19
- <a href="https://blindllama.mithrilsecurity.io/en/latest"><strong>Explore the docs Β»</strong></a>
20
- <br />
21
- <br />
22
- <a href="https://aicert.mithrilsecurity.io/en/latest/docs/getting-started/quick-tour/">Get started</a>
23
- Β·
24
- <a href="https://github.com/mithril-security/aicert/issues">Report Bug</a>
25
- Β·
26
- <a href="https://github.com/mithril-security/aicert/issues">Request Feature</a>
27
- </p>
28
- </div>
29
-
30
- <!-- TABLE OF CONTENTS -->
31
- <details>
32
- <summary>Table of Contents</summary>
33
- <ol>
34
- <li><a href="#-about-the-project">About the project</a></li>
35
- <li><a href="#-roadmap">Roadmap</a></li>
36
- <li><a href="#-design">Design</a></li>
37
- <li><a href="#-comparisons">Comparisons</a></li>
38
- <li><a href="#-get-in-touch">Contact</a></li>
39
- </ol>
40
- </details>
41
-
42
- ## πŸ“œ About the project
43
-
44
- ### What is BlindChat?
45
-
46
- 🐱 **BlindChat** is an open-source project to develop **the first fully in-browser and private Conversational AI**.
47
-
48
- Most conversational AI solutions today require users to send their data to AI providers who serve AI models as a Service. This poses privacy issues for users who **lose control over their data**.
49
-
50
- ⚠️ Because data is a key asset to improve LLMs, **many solutions more or less implicitly fine-tune users’ data to improve their model**.
51
-
52
- This creates privacy risks for users as LLMs might learn their data by heart. Carlini et al. [1] showed that LLMs such as GPT-J could learn at least 1% of their training set by heart.
53
-
54
- πŸ” BlindChat solves this issue as users have guarantees that their data remains private at all times and have full control over it, either by doing local inference or using secure isolated environments called secure enclaves.
55
-
56
- ### Local conversations
57
-
58
- ### Demo
59
-
60
- πŸ‘©β€πŸ’» You can try out BlindChat [here](https://chat.mithrilsecurity.io)! We enable users to interact with a [Flan-T5 model](https://huggingface.co/docs/transformers/model_doc/flan-t5) locally through their browser: the model is pulled and used for local inference using [transformers.js](https://huggingface.co/docs/transformers.js/index).
61
-
62
- ### Who is BlindChat for?
63
-
64
- BlindChat aims to serve two users:
65
-
66
- - **End users:** We want to provide privacy-by-design alternatives to change the current status quo. Most users today are forced to give up their data to leverage AI services, and opaque or inexistent privacy controls are the norm.
67
-
68
- - **Developers:** We want to help developers easily serve privacy-by-design Conversational AI, which is why we are focused on making BlindChat easy to customize and deploy.
69
-
70
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
71
-
72
- ## Roadmap
73
-
74
- You can check out our progress in more detail on our [official roadmap](https://github.com/orgs/mithril-security/projects/2/views/4). We highlight feature on which we would love help from contributors in our [help wanted section](https://github.com/orgs/mithril-security/projects/2/views/3).
75
-
76
- Roadmap quick summary:
77
-
78
- - [x] Revamping of Hugging Face Chat UI to make it entirely client-side (removal of telemetry, data sharing, server-side history of conversations, server-side inference, etc.)
79
- - [x] Integration of privacy-by-design inference with local model
80
- - [x] Local caching of conversations
81
- - [ ] Integration of more advanced local models (e.g. [phi-1.5](https://huggingface.co/microsoft/phi-1_5)) and more advanced inference (e.g. [Web LLM](https://github.com/mlc-ai/web-llm))
82
- - [ ] Integration of privacy-by-design inference with remote enclaves using BlindLlama for powerful models such as [Llama 2 70b](https://huggingface.co/meta-llama/Llama-2-70b-chat-hf) & [Falcon 180b](https://huggingface.co/tiiuae/falcon-180B) βŒ›
83
- - [ ] Integration with [LlamaIndex TS](https://github.com/run-llama/LlamaIndexTS) for local Retrieval Augmented Generation (RAG) βŒ›
84
- - [ ] Internet search βŒ›
85
- - [ ] Connectors to pull data from different sources βŒ›
86
-
87
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
88
-
89
- ## πŸ”§ Setup
90
-
91
- Before going any further, please make sure you have [Node JS 18.0](https://nodejs.org/en) installed on your system.
92
-
93
- To run the chat user interface in dev/debug mode for testing purposes, execute the following commands in the root folder of your BlindChat code repo.
94
-
95
- ```bash
96
- npm install
97
- npm run dev
98
- ```
99
-
100
- This will install the dependencies of the project and launch the dev environment.
101
-
102
- The chat can be deployed in production mode with the following commands:
103
-
104
- ```bash
105
- npm run build
106
- node build
107
- ```
108
-
109
- The chat-ui uses server-side rendering, so building the pages before deploying them is mandatory.
110
-
111
- > ⚠️ Note that the command `node build` will run the server in `HTTP mode`.
112
- > If you wish to add TLS, please use a proxy server, such as NGINX.
113
-
114
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
115
-
116
- ## πŸ§‘β€πŸŽ¨ Design
117
-
118
- ### Principles
119
-
120
- πŸ€— **BlindChat** is a fork from [**Hugging Face Chat UI project**](https://huggingface.co/spaces/huggingchat/chat-ui).
121
-
122
- We modified the code so that various tasks usually handled by the server are done by the browser. This is to **ensure privacy** as we do not want to send user data to the server/AI provider as our solution **places the AI provider outside of our trust model**.
123
-
124
- ### Philosophy
125
-
126
- To make AI transparent and confidential, (almost) all of the logic is transported from the server-side to the client-side browser.
127
-
128
- This ensures end-users’ privacy and gives them control over what happens to their data. For instance, the inference can be done locally using transformers.js, and conversations can be stored in the user's browser chat. This means the operators of the AI service are blind to the user's data, hence the name BlindChat!
129
-
130
- Data is only sent server-side where our remote enclave mode is selected. With this mode, the server is deployed within a hardened and verifiable environment called an enclave which provides end-to-end protection and prevents external access. Not even the AI provider admins operating the enclave can read users’ data.
131
-
132
- Note that while our hardened environments don’t fit in with all definitions of an β€œenclave”, we will use it for convenience’s sake here to describe an environment that allows a server to process data without exposing its contents to service providers.
133
-
134
- ### Private inference
135
-
136
- We offer two modes to ensure users’ data remains private:
137
-
138
- #### On-device inference
139
-
140
- ![on-device-mode-dark](./assets/on-device-dark.png#gh-dark-mode-only)
141
- ![on-device-mode-light](./assets/on-device-light.png#gh-light-mode-only)
142
-
143
- With the on-device mode, the model is sent locally to the users’ browser, and **inference is performed on-device**.
144
-
145
- This mode is **generally suitable for smaller models** as large models may require too much bandwidth and computational resources.
146
-
147
- #### Confidential and transparent AI APis with enclaves
148
-
149
- ![zero-trust-mode-dark](./assets/zero-trust-dark.png#gh-dark-mode-only)
150
- ![zero-trust-mode-light](./assets/zero-trust-light.png#gh-light-mode-only)
151
-
152
- With the Zero-trust AI APIs mode, data is sent to a **secure environment** called an **enclave** containing the model for remote inference.
153
-
154
- These environments provide **end-to-end protection** through robust **isolation and verification**. User data is **never accessible in clear** to the AI provider admins.
155
-
156
- > You can find out more about Confidential and transparent AI APIs with enclaves in the [guide](https://blindllama.mithrilsecurity.io/en/latest/docs/concepts/hardened-systems/) we provide with our [BlindLlama project](https://blindllama.mithrilsecurity.io/en/latest/), which is the underlying technology for this mode of BlindChat.
157
-
158
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
159
-
160
- ### Architecture
161
-
162
- The project currently has three major components:
163
-
164
- - **UI:** This is the Chat interface that the end user interacts with. It contains the Chat box, and will contain plugins and other widgets for more complex interaction, such as loading documents or enabling voice commands.
165
- - **Private LLM:** Developers can customize which LLM they choose to answer users’ queries. Current options are either local models or remote enclaves to ensure transparent and private inference.
166
- - **Storage:** Developers can customize what kind of storage is used to save information such as conversation history and, in the future, embeddings for RAG.
167
-
168
- **\*Coming soon:**
169
-
170
- - **Connectors:** Connectors will allows users to pull documents from various sources, e.g. PDF upload, and share outputs
171
- - **Integration with Llama Index TS:** This will allow users to index documents with local models, store them in local storage and use them for RAG (query the LLMs based on the information contained in their documents).
172
-
173
- ## πŸ“Š Comparisons
174
-
175
- | | Client-side bandwidth requirements | Client-side computing requirements | Model capabilities | Privacy |
176
- | -------------------- | ---------------------------------- | ---------------------------------- | ------------------ | ------- |
177
- | On-device prediction | High | High | Low | High |
178
- | Regular AI APIs | Low | Low | High | Low |
179
- | Zero-trust AI APIs | Low | Low | High | High |
180
-
181
- **On-device predictions and Confidential AI APIs both provide privacy** contrary to most existing Conversational AI solutions that expose data to privacy risks.
182
-
183
- **On-device prediction** has the advantage of providing the highest level of privacy as data does not leave the device but requires downloading models that are several hundreds of MBs to several GBs and require heavy memory and computing resources. For many users, this option will not be possible with larger, higher-performing models due to these device requirements.
184
-
185
- **Confidential AI APIs** are deployed remotely, meaning the size of models is not restricted by the specifications of user devices. Users are able to query large models while still having robust privacy guarantees.
186
-
187
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
188
-
189
- ## πŸ“‡ Get in touch
190
-
191
- We would love to hear your feedback or suggestions, here are the ways you can reach us:
192
-
193
- - Found a bug? [Open an issue!](https://github.com/mithril-security/blind_chat/issues)
194
- - Got a suggestion? [Join our Discord community and let us know!](https://discord.com/invite/TxEHagpWd4)
195
- - Set up [a one-on-one meeting](https://www.mithrilsecurity.io/contact) with a member of our team
196
-
197
- Want to hear more about our work on privacy in the field AI?
198
-
199
- - Check out our [blog](https://blog.mithrilsecurity.io/)
200
- - Subscribe to our newsletter [here](https://blog.mithrilsecurity.io/)
201
-
202
- Thank you for your support!
203
-
204
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
205
-
206
- ## References
207
-
208
- [1] Carlini, N., Ippolito, D., Jagielski, M., Lee, K., Tramer, F., & Zhang, C. (2022). Quantifying Memorization Across Neural Language Models. ArXiv. /abs/2202.07646
209
-
210
- <!-- MARKDOWN LINKS & IMAGES -->
211
-
212
- [project-url]: https://github.com/mithril-security/blind_chat
213
- [twitter-url]: https://twitter.com/MithrilSecurity
214
- [contact-url]: https://www.mithrilsecurity.io/contact
215
- [docs-shield]: https://img.shields.io/badge/Docs-000000?style=for-the-badge&colorB=555
216
- [docs-url]: https://blindllama.mithrilsecurity.io/en/latest/
217
- [license-shield]: https://img.shields.io/github/license/mithril-security/aicert.svg?style=for-the-badge
218
- [contact]: https://img.shields.io/badge/Contact_us-000000?style=for-the-badge&colorB=555
219
- [project]: https://img.shields.io/badge/Project-000000?style=for-the-badge&colorB=555
220
- [linkedin-shield]: https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&colorB=555
221
- [reddit-shield]: https://img.shields.io/badge/reddit-0077B5?style=for-the-badge&logo=reddit&logoColor=white&colorB=FF4500
222
- [twitter]: https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white
223
- [fb-shield]: https://img.shields.io/badge/Facebook-0077B5?style=for-the-badge&logo=facebook&logoColor=white&colorB=3b5998
224
- [linkedin-url]: https://www.linkedin.com/company/mithril-security-company/
225
- [website-url]: https://www.mithrilsecurity.io
226
- [docs-url]: https://blindllama.mithrilsecurity.io/en/latest/
227
- [website-shield]: https://img.shields.io/badge/website-000000?style=for-the-badge&colorB=555
228
- [blog-url]: https://blog.mithrilsecurity.io/
229
- [blog-shield]: https://img.shields.io/badge/Blog-000?style=for-the-badge&logo=ghost&logoColor=yellow&colorB=555
230
- [facebook-share]: https://www.facebook.com/sharer/sharer.php?u=https%3A//github.com/mithril-security/blind_chat
231
- [twitter-share]: https://twitter.com/intent/tweet?url=https://github.com/mithril-security/blind_chat&text=Check%20out%20the%20open-source%20project%20to%20build%20a%20private%20Conversational%20AI%20app%20running%20fully%20in-browser
232
- [linkedin-share]: https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/mithril-security/blind_chat
233
- [reddit-share]: https://www.reddit.com/submit?url=github.com%2Fmithril-security%2Fblind_chat&title=Private%20in-browser%20Conversational%20AI%20with%20BlindChat
 
1
+ ---
2
+ title: Blind Chat
3
+ emoji: πŸ“š
4
+ colorFrom: gray
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference