mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-16 23:48:09 +01:00
🧹📚 docs: refactor and clean up (#1392)
* 📑 update mkdocs * rename docker override file and add to gitignore * update .env.example - GOOGLE_MODELS * update index.md * doc refactor: split installation and configuration in two sub-folders * doc update: installation guides * doc update: configuration guides * doc: new docker override guide * doc: new beginner's guide for contributions - Thanks @Berry-13 * doc: update documentation_guidelines.md * doc: update testing.md * doc: update deployment guides * doc: update /dev readme * doc: update general_info * doc: add 0 value to doc weight * doc: add index.md to every doc folders * doc: add weight to index.md and move openrouter from free_ai_apis.md to ai_setup.md * doc: update toc so they display properly on the right had side in mkdocs * doc: update pandoranext.md * doc: index logging_system.md * doc: update readme.md * doc: update litellm.md * doc: update ./dev/readme.md * doc:🔖 new presets.md * doc: minor corrections * doc update: user_auth_system.md and presets.md, doc feat: add mermaid support to mkdocs * doc update: add screenshots to presets.md * doc update: add screenshots to - OpenID with AWS Cognito * doc update: BingAI cookie instruction * doc update: discord auth * doc update: facebook auth * doc: corrections to user_auth_system.md * doc update: github auth * doc update: google auth * doc update: auth clean up * doc organization: installation * doc organization: configuration * doc organization: features+plugins & update:plugins screenshots * doc organization: deploymend + general_info & update: tech_stack.md * doc organization: contributions * doc: minor fixes * doc: minor fixes
This commit is contained in:
parent
5c27fa304a
commit
51050cc4d3
66 changed files with 1617 additions and 869 deletions
225
docs/install/installation/container_install.md
Normal file
225
docs/install/installation/container_install.md
Normal file
|
|
@ -0,0 +1,225 @@
|
|||
---
|
||||
title: 🦦 Container (podman)
|
||||
weight: 0
|
||||
---
|
||||
|
||||
# Container Installation Guide (podman)
|
||||
|
||||
If you don't like docker compose, don't want a bare-metal installation, but still want to leverage the benefits from the isolation and modularity of containers - this is the guide you should use.
|
||||
|
||||
> Likewise, If you are actively developing LibreChat, aren't using the service productively (i.e production environments), you should avoid this guide and look to something easier to work with such as docker compose.
|
||||
|
||||
**Important:** `docker` and `podman` commands are for the most part, interoperable and interchangeable. The code instructions below will use (and heavily favor) `podman`.
|
||||
|
||||
## Creating the base image
|
||||
|
||||
Since LibreChat is very active in development, it's recommended for now to build
|
||||
the image locally for the container you plan on using. Thankfully this is easy enough to do.
|
||||
|
||||
In your target directory, run the following:
|
||||
```bash
|
||||
git clone https://github.com/danny-avila/LibreChat
|
||||
```
|
||||
|
||||
This will add a directory, `LibreChat` into your local environment.
|
||||
|
||||
Without entering the `LibreChat` directory, add a script `./image.sh` with the following:
|
||||
|
||||
> If you don't want to run this as a script, you can run the container command rather images
|
||||
|
||||
```bash
|
||||
# Build the base container image (which contains the LibreChat stack - api, client and data providers)
|
||||
podman build \
|
||||
--tag "librechat:local" \
|
||||
--file ./LibreChat/Dockerfile;
|
||||
```
|
||||
|
||||
> Note: the downside of running a base container that has a live root is that image revisions need to be done manually. The easiest way is to remove and recreate the image when the container is no longer. If that's not possible for you, manually updating the image to increment versions can be done manually. Simply amend $image with the version you're building.
|
||||
|
||||
> We'll document how to go about the update process more effectively further on. You wont need to remove your existing containers, or lose any data when updating.
|
||||
|
||||
## Setting up the env file
|
||||
|
||||
Execute the following command to create a env file solely for LibreChat containers:
|
||||
|
||||
```bash
|
||||
cp ./LibreChat/.env.example .env
|
||||
```
|
||||
|
||||
This will add the env file to the top level directory that we will create the containers, allowing us to pass it easily as via the `--env-file` command argument.
|
||||
|
||||
Follow [this guide](../configuration/ai_setup.md) to populate the containers with the correct env values for various apis. There are other env values of interest that might be worth changing, documented within the env itself. Afterwords, edit the following lines in the `.env` file.
|
||||
|
||||
```
|
||||
HOST=0.0.0.0
|
||||
MONGO_URI=mongodb://librechat-mongodb:27017/LibreChat
|
||||
MEILI_HOST=http://librechat-meilisearch:7700
|
||||
MEILI_HTTP_ADDR=librechat-meilisearch:7700
|
||||
MEILI_NO_ANALYTICS=true
|
||||
```
|
||||
|
||||
These values will be uses by some of our containers to correctly use container DNS, using the LibreChat network.
|
||||
|
||||
## Creating a network for LibreChat
|
||||
|
||||
If you're going about this the _manual_ way, it's likely safe to assume you're running more than a few different containers and services on your machine. One of the nice features offered by most container engines is that you don't need to have every single container exposed on the host network. This has the added benefit of not exposing your data and dependant services to other containers on your host.
|
||||
|
||||
```bash
|
||||
podman network create librechat
|
||||
```
|
||||
|
||||
We will be using this network when creating our containers.
|
||||
|
||||
## Creating dependant containers
|
||||
|
||||
LibreChat currently uses mongoDB and meilisearch, so we'll also be creating those containers.
|
||||
|
||||
## Mongodb
|
||||
|
||||
Install and boot the mongodb container with the following command:
|
||||
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat-mongodb" \
|
||||
--network=librechat \
|
||||
-v "librechat-mongodb-data:/data/db" \
|
||||
--detach \
|
||||
docker.io/mongo \
|
||||
mongod --noauth;
|
||||
```
|
||||
|
||||
## Meilisearch
|
||||
|
||||
Install and boot the melisearch container with the following command:
|
||||
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat-meilisearch" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-v "librechat-meilisearch-data:/meili_data" \
|
||||
--detach \
|
||||
docker.io/getmeili/meilisearch:v1.0;
|
||||
```
|
||||
|
||||
## Starting LibreChat
|
||||
```bash
|
||||
podman run \
|
||||
--name="librechat" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-p 3080:3080 \
|
||||
--detach \
|
||||
librechat:local;
|
||||
```
|
||||
|
||||
If you're using LibreChat behind another load balancer, you can omit the `-p` declaration, you can also attach the container to the same network by adding an additional network argument:
|
||||
|
||||
```bash
|
||||
--network=librechat \
|
||||
--network=mybalancernetwork \
|
||||
```
|
||||
|
||||
As described by the original `-p` command argument, it would be possible to access librechat as `librechat:3080`, `mybalancernetwork` would be replaced with whatever network your balancer exists.
|
||||
|
||||
## Auto-starting containers on boot (podman + Linux only)
|
||||
|
||||
Podman has a declarative way to ensure that pod starts up automatically on system boot using systemd.
|
||||
|
||||
To use this method you need to run the following commands:
|
||||
|
||||
First, let's stop any running containers related to LibreChat:
|
||||
s
|
||||
```bash
|
||||
podman stop librechat librechat-mongodb librechat-meilisearch
|
||||
```
|
||||
|
||||
Next, we'll update our user's systemd configuration to enable lingering. In systemd-based systems, when a user logs in and out, user-based services typically terminate themselves to save CPU, but since we're using rootless containers (which is podman's preferred way of running), we need to indicate that our user has permission to have user-locked services running after their session ends.
|
||||
|
||||
```bash
|
||||
loginctl enable-linger $(whoami)
|
||||
```
|
||||
|
||||
Next, we'll create a script somewhere in our `home` directory using a text editor. Let's call the script `./install.sh`
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Install podman container as systemd container
|
||||
set -e
|
||||
name="$1";
|
||||
podman generate systemd --name "$name" > ~/.config/systemd/user/container-$name.service
|
||||
systemctl --user enable --now container-$name;
|
||||
```
|
||||
|
||||
After saving, we'll update the script to be executable:
|
||||
|
||||
```bash
|
||||
chmod +x ./install.sh
|
||||
```
|
||||
|
||||
Assuming we aren't running those LibreChat containers from before, we can enable on-boot services for each of them using the following:
|
||||
|
||||
```bash
|
||||
./install.sh librechat-mongodb
|
||||
./install.sh librechat-meilisearch
|
||||
./install.sh librechat
|
||||
```
|
||||
|
||||
The containers (assuming everything was done to par), will be now running using the systemd layer instead of the podman layer. This means services will load on boot, but also means managing these containers is a little more manual and requires interacting with systemd instead of podman directly.
|
||||
|
||||
For instance, instead of `podman stop {name}`, you would instead do `systemctl --user stop container-{name}` to perform maintenance (such as updates or backups). Likewise, if you need to start the service again you simply can run `systemctl --user start container-{name}`. If wanting to use auto-boot functionality, interacting with managed containers using podman can cause issues with systemd's fault tolerance as it can't correctly indicate the state of a container when interfered with.
|
||||
|
||||
## Backing up volume containers (podman only)
|
||||
|
||||
The podman containers above are using named volumes for persistent data, which means we can't simply copy files from one place to another. This has benefits though. In podman, we can simply backup the volume into a tape archive format (tarball). To do this, run the following commands:
|
||||
|
||||
> It's recommended you stop the containers before running these commands.
|
||||
|
||||
```bash
|
||||
# backup the
|
||||
podman volume export librechat-meilisearch-data --output "librechat-meilisearch-backup-$(date +"%d-%m-%Y").tar"
|
||||
podman volume export librechat-mongodb-data --output "librechat-mongodb-backup-$(date +"%d-%m-%Y").tar"
|
||||
```
|
||||
|
||||
These will leave archive files that you can do what you wish with, including reverting volumes to a previous state if needed. Refer to [podman documentation](https://docs.podman.io/en/latest/markdown/podman-volume-import.1.html) for how to do this.
|
||||
|
||||
## Updating LibreChat
|
||||
|
||||
LibreChat is still under development, so depending on published images isn't a huge viability at the moment. Instead, it's easier to update using git. Data persistence in librechat is managed outside of the main container, so it's rather simple to do an in-place update.
|
||||
|
||||
In the parent directory containing the LibreChat repo:
|
||||
|
||||
```bash
|
||||
# Update the git repo
|
||||
(cd LibreChat && git pull);
|
||||
|
||||
# (ONLY if using systemd auto start) Stop the service
|
||||
systemctl --user stop container-librechat
|
||||
|
||||
# Remove the librechat container
|
||||
podman rm -f librechat
|
||||
|
||||
# Destroy the local image
|
||||
podman rmi -f librechat:local
|
||||
|
||||
# Rebuild the image
|
||||
podman build \
|
||||
--tag "librechat:local" \
|
||||
--file ./LibreChat/Dockerfile;
|
||||
|
||||
# Recreate the container (using the Starting LibreChat step)
|
||||
podman run \
|
||||
--name="librechat" \
|
||||
--network=librechat \
|
||||
--env-file="./.env" \
|
||||
-p 3080:3080 \
|
||||
--detach \
|
||||
librechat:local;
|
||||
|
||||
# Stop the container (if it's confirmed to be running) and restart the service
|
||||
podman stop librechat && systemctl --user start container-librechat
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
>⚠️ 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.
|
||||
140
docs/install/installation/docker_compose_install.md
Normal file
140
docs/install/installation/docker_compose_install.md
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
---
|
||||
title: 🐳 Docker Compose ✨(Recommended)
|
||||
weight: -10
|
||||
---
|
||||
|
||||
# Docker Compose Installation Guide
|
||||
|
||||
Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
|
||||
If you prefer to watch a video, we have video guides for [Windows](./windows_install.md#recommended) and [Ubuntu 22.04 LTS](./linux_install.md#recommended)
|
||||
|
||||
## Installation and Configuration
|
||||
|
||||
### Preparation
|
||||
Start by cloning the repository or downloading it to your desired location:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/danny-avila/LibreChat.git
|
||||
```
|
||||
|
||||
### Docker Installation
|
||||
Install Docker on your system. [Docker Desktop](https://www.docker.com/products/docker-desktop/) is recommended for managing your Docker containers.
|
||||
|
||||
### LibreChat Configuration
|
||||
Before running LibreChat with Docker, you need to configure some settings:
|
||||
|
||||
- Edit the credentials you see in `docker-compose.yml` under the API service as needed.
|
||||
- See my notes below for specific instructions on some of the configuration
|
||||
- Provide all necessary credentials in the `.env` file before the next step.
|
||||
- Docker will read this env file. See the `.env.example` file for reference.
|
||||
|
||||
#### [AI Setup](../configuration/ai_setup.md) (Required)
|
||||
At least one AI endpoint should be setup for use.
|
||||
|
||||
#### [Manage Your MongoDB Database](../../features/manage_your_database.md) (Optional)
|
||||
Safely access and manage your MongoDB database using Mongo Express
|
||||
|
||||
#### [User Authentication System Setup](../configuration/user_auth_system.md) (Optional)
|
||||
How to set up the user/auth system and Google login.
|
||||
|
||||
### Running LibreChat
|
||||
Once you have completed all the setup, you can start the LibreChat application by running the command `docker-compose up` in your terminal. After running this command, you can access the LibreChat application at `http://localhost:3080`.
|
||||
|
||||
If you build your own containers out of the git checkout with `docker-compose up --build` you should pre-create the mount points for the volumes. This avoids occasional trouble with directory permissions when rebuilding:
|
||||
```
|
||||
mkdir meili_data images .env.production .env.development data-node
|
||||
```
|
||||
|
||||
**Note:** MongoDB does not support older ARM CPUs like those found in Raspberry Pis. However, you can make it work by setting MongoDB’s version to mongo:4.4.18 in docker-compose.yml, the most recent version compatible with
|
||||
|
||||
That's it! If you need more detailed information on configuring your compose file, see my notes below.
|
||||
|
||||
## Updating LibreChat
|
||||
- Run `npm run update` from the project directory for a clean installation.
|
||||
|
||||
If you're having issues running this command, you can try running what the script does manually:
|
||||
|
||||
Prefix commands with `sudo` according to your environment permissions.
|
||||
|
||||
```bash
|
||||
# Stop the container (if running)
|
||||
docker-compose down
|
||||
# Fetch the latest changes from Github
|
||||
git fetch origin
|
||||
# Switch to the repo's main branch
|
||||
git checkout main
|
||||
# Pull the latest changes to the main branch from Github
|
||||
git pull origin main
|
||||
# Prune all LibreChat Docker images
|
||||
docker rmi librechat:latest
|
||||
# Remove all unused dangling Docker images
|
||||
docker image prune -f
|
||||
# Building a new LibreChat image without cache
|
||||
docker-compose build --no-cache
|
||||
|
||||
# Start LibreChat
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
## Advanced Settings
|
||||
|
||||
### Config notes for docker-compose.yml file
|
||||
|
||||
Modification to the `docker-compose.yml` should be made with `docker-compose.override.yml` whenever possible to prevent conflicts when updating. You can create a new file named `docker-compose.override.yml` in the same directory as your main `docker-compose.yml` file for LibreChat, where you can set your .env variables as needed under `environment`, or modify the default configuration provided by the main `docker-compose.yml`, without the need to directly edit or duplicate the whole file.
|
||||
|
||||
For more info see:
|
||||
|
||||
- Our quick guide:
|
||||
- **[Docker Override](../configuration/docker_override.md)**
|
||||
|
||||
- The official docker documentation:
|
||||
- **[docker docs - understanding-multiple-compose-files](https://docs.docker.com/compose/multiple-compose-files/extends/#understanding-multiple-compose-files)**
|
||||
- **[docker docs - merge-compose-files](https://docs.docker.com/compose/multiple-compose-files/merge/#merge-compose-files)**
|
||||
- **[docker docs - specifying-multiple-compose-files](https://docs.docker.com/compose/reference/#specifying-multiple-compose-files)**
|
||||
|
||||
- You can also view an example of an override file for LibreChat in your LibreChat folder and on GitHub:
|
||||
- **[docker-compose.override.example](https://github.com/danny-avila/LibreChat/blob/main/docker-compose.override.yaml.example)**
|
||||
|
||||
- Any environment variables set in your compose file will override variables with the same name in your .env file. Note that the following variables are necessary to include in the compose file so they work in the docker environment, so they are included for you.
|
||||
|
||||
```yaml
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- MONGO_URI=mongodb://mongodb:27017/LibreChat
|
||||
# ...
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- MEILI_HTTP_ADDR=meilisearch:7700
|
||||
# ...
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- MEILI_HOST=http://meilisearch:7700
|
||||
- MEILI_HTTP_ADDR=meilisearch:7700
|
||||
```
|
||||
|
||||
- If for some reason you're not able to build the app image, you can pull the latest image from **Dockerhub**.
|
||||
- Create a new file named `docker-compose.override.yml` in the same directory as your main `docker-compose.yml` with this content:
|
||||
|
||||
```yaml
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
api:
|
||||
image: ghcr.io/danny-avila/librechat-dev:latest
|
||||
```
|
||||
|
||||
- Then use `docker-compose build` as you would normally
|
||||
|
||||
- **Note:** There are different Dockerhub images. the `librechat:latest` image is only updated with new release tags, so it may not have the latest changes to the main branch. To get the latest changes you can use `librechat-dev:latest` instead
|
||||
|
||||
|
||||
### **[LibreChat on Docker Hub](https://hub.docker.com/r/chatgptclone/app/tags)**
|
||||
|
||||
### **[Create a MongoDB database](../configuration/mongodb.md)** (Not required if you'd like to use the local database installed by Docker)
|
||||
|
||||
---
|
||||
|
||||
>⚠️ 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.
|
||||
11
docs/install/installation/index.md
Normal file
11
docs/install/installation/index.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: Installation
|
||||
weight: 1
|
||||
---
|
||||
|
||||
# Installation
|
||||
* 🐳 [Docker Compose (✨ Recommended)](docker_compose_install.md)
|
||||
* 🦦 [Container (podman)](container_install.md)
|
||||
* 🐧 [Linux](linux_install.md)
|
||||
* 🍎 [Mac](mac_install.md)
|
||||
* 🪟 [Windows](windows_install.md)
|
||||
192
docs/install/installation/linux_install.md
Normal file
192
docs/install/installation/linux_install.md
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
---
|
||||
title: 🐧 Linux
|
||||
weight: 0
|
||||
---
|
||||
# Linux Installation Guide
|
||||
## **Recommended:**
|
||||
|
||||
[](https://youtu.be/w7VqivpdfZk)
|
||||
Click on the thumbnail to open the video☝️
|
||||
---
|
||||
|
||||
In this video, you will learn how to install and run LibreChat, using Docker on Ubuntu 22.04 LTS.
|
||||
|
||||
#### Timestamps
|
||||
|
||||
- 0:00 - Intro
|
||||
- 0:14 - Update the system
|
||||
- 0:29 - Clone the repository
|
||||
- 0:37 - Docker installation
|
||||
- 1:03 - Enter in the folder
|
||||
- 1:07 - Create the .env file
|
||||
- 1:14 - Build using docker-compose
|
||||
- 1:29 - Start LibreChat
|
||||
- 1:43 - Test
|
||||
|
||||
#### Instructions
|
||||
|
||||
Here are the steps to follow:
|
||||
- Update the system: `sudo apt update`
|
||||
- Clone LibreChat: `git clone https://github.com/danny-avila/LibreChat.git`
|
||||
- Install Docker: `sudo apt install docker.io && apt install docker-compose -y`
|
||||
- Enter the folder: `cd LibreChat`
|
||||
- Create the .env file: `cp .env.example .env`
|
||||
- Build the Docker image: `docker-compose build`
|
||||
- Start LibreChat: `docker-compose up -d`
|
||||
|
||||
Note: If you run the command on the same computer and want to access it, navigate to `localhost:3080`. You should see a login page where you can create or sign in to your account. Then you can choose an AI model and start chatting.
|
||||
|
||||
- [Manage Your MongoDB Database (optional)](../../features/manage_your_database.md)
|
||||
Safely access and manage your MongoDB database using Mongo Express
|
||||
|
||||
Have fun!
|
||||
|
||||
> Note: See the [Docker Compose Install Guide](./docker_compose_install.md) for more details
|
||||
- 👆 Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
|
||||
---
|
||||
|
||||
## **Manual Installation:**
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before installing LibreChat, make sure your machine has the following prerequisites installed:
|
||||
|
||||
- Git: To clone the repository.
|
||||
- Node.js: To run the application.
|
||||
- MongoDB: To store the chat history.
|
||||
|
||||
## Clone the repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/danny-avila/LibreChat.git
|
||||
```
|
||||
|
||||
## Extract the content in your desired location:
|
||||
|
||||
```bash
|
||||
cd LibreChat
|
||||
unzip LibreChat.zip -d /usr/local/
|
||||
```
|
||||
|
||||
Note: The above command extracts the files to "/usr/local/LibreChat". If you want to install the files to a different location, modify the instructions accordingly.
|
||||
|
||||
## Enable the Conversation search feature: (optional)
|
||||
|
||||
- Download MeiliSearch latest release from: https://github.com/meilisearch/meilisearch/releases
|
||||
- Copy it to "/usr/local/LibreChat/"
|
||||
- Rename the file to "meilisearch"
|
||||
- Open a terminal and navigate to "/usr/local/LibreChat/"
|
||||
- Run the following command:
|
||||
|
||||
```bash
|
||||
./meilisearch --master-key=YOUR_MASTER_KEY
|
||||
```
|
||||
|
||||
Note: Replace "YOUR_MASTER_KEY" with the generated master key, which you saved earlier.
|
||||
|
||||
## Install Node.js:
|
||||
|
||||
Open a terminal and run the following commands:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
||||
sudo apt-get install -y nodejs
|
||||
```
|
||||
|
||||
## [Create a MongoDB database](../configuration/mongodb.md) (Required)
|
||||
|
||||
## [Setup your AI Endpoints](../configuration/ai_setup.md) (Required)
|
||||
- At least one AI endpoint should be setup for use.
|
||||
|
||||
## [User/Auth System](../configuration/user_auth_system.md) (Optional)
|
||||
- How to set up the user/auth system and Google login.
|
||||
|
||||
## Run the project
|
||||
|
||||
### Using the command line (in the root directory)
|
||||
Setup the app:
|
||||
1. Run `npm ci`
|
||||
2. Run `npm run frontend`
|
||||
|
||||
## Start the app:
|
||||
1. Run `npm run backend`
|
||||
2. Run `meilisearch --master-key put_your_meilesearch_Master_Key_here` (Only if SEARCH=TRUE)
|
||||
3. Visit http://localhost:3080 (default port) & enjoy
|
||||
|
||||
### Using a shell script
|
||||
|
||||
- Create a shell script to automate the starting process
|
||||
- Open a text editor
|
||||
- Paste the following code in a new document
|
||||
- Put your MeiliSearch master key instead of "your_master_key_goes_here"
|
||||
- Save the file as "/home/user/LibreChat/LibreChat.sh"
|
||||
- You can make a shortcut of this shell script and put it anywhere
|
||||
|
||||
``` bash title="LibreChat.sh"
|
||||
#!/bin/bash
|
||||
# the meilisearch executable needs to be at the root of the LibreChat directory
|
||||
|
||||
gnome-terminal --tab --title="MeiliSearch" --command="bash -c 'meilisearch --master-key your_master_key_goes_here'"
|
||||
# ↑↑↑ meilisearch is the name of the meilisearch executable, put your own master key there
|
||||
|
||||
gnome-terminal --tab --title="LibreChat" --working-directory=/home/user/LibreChat/ --command="bash -c 'npm run backend'"
|
||||
# this shell script goes at the root of the LibreChat directory (/home/user/LibreChat/)
|
||||
```
|
||||
|
||||
## Update the app version
|
||||
|
||||
- Run `npm run update` from the project directory for a clean installation.
|
||||
|
||||
If you're having issues running this command, you can try running what the script does manually:
|
||||
|
||||
Prefix commands with `sudo` according to your environment permissions.
|
||||
|
||||
```bash
|
||||
# Bash Terminal
|
||||
|
||||
# Step 1: Get the latest changes
|
||||
|
||||
# Fetch the latest changes from Github
|
||||
git fetch origin
|
||||
# Switch to the repo's main branch
|
||||
git checkout main
|
||||
# Pull the latest changes to the main branch from Github
|
||||
git pull origin main
|
||||
|
||||
# Step 2: Delete all node_modules directories
|
||||
# Define the list of directories we will delete
|
||||
directories=(
|
||||
"."
|
||||
"./packages/data-provider"
|
||||
"./client"
|
||||
"./api"
|
||||
)
|
||||
|
||||
# Loop over each directory and delete the node_modules folder if it exists
|
||||
for dir in "${directories[@]}"; do
|
||||
nodeModulesPath="$dir/node_modules"
|
||||
if [ -d "$nodeModulesPath" ]; then
|
||||
echo "Deleting node_modules in $dir"
|
||||
rm -rf "$nodeModulesPath"
|
||||
fi
|
||||
done
|
||||
|
||||
# Step 3: Clean the npm cache
|
||||
npm cache clean --force
|
||||
|
||||
# Step 4: Install dependencies
|
||||
npm ci
|
||||
|
||||
# Step 5: Build client-side (frontend) code
|
||||
npm run frontend
|
||||
|
||||
# Start LibreChat
|
||||
npm run backend
|
||||
```
|
||||
|
||||
The above assumes that you're using the default terminal application on Linux and are executing the commands from the project directory. The commands are written in Bash, which is a common default shell for many Linux distributions. While some systems might use other shells like `zsh` or `fish`, these commands should be compatible with most of them.
|
||||
|
||||
---
|
||||
|
||||
>⚠️ 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.
|
||||
142
docs/install/installation/mac_install.md
Normal file
142
docs/install/installation/mac_install.md
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
---
|
||||
title: 🍎 Mac
|
||||
weight: 0
|
||||
---
|
||||
|
||||
# Mac Installation Guide
|
||||
## **Recommended : [Docker Install](docker_compose_install.md)**
|
||||
- 👆 Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
|
||||
---
|
||||
|
||||
## **Manual Installation**
|
||||
|
||||
### Install the prerequisites (Required)
|
||||
- Install Homebrew (if not already installed) by following the instructions on https://brew.sh/
|
||||
- Install Node.js and npm by running `brew install node`
|
||||
|
||||
### Download LibreChat (Required)
|
||||
- Open Terminal and clone the repository by running `git clone https://github.com/danny-avila/LibreChat.git`
|
||||
- Change into the cloned directory by running `cd LibreChat`
|
||||
- Create a .env file by running `cp .env.example .env`
|
||||
- Install dependencies by running: `npm ci`
|
||||
- Build the client by running: `npm run frontend`
|
||||
|
||||
> You will only need to add your `MONGO_URI` (next step) for LibreChat to work. Make sure LibreChat works with the basic configuration first, you can always come back to the `.env` later for advanced configurations. See: [.env configuration](../configuration/dotenv.md)
|
||||
|
||||
### Create a MongoDB database (Required)
|
||||
- [Create an online MongoDB database](../configuration/mongodb.md) **or** Install MongoDB by running `brew tap mongodb/brew` and `brew install mongodb-community`
|
||||
- add your `MONGO_URI` in the .env file (use vscode or any text editor)
|
||||
|
||||
> Choose only one option, online or brew. Both have pros and cons
|
||||
|
||||
### [Setup your AI Endpoints](../configuration/ai_setup.md) (Required)
|
||||
- At least one AI endpoint should be setup for use.
|
||||
|
||||
### [User/Auth System](../configuration/user_auth_system.md) (Optional)
|
||||
- Set up the user/auth system and various social logins.
|
||||
|
||||
### **Download MeiliSearch for macOS (Optional):**
|
||||
- This enables the conversation search feature
|
||||
- You can download the latest MeiliSearch binary for macOS from their GitHub releases page: https://github.com/meilisearch/MeiliSearch/releases
|
||||
- Look for the file named `meilisearch-macos-amd64` (or the equivalent for your system architecture) and download it.
|
||||
|
||||
- **Make the binary executable:**
|
||||
- Open Terminal and navigate to the directory where you downloaded the MeiliSearch binary. Run the following command to make it executable: `chmod +x meilisearch-macos-amd64`
|
||||
|
||||
- **Run MeiliSearch:**
|
||||
- Now that the binary is executable, you can start MeiliSearch by running the following command: `./meilisearch-macos-amd64 --master-key your_master_key_goes_here`
|
||||
- Replace `your_master_key_goes_here` with your desired master key!
|
||||
|
||||
- MeiliSearch will start running on the default port, which is 7700. You can now use MeiliSearch in your LibreChat project.
|
||||
|
||||
- Remember to include the MeiliSearch URL and Master Key in your .env file. Your .env file should include the following lines:
|
||||
|
||||
```
|
||||
MEILISEARCH_URL=http://127.0.0.1:7700
|
||||
MEILISEARCH_KEY=your_master_key_goes_here
|
||||
```
|
||||
|
||||
> **Important:** use the same master key here and in your .env file.
|
||||
|
||||
- With MeiliSearch running and configured, the LibreChat project should now have the Conversation search feature enabled.
|
||||
|
||||
### Start LibreChat
|
||||
- In the LibreChat directory, start the application by running `npm run backend`
|
||||
- **Visit: http://localhost:3080 & enjoy**
|
||||
|
||||
---
|
||||
|
||||
### Optional but recommended:
|
||||
|
||||
- Create a script to automate the starting process by creating a new file named `librechat.sh` in the LibreChat directory and pasting the following code:
|
||||
|
||||
``` bash title="librechat.sh"
|
||||
#!/bin/bash
|
||||
# Replace "your_master_key_goes_here" with your MeiliSearch Master Key
|
||||
if [ -x "$(command -v ./meilisearch)" ]; then
|
||||
./meilisearch --master-key your_master_key_goes_here &
|
||||
fi
|
||||
npm run backend
|
||||
```
|
||||
|
||||
- Make the script executable by running: `chmod +x librechat.sh`
|
||||
|
||||
- You can now start LibreChat by running: `./librechat.sh`
|
||||
|
||||
---
|
||||
|
||||
### Update LibreChat
|
||||
|
||||
- Run `npm run update` from the project directory for a clean installation.
|
||||
|
||||
**If you're having issues running this command, you can try running what the script does manually:**
|
||||
|
||||
```bash
|
||||
# Terminal on macOS, prefix commands with `sudo` as needed
|
||||
# Step 1: Get the latest changes
|
||||
# 1a - Fetch the latest changes from Github
|
||||
git fetch origin
|
||||
|
||||
# 1b - Switch to the repo's main branch
|
||||
git checkout main
|
||||
|
||||
# 1c - Pull the latest changes to the main branch from Github
|
||||
git pull origin main
|
||||
|
||||
# Step 2: Delete all node_modules directories
|
||||
# 2a - Define the list of directories we will delete
|
||||
directories=(
|
||||
"."
|
||||
"./packages/data-provider"
|
||||
"./client"
|
||||
"./api"
|
||||
)
|
||||
|
||||
# 2b - Loop over each directory and delete the node_modules folder if it exists
|
||||
for dir in "${directories[@]}"; do
|
||||
nodeModulesPath="$dir/node_modules"
|
||||
if [ -d "$nodeModulesPath" ]; then
|
||||
echo "Deleting node_modules in $dir"
|
||||
rm -rf "$nodeModulesPath"
|
||||
fi
|
||||
done
|
||||
|
||||
# Step 3: Clean the npm cache
|
||||
npm cache clean --force
|
||||
|
||||
# Step 4: Install dependencies
|
||||
npm ci
|
||||
|
||||
# Step 5: Build client-side (frontend) code
|
||||
npm run frontend
|
||||
|
||||
# Start LibreChat
|
||||
npm run backend
|
||||
```
|
||||
|
||||
The above assumes that you're using the default Terminal application on macOS and are executing the commands from the project directory. The commands are written in Bash, which is the default shell for macOS (though newer versions use `zsh` by default, but these commands should work there as well).
|
||||
|
||||
---
|
||||
|
||||
>⚠️ 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.
|
||||
167
docs/install/installation/windows_install.md
Normal file
167
docs/install/installation/windows_install.md
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
---
|
||||
title: 🪟 Windows
|
||||
weight: 0
|
||||
---
|
||||
|
||||
# Windows Installation Guide
|
||||
|
||||
## **Recommended:**
|
||||
|
||||
[](https://youtu.be/naUHHqpyOo4)
|
||||
Click on the thumbnail to open the video☝️
|
||||
---
|
||||
|
||||
In this video we're going to install LibreChat on Windows 11 using Docker and Git.
|
||||
|
||||
#### Timestamps
|
||||
|
||||
- 0:00 - Intro
|
||||
- 0:10 - Requirements
|
||||
- 0:31 - Docker Installation
|
||||
- 1:50 - Git Installation
|
||||
- 2:27 - LibreChat Installation
|
||||
- 3:07 - Start LibreChat
|
||||
- 3:59 - Access to LibreChat
|
||||
- 4:23 - Outro
|
||||
|
||||
#### Instructions
|
||||
- To install LibreChat, you need Docker desktop and Git. Download them from these links:
|
||||
- Docker desktop: https://www.docker.com/products/docke...
|
||||
- Git: https://git-scm.com/download/win
|
||||
- Follow the steps in the video to install and run Docker desktop and Git.
|
||||
- Open a terminal in the root of the C drive and enter these commands:
|
||||
- `git clone https://github.com/danny-avila/LibreChat`
|
||||
- `cd LibreChat`
|
||||
- `copy .env.example .env`
|
||||
- `docker-compose up`
|
||||
- Visit http://localhost:3080/ to access LibreChat. Create an account and start chatting.
|
||||
|
||||
- [Manage Your MongoDB Database (optional)](../../features/manage_your_database.md)
|
||||
Safely access and manage your MongoDB database using Mongo Express
|
||||
|
||||
Have fun!
|
||||
|
||||
> Note: See the [Docker Compose Install Guide](./docker_compose_install.md) for more details
|
||||
|
||||
- 👆 Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.
|
||||
|
||||
---
|
||||
## **Manual Installation**
|
||||
|
||||
- Install the prerequisites on your machine 👇
|
||||
|
||||
### Download and Install Node.js (Required)
|
||||
|
||||
- Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.)
|
||||
|
||||
### Download and Install Git (Recommended)
|
||||
- Git: https://git-scm.com/download/win
|
||||
|
||||
### [Create a MongoDB database](../configuration/mongodb.md) (Required)
|
||||
|
||||
### [Setup your AI Endpoints](../configuration/ai_setup.md) (Required)
|
||||
- At least one AI endpoint should be setup for use.
|
||||
|
||||
### Download LibreChat (Required)
|
||||
- (With Git) Open Terminal (command prompt) and clone the repository by running `git clone https://github.com/danny-avila/LibreChat.git`
|
||||
- Or download the latest release here: https://github.com/danny-avila/LibreChat/releases/
|
||||
- Or by clicking on the green code button in the top of the page and selecting "Download ZIP"
|
||||
- If you downloaded a zip file, extract the content in "C:/LibreChat/"
|
||||
- **IMPORTANT : If you install the files somewhere else modify the instructions accordingly**
|
||||
|
||||
### Enable the Conversation search feature: (optional)
|
||||
|
||||
- Download MeiliSearch latest release from : https://github.com/meilisearch/meilisearch/releases
|
||||
- Copy it to "C:/LibreChat/"
|
||||
- Rename the file to "meilisearch.exe"
|
||||
- Open it by double clicking on it
|
||||
- Copy the generated Master Key and save it somewhere (You will need it later)
|
||||
|
||||
### [User/Auth System](../configuration/user_auth_system.md) (Optional)
|
||||
- How to set up the user/auth system and Google login.
|
||||
|
||||
## Setup and Run LibreChat
|
||||
Using the command line (in the root directory)
|
||||
### To setup the app:
|
||||
1. Run `npm ci` (this step will also create the env file)
|
||||
2. Run `npm run frontend`
|
||||
|
||||
### To use the app:
|
||||
1. Run `npm run backend`
|
||||
2. Run `meilisearch --master-key <meilisearch_Master_Key>` (Only if SEARCH=TRUE)
|
||||
3. Visit http://localhost:3080 (default port) & enjoy
|
||||
|
||||
### Using a batch file
|
||||
|
||||
- **Make a batch file to automate the starting process**
|
||||
- Open a text editor
|
||||
- Paste the following code in a new document
|
||||
- The meilisearch executable needs to be at the root of the LibreChat directory
|
||||
- Put your MeiliSearch master key instead of "`<meilisearch_Master_Key>`"
|
||||
- Save the file as "C:/LibreChat/LibreChat.bat"
|
||||
- you can make a shortcut of this batch file and put it anywhere
|
||||
|
||||
```bat title="LibreChat.bat"
|
||||
start "MeiliSearch" cmd /k "meilisearch --master-key <meilisearch_Master_Key>
|
||||
|
||||
start "LibreChat" cmd /k "npm run backend"
|
||||
|
||||
REM this batch file goes at the root of the LibreChat directory (C:/LibreChat/)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## **Update**
|
||||
|
||||
- Run `npm run update` from the project directory for a clean installation.
|
||||
|
||||
If you're having issues running this command, you can try running what the script does manually:
|
||||
|
||||
```powershell
|
||||
# Windows PowerShell terminal
|
||||
|
||||
# Step 1: Get the latest changes
|
||||
|
||||
# Fetch the latest changes from Github
|
||||
git fetch origin
|
||||
# Switch to the repo's main branch
|
||||
git checkout main
|
||||
# Pull the latest changes to the main branch from Github
|
||||
git pull origin main
|
||||
|
||||
# Step 2: Delete all node_modules directories
|
||||
# Define he list of directories we will delete
|
||||
$directories = @(
|
||||
".",
|
||||
".\packages\data-provider",
|
||||
".\client",
|
||||
".\api"
|
||||
)
|
||||
|
||||
# Loop over each directory and delete the node_modules folder if it exists
|
||||
foreach ($dir in $directories) {
|
||||
$nodeModulesPath = Join-Path -Path $dir -ChildPath "node_modules"
|
||||
if (Test-Path $nodeModulesPath) {
|
||||
Write-Host "Deleting node_modules in $dir"
|
||||
Remove-Item -Recurse -Force $nodeModulesPath
|
||||
}
|
||||
}
|
||||
|
||||
# Step 3: Clean the npm cache
|
||||
npm cache clean --force
|
||||
|
||||
# Step 4: Install dependencies
|
||||
npm ci
|
||||
|
||||
# Step 5: Build client-side (frontend) code
|
||||
npm run frontend
|
||||
|
||||
# Start LibreChat
|
||||
npm run backend
|
||||
```
|
||||
|
||||
The above assumes that you're using the Windows PowerShell application on a Windows system and are executing the commands from the project directory. The commands are tailored for PowerShell, which is a powerful scripting environment native to Windows. While Windows also offers the Command Prompt and newer versions have the Windows Subsystem for Linux (WSL), the provided instructions are specifically designed for PowerShell.
|
||||
|
||||
---
|
||||
|
||||
>⚠️ 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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue