Skip to content

Commit

Permalink
Update huggingface.mdx (#237)
Browse files Browse the repository at this point in the history
Add meilisearch instructions for huggingface spaces
  • Loading branch information
mendelgordon authored Feb 14, 2025
1 parent 9c2c6bb commit 9c5b3a9
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion pages/docs/remote/huggingface.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ You will need to fill these values:
| APP_TITLE | LibreChat |
| ALLOW_REGISTRATION | true |


## Deployment

**1.** When you're done filling the `secrets` and `variables`, click `Duplicate Space` in the bottom of that window
Expand Down Expand Up @@ -89,3 +88,52 @@ You will need to fill these values:
e.g. `https://cooluser-librechat.hf.space/`

**🎉 Congratulation, you've sucessfully deployed LibreChat on Hugging Face! 🤗**


## Meilisearch Setup (Optional)

To enable the search functionality in LibreChat, you'll need to deploy and configure a Meilisearch instance. Here's how:

**1. Duplicate the Meilisearch Space:**

Visit this link: [https://huggingface.co/spaces/LibreChat/meilisearch](https://huggingface.co/spaces/LibreChat/meilisearch) and click "Duplicate this Space".

**2. Configure the Meilisearch Space:**

* **Visibility:** Set the visibility to "public".

* **MEILI_MASTER_KEY:** Generate a secure 16-character master key. You can use a tool like [https://randomkeygen.com/](https://randomkeygen.com/) to generate a random key. Set this key as the value for the `MEILI_MASTER_KEY` environment variable in the Meilisearch space. *Important: Keep this key secure!*

* **MEILI_ENV:** Set the `MEILI_ENV` environment variable to `production`.

**3. Duplicate the Space:**

Click the "Duplicate Space" button.

**4. Configure LibreChat to use Meilisearch:**

* **Edit the Dockerfile:** Go to your LibreChat space (the one you duplicated from the main LibreChat template). Navigate to "Files" -> "Dockerfile" and click "Edit".

* **Uncomment and Modify Lines:** Uncomment/edit the following lines in the Dockerfile. These lines will contain `ENV SEARCH` and `ENV MEILI_*`. Make sure to replace `<YOUR_MEILISEARCH_SPACE_URL>` with the actual URL of your Meilisearch deployment on Hugging Face Spaces. It should look something like https://username-meilisearch.hf.space/. *Update the username to match your username!*

```dockerfile
ENV SEARCH=true
ENV MEILI_NO_ANALYTICS=true
ENV MEILI_HOST=<YOUR_MEILISEARCH_SPACE_URL>
```

* **Commit Changes:** Commit your changes to the `main` branch.

**5. Add the `MEILI_MASTER_KEY` Secret to LibreChat:**

* Go to your LibreChat space's settings (the LibreChat deployment, not the Meilisearch one).

* Click "New secret".

* **Name:** Enter `MEILI_MASTER_KEY`.

* **Value:** Enter the *same* master key you used when setting up the Meilisearch space.

**6. Verify the Setup:**

After LibreChat rebuilds and starts running, you should see a search option in the top left of the LibreChat interface. If you don't see it, double-check that you've followed all the steps correctly.

0 comments on commit 9c5b3a9

Please sign in to comment.