diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index fd2a759b99b..c67fca63019 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -57,7 +57,6 @@ services: # ports: # - 7700:7700 # if exposing these ports, make sure your master key is not the default value environment: - - MEILI_HTTP_ADDR=meilisearch:7700 - MEILI_NO_ANALYTICS=true - MEILI_MASTER_KEY=5c71cf56d672d009e36070b5bc5e47b743535ae55c818ae3b735bb6ebfb4ba63 volumes: diff --git a/.dockerignore b/.dockerignore index 0f03be58859..396f0da3e57 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,17 @@ +**/.circleci +**/.editorconfig +**/.dockerignore +**/.git +**/.DS_Store +**/.vscode **/node_modules -client/dist/images + +# Specific patterns to ignore data-node -.env -**/.env \ No newline at end of file +meili_data* +librechat* +Dockerfile* +docs + +# Ignore all hidden files +.* diff --git a/.env.example b/.env.example index 22b7743e0d0..2e23a09a349 100644 --- a/.env.example +++ b/.env.example @@ -101,7 +101,7 @@ GOOGLE_KEY=user_provided #============# OPENAI_API_KEY=user_provided -# OPENAI_MODELS=gpt-3.5-turbo-1106,gpt-4-1106-preview,gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-3.5-turbo-0301,text-davinci-003,gpt-4,gpt-4-0314,gpt-4-0613 +# OPENAI_MODELS=gpt-3.5-turbo-1106,gpt-4-1106-preview,gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-3.5-turbo-0301,gpt-4,gpt-4-0314,gpt-4-0613 DEBUG_OPENAI=false @@ -115,6 +115,8 @@ DEBUG_OPENAI=false # OPENAI_REVERSE_PROXY= +# OPENAI_ORGANIZATION= + #============# # OpenRouter # #============# @@ -143,11 +145,22 @@ AZURE_AI_SEARCH_SEARCH_OPTION_QUERY_TYPE= AZURE_AI_SEARCH_SEARCH_OPTION_TOP= AZURE_AI_SEARCH_SEARCH_OPTION_SELECT= -# DALL·E 3 +# DALL·E +#---------------- +# DALLE_API_KEY= # Key for both DALL-E-2 and DALL-E-3 +# DALLE3_API_KEY= # Key for DALL-E-3 only +# DALLE2_API_KEY= # Key for DALL-E-2 only +# DALLE3_SYSTEM_PROMPT="Your DALL-E-3 System Prompt here" +# DALLE2_SYSTEM_PROMPT="Your DALL-E-2 System Prompt here" +# DALLE_REVERSE_PROXY= # Reverse proxy for DALL-E-2 and DALL-E-3 +# DALLE3_BASEURL= # Base URL for DALL-E-3 +# DALLE2_BASEURL= # Base URL for DALL-E-2 + +# DALL·E (via Azure OpenAI) +# Note: requires some of the variables above to be set #---------------- -# DALLE_API_KEY= -# DALLE3_SYSTEM_PROMPT="Your System Prompt here" -# DALLE_REVERSE_PROXY= +# DALLE3_AZURE_API_VERSION= # Azure OpenAI API version for DALL-E-3 +# DALLE2_AZURE_API_VERSION= # Azure OpenAI API versiion for DALL-E-2 # Google #----------------- @@ -177,7 +190,6 @@ ZAPIER_NLA_API_KEY= SEARCH=true MEILI_NO_ANALYTICS=true MEILI_HOST=http://0.0.0.0:7700 -MEILI_HTTP_ADDR=0.0.0.0:7700 MEILI_MASTER_KEY=DrhYf7zENyR6AlUCKmnz0eYASOQdl6zxH7s7MKFSfFCt #===================================================# diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 949d39cfe04..23c6ad48cc8 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -19,6 +19,10 @@ jobs: - name: Set up Docker uses: docker/setup-buildx-action@v3 + # Set up QEMU for cross-platform builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + # Log in to GitHub Container Registry - name: Log in to GitHub Container Registry uses: docker/login-action@v2 @@ -27,26 +31,53 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # Run docker-compose build + # Prepare Docker Build - name: Build Docker images run: | cp .env.example .env - docker-compose build - docker build -f Dockerfile.multi --target api-build -t librechat-api . - # Get Tag Name - - name: Get Tag Name - id: tag_name - run: echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + # Tag and push librechat-api + - name: Docker metadata for librechat-api + id: meta-librechat-api + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/librechat-api + tags: | + type=raw,value=latest + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} - # Tag it properly before push to github - - name: tag image and push - run: | - docker tag librechat:latest ghcr.io/${{ github.repository_owner }}/librechat:${{ env.TAG_NAME }} - docker push ghcr.io/${{ github.repository_owner }}/librechat:${{ env.TAG_NAME }} - docker tag librechat:latest ghcr.io/${{ github.repository_owner }}/librechat:latest - docker push ghcr.io/${{ github.repository_owner }}/librechat:latest - docker tag librechat-api:latest ghcr.io/${{ github.repository_owner }}/librechat-api:${{ env.TAG_NAME }} - docker push ghcr.io/${{ github.repository_owner }}/librechat-api:${{ env.TAG_NAME }} - docker tag librechat-api:latest ghcr.io/${{ github.repository_owner }}/librechat-api:latest - docker push ghcr.io/${{ github.repository_owner }}/librechat-api:latest + - name: Build and librechat-api + uses: docker/build-push-action@v5 + with: + file: Dockerfile.multi + context: . + push: true + tags: ${{ steps.meta-librechat-api.outputs.tags }} + platforms: linux/amd64,linux/arm64 + target: api-build + + # Tag and push librechat + - name: Docker metadata for librechat + id: meta-librechat + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/${{ github.repository_owner }}/librechat + tags: | + type=raw,value=latest + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + + - name: Build and librechat + uses: docker/build-push-action@v5 + with: + file: Dockerfile + context: . + push: true + tags: ${{ steps.meta-librechat.outputs.tags }} + platforms: linux/amd64,linux/arm64 + target: node diff --git a/.gitignore b/.gitignore index f360cbba0ac..765de5cb799 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,9 @@ bower_components/ .floo .flooignore +#config file +librechat.yaml + # Environment .npmrc .env* @@ -66,6 +69,7 @@ src/style - official.css .DS_Store *.code-workspace .idea +*.iml *.pem config.local.ts **/storageState.json diff --git a/Dockerfile b/Dockerfile index 1dac186b17f..edc79c2497a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,14 @@ # Base node image -FROM node:19-alpine AS node +FROM node:18-alpine AS node COPY . /app WORKDIR /app +# Allow mounting of these files, which have no default +# values. +RUN touch .env # Install call deps - Install curl for health check RUN apk --no-cache add curl && \ - # We want to inherit env from the container, not the file - # This will preserve any existing env file if it's already in source - # otherwise it will create a new one - touch .env && \ - # Build deps in seperate npm ci # React client build diff --git a/LICENSE b/LICENSE index 752f1a45809..49a224977b1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 LibreChat +Copyright (c) 2024 LibreChat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index cfd0d8ffd45..00cd890b073 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@
-
+
@@ -26,6 +26,18 @@
+
+
+
+
+
+
+
+