Skip to content

Commit 1cd0fd9

Browse files
authored
doc: Hugging Face Deployment (danny-avila#867)
* docs: update ToC * docs: update ToC * update huggingface.md * update render.md * update huggingface.md * update mongodb.md * update huggingface.md * update README.md
1 parent aeeb3d3 commit 1cd0fd9

File tree

5 files changed

+102
-8
lines changed

5 files changed

+102
-8
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ Keep up with the latest updates by visiting the releases page - [Releases](https
104104
<details>
105105
<summary><strong>Cloud Deployment</strong></summary>
106106

107-
* [Hetzner](docs/deployment/hetzner_ubuntu.md)
108-
* [Heroku](docs/deployment/heroku.md)
107+
* [DigitalOcean](docs/deployment/digitalocean.md)
108+
* [Azure](docs/deployment/azure-terraform.md)
109109
* [Linode](docs/deployment/linode.md)
110110
* [Cloudflare](docs/deployment/cloudflare.md)
111111
* [Ngrok](docs/deployment/ngrok.md)
112+
* [HuggingFace](docs/deployment/huggingface.md)
112113
* [Render](docs/deployment/render.md)
113-
* [Azure](docs/deployment/azure-terraform.md)
114+
* [Hetzner](docs/deployment/hetzner_ubuntu.md)
115+
* [Heroku](docs/deployment/heroku.md)
114116
</details>
115117

116118
<details>

docs/deployment/huggingface.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/fd684254-cbe0-4039-ba4a-7c492b16a453)
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+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/13a039b9-bb78-4d56-bab1-74eb48171516)
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+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/55d596a3-2be9-4e14-ac0d-0b493d463b1b)
63+
64+
65+
**2.** The project will now build, this will take a couple of minutes
66+
67+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/f9fd10e4-ae50-4b5f-a9b5-0077d9e4eaf6)
68+
69+
70+
**3.** When ready, `Building` will change to `Running`
71+
72+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/91442e84-9c9e-4398-9011-76c479b6f272)
73+
74+
And you will be able to access LibreChat!
75+
76+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/cd5950d4-ecce-4f13-bbbf-b9109e462e10)
77+
78+
## Update
79+
To update LibreChat, simply select `Factory Reboot` from the ⚙️Settings menu
80+
81+
![image](https://github.com/fuegovic/LibreChat/assets/32828263/66f20129-0ffd-44f5-b91c-fcce1932112f)
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! 🤗

docs/deployment/render.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## Note:
44

55
Some features will not work:
6-
- Bing/Sydney (the IP is blocked by Microsoft)
6+
- Bing/Sydney (success may vary)
77
- Meilisearch
88

99
Also:
10-
- You will have to create an online MongoDB Atlas Database to be able to properly deploy
10+
- You need to create an online MongoDB Atlas Database to be able to properly deploy
1111

1212
## Create an account
1313

@@ -57,7 +57,7 @@ Also:
5757
| PORT | 3080 |
5858
| SESSION_EXPIRY | (1000 * 60 * 60 * 24) * 7 |
5959

60-
⬆️ **Add a single space in the value field for `BINGAI_TOKEN` and all other endpoints that you wish to disable.**
60+
> ⬆️ **Add a single space in the value field for any endpoints that you wish to disable.**
6161
6262
**DO NOT FORGET TO SAVE YOUR CHANGES**
6363

docs/install/mongodb.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Open a new tab and go to [https://account.mongodb.com/account/register](https://account.mongodb.com/account/register) to create an account.
55

66
## Create a project
7-
- Once you have set up your account, create a new project and name it:
7+
- Once you have set up your account, create a new project and name it (the name can be anything):
88

99
![image](https://github.com/fuegovic/LibreChat/assets/32828263/5cdeeba0-2982-47c3-8228-17e8500fd0d7)
1010

@@ -88,4 +88,4 @@ mongodb+srv://fuegovic:[email protected]/?retryWrite
8888

8989
---
9090

91-
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.
91+
>⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our [#issues thread on our discord](https://discord.gg/weqZFtD9C4) or our [troubleshooting discussion](https://github.com/danny-avila/LibreChat/discussions/categories/troubleshooting) on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ nav:
114114
- Ngrok: 'deployment/ngrok.md'
115115
- Render: 'deployment/render.md'
116116
- Azure (Terraform): 'deployment/azure-terraform.md'
117+
- HuggingFace: 'deployment/huggingface.md'
117118
- Contributions:
118119
- Documentation Guidelines: 'contributions/documentation_guidelines.md'
119120
- Contribute a Translation: 'contributions/translation_contribution.md'

0 commit comments

Comments
 (0)