|
| 1 | +# Hugging Face Deployment 🤗 |
| 2 | + |
| 3 | +>#### ⚠️ Note - Some features are not supported by HuggingFace: |
| 4 | +>- Meilisearch |
| 5 | +>- Social Logins |
| 6 | +
|
| 7 | +> #### ❗Also: |
| 8 | +>- You will have to create an online MongoDB Atlas Database to be able to properly deploy |
| 9 | +
|
| 10 | +## Create and Configure your Database (Required) |
| 11 | + |
| 12 | +The first thing you need is to create a MongoDB Atlas Database and get your connection string. |
| 13 | + |
| 14 | +Follow the instructions in this document: [Online MongoDB Database](..\install\mongodb.md) |
| 15 | + |
| 16 | +## Getting Started |
| 17 | + |
| 18 | +**1.** Login or Create an account on [Hugging Face](https://huggingface.co/) |
| 19 | + |
| 20 | +**2.** Visit [https://huggingface.co/spaces/LibreChat/LibreChat](https://huggingface.co/spaces/LibreChat/LibreChat) and click on `Duplicate this Space` to copy LibreChat into your profile |
| 21 | + |
| 22 | +  |
| 23 | + |
| 24 | +**3.** Name your Space and Fill the `Secrets` and `Variables` |
| 25 | + |
| 26 | + >You can also decide here to make it public or private |
| 27 | +
|
| 28 | +  |
| 29 | + |
| 30 | +You will need to fill these values: |
| 31 | + |
| 32 | +| Secrets | Values | |
| 33 | +| --- | --- | |
| 34 | +| MONGO_URI | * use the string aquired in the previous step | |
| 35 | +| OPENAI_API_KEY | `user_provided` | |
| 36 | +| BINGAI_TOKEN | `user_provided` | |
| 37 | +| CHATGPT_TOKEN | `user_provided` | |
| 38 | +| ANTHROPIC_API_KEY | `user_provided` | |
| 39 | +| PALM_KEY | `user_provided` | |
| 40 | +| CREDS_KEY | * see bellow | |
| 41 | +| CREDS_IV | * see bellow | |
| 42 | +| JWT_SECRET | * see bellow | |
| 43 | +| JWT_REFRESH_SECRET | * see bellow | |
| 44 | + |
| 45 | +> ⬆️ **Leave the value field blank for any endpoints that you wish to disable.** |
| 46 | +
|
| 47 | +>⚠️ setting the API keys and token to `user_provided` allows you to provide them safely from the webUI |
| 48 | +
|
| 49 | +>* For `CREDS_KEY`, `CREDS_IV` and `JWT_SECRET` use this tool: [https://replit.com/@daavila/crypto#index.js](https://replit.com/@daavila/crypto#index.js). |
| 50 | +>* Run the tool a second time and use the new `JWT_SECRET` value for the `JWT_REFRESH_SECRET` |
| 51 | +
|
| 52 | +| Variables | Values | |
| 53 | +| --- | --- | |
| 54 | +| APP_TITLE | LibreChat | |
| 55 | +| ALLOW_REGISTRATION | true | |
| 56 | + |
| 57 | + |
| 58 | +## Deployment |
| 59 | + |
| 60 | +**1.** When you're done filling the `secrets` and `variables`, click `Duplicate Space` in the bottom of that window |
| 61 | + |
| 62 | +  |
| 63 | + |
| 64 | + |
| 65 | +**2.** The project will now build, this will take a couple of minutes |
| 66 | + |
| 67 | +  |
| 68 | + |
| 69 | + |
| 70 | +**3.** When ready, `Building` will change to `Running` |
| 71 | + |
| 72 | +  |
| 73 | + |
| 74 | + And you will be able to access LibreChat! |
| 75 | + |
| 76 | +  |
| 77 | + |
| 78 | +## Update |
| 79 | + To update LibreChat, simply select `Factory Reboot` from the ⚙️Settings menu |
| 80 | + |
| 81 | +  |
| 82 | + |
| 83 | + |
| 84 | +## Conclusion |
| 85 | + You can now access it with from the current URL. If you want to access it without the Hugging Face overlay, you can modify this URL template with your info: |
| 86 | + |
| 87 | + `https://username-projectname.hf.space/` |
| 88 | + |
| 89 | + e.g. `https://cooluser-librechat.hf.space/` |
| 90 | + |
| 91 | +### 🎉 Congratulation, you've sucessfully deployed LibreChat on Hugging Face! 🤗 |
0 commit comments