diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000..6912fcd4a804e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/devcontainers/features/node:1": {} + } +} diff --git a/.env.example b/.env.example index ec6de216f5b20..b7a7f4b7e6e88 100644 --- a/.env.example +++ b/.env.example @@ -106,6 +106,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx ### DeepSeek AI #### +# DEEPSEEK_PROXY_URL=https://api.deepseek.com/v1 # DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ### Qwen AI #### @@ -121,6 +122,11 @@ OPENAI_API_KEY=sk-xxxxxxxxx # SILICONCLOUD_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + +### TencentCloud AI #### + +# TENCENT_CLOUD_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + ######################################## ############ Market Service ############ ######################################## @@ -189,6 +195,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx # NextAuth related configurations +# NEXT_PUBLIC_ENABLE_NEXT_AUTH=1 # NEXT_AUTH_SECRET= # Auth0 configurations @@ -208,4 +215,7 @@ OPENAI_API_KEY=sk-xxxxxxxxx # use `openssl rand -base64 32` to generate a key for the encryption of the database # we use this key to encrypt the user api key -# KEY_VAULTS_SECRET=xxxxx/xxxxxxxxxxxxxx= +#KEY_VAULTS_SECRET=xxxxx/xxxxxxxxxxxxxx= + +# Specify the Embedding model and Reranker model(unImplemented) +# DEFAULT_FILES_CONFIG="embedding_model=openai/embedding-text-3-small,reranker_model=cohere/rerank-english-v3.0,query_mode=full_text" diff --git a/.github/ISSUE_TEMPLATE/1_bug_report.yml b/.github/ISSUE_TEMPLATE/1_bug_report.yml index da46729467f95..6a0857fd91674 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/1_bug_report.yml @@ -5,7 +5,7 @@ labels: ['🐛 Bug'] body: - type: dropdown attributes: - label: '📦 Environment' + label: '📦 Platform' multiple: true options: - 'Official Preview' @@ -13,10 +13,19 @@ body: - 'Zeabur' - 'Sealos' - 'Netlify' - - 'Docker' + - 'Self hosting Docker' - 'Other' validations: required: true + - type: dropdown + attributes: + label: '📦 Deploymenet mode' + multiple: true + options: + - 'client db (lobe-chat image)' + - 'server db(lobe-chat-database image)' + validations: + required: true - type: input attributes: label: '📌 Version' diff --git a/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml b/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml index 3580c854254bf..2af99235ee51c 100644 --- a/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml +++ b/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml @@ -17,6 +17,15 @@ body: - 'Other' validations: required: true + - type: dropdown + attributes: + label: '📦 部署模式' + multiple: true + options: + - '客户端模式(lobe-chat 镜像)' + - '服务端模式(lobe-chat-database 镜像)' + validations: + required: true - type: input attributes: label: '📌 软件版本' diff --git a/.github/workflows/docker-database.yml b/.github/workflows/docker-database.yml index 5d82c112fbaff..5b72796531ec6 100644 --- a/.github/workflows/docker-database.yml +++ b/.github/workflows/docker-database.yml @@ -4,43 +4,158 @@ on: workflow_dispatch: release: types: [published] + pull_request: + types: [synchronize, labeled, unlabeled] + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +env: + REGISTRY_IMAGE: lobehub/lobe-chat-database + PR_TAG_PREFIX: pr- jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest + build: + # 添加 PR label 触发条件 + if: | + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Build Docker')) || + github.event_name != 'pull_request' + + strategy: + matrix: + include: + - platform: linux/amd64 + os: ubuntu-latest + - platform: linux/arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + name: Build ${{ matrix.platform }} Image steps: - - name: Check out the repo + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Checkout base uses: actions/checkout@v4 - - name: Log in to Docker Hub - uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_REGISTRY_USER }} - password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker + # 为 PR 生成特殊的 tag + - name: Generate PR metadata + if: github.event_name == 'pull_request' + id: pr_meta + run: | + branch_name="${{ github.head_ref }}" + sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g') + echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: lobehub/lobe-chat-database + images: ${{ env.REGISTRY_IMAGE }} tags: | - type=raw,value=latest - type=ref,event=tag + # PR 构建使用特殊的 tag + type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }} + # release 构建使用版本号 + type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }} + type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Docker login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Get commit SHA + if: github.ref == 'refs/heads/main' + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Build and push Docker image + - name: Build and export + id: build uses: docker/build-push-action@v5 with: + platforms: ${{ matrix.platform }} context: . - file: ./Dockerfile.database # 指定使用 Dockerfile.database 文件 - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} + file: ./Dockerfile.database labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + build-args: | + SHA=${{ steps.vars.outputs.sha_short }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + rm -rf /tmp/digests + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: digest-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Merge + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout base + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digest-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # 为 merge job 添加 PR metadata 生成 + - name: Generate PR metadata + if: github.event_name == 'pull_request' + id: pr_meta + run: | + branch_name="${{ github.head_ref }}" + sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g') + echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + tags: | + type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }} + type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }} + type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }} + + - name: Docker login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cbfce1c8bb622..b767a2339863d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,42 +4,158 @@ on: workflow_dispatch: release: types: [published] + pull_request: + types: [synchronize, labeled, unlabeled] + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +env: + REGISTRY_IMAGE: lobehub/lobe-chat + PR_TAG_PREFIX: pr- jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest + build: + # 添加 PR label 触发条件 + if: | + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'Build Docker')) || + github.event_name != 'pull_request' + + strategy: + matrix: + include: + - platform: linux/amd64 + os: ubuntu-latest + - platform: linux/arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + name: Build ${{ matrix.platform }} Image steps: - - name: Check out the repo + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Checkout base uses: actions/checkout@v4 - - name: Log in to Docker Hub - uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_REGISTRY_USER }} - password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + fetch-depth: 0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker + # 为 PR 生成特殊的 tag + - name: Generate PR metadata + if: github.event_name == 'pull_request' + id: pr_meta + run: | + branch_name="${{ github.head_ref }}" + sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g') + echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: lobehub/lobe-chat + images: ${{ env.REGISTRY_IMAGE }} tags: | - type=raw,value=latest - type=ref,event=tag + # PR 构建使用特殊的 tag + type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }} + # release 构建使用版本号 + type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }} + type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Docker login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Get commit SHA + if: github.ref == 'refs/heads/main' + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Build and push Docker image + - name: Build and export + id: build uses: docker/build-push-action@v5 with: + platforms: ${{ matrix.platform }} context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} + file: ./Dockerfile labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + build-args: | + SHA=${{ steps.vars.outputs.sha_short }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + rm -rf /tmp/digests + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: digest-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Merge + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout base + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digest-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # 为 merge job 添加 PR metadata 生成 + - name: Generate PR metadata + if: github.event_name == 'pull_request' + id: pr_meta + run: | + branch_name="${{ github.head_ref }}" + sanitized_branch=$(echo "${branch_name}" | sed -E 's/[^a-zA-Z0-9_.-]+/-/g') + echo "pr_tag=${sanitized_branch}-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + tags: | + type=raw,value=${{ env.PR_TAG_PREFIX }}${{ steps.pr_meta.outputs.pr_tag }},enable=${{ github.event_name == 'pull_request' }} + type=semver,pattern={{version}},enable=${{ github.event_name != 'pull_request' }} + type=raw,value=latest,enable=${{ github.event_name != 'pull_request' }} + + - name: Docker login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index 39cb86013b434..0e593b0b46746 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -18,28 +18,20 @@ on: jobs: lighthouse-badger-advanced: name: ${{ matrix.NAME }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 8 strategy: fail-fast: false matrix: include: - - NAME: 'LobeChat | Welcome' - URLS: 'https://chat-preview.lobehub.com/welcome' - BADGES_ARGS: '-b pagespeed -o lighthouse/welcome -r' - COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Welcome' - NAME: 'LobeChat | Chat' - URLS: 'https://chat-preview.lobehub.com/chat' + URLS: 'https://lobechat.com/chat' BADGES_ARGS: '-b pagespeed -o lighthouse/chat -r' COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Chat' - NAME: 'LobeChat | Market' - URLS: 'https://chat-preview.lobehub.com/market' - BADGES_ARGS: '-b pagespeed -o lighthouse/market -r' - COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Market' - - NAME: 'LobeChat | Settings' - URLS: 'https://chat-preview.lobehub.com/settings' - BADGES_ARGS: '-b pagespeed -o lighthouse/settings -r' - COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Settings' + URLS: 'https://lobechat.com/discover' + BADGES_ARGS: '-b pagespeed -o lighthouse/discover -r' + COMMIT_MESSAGE: '🤖 chore: Lighthouse Results | Discover' steps: - name: Preparatory Tasks diff --git a/.gitignore b/.gitignore index 57532f752c639..213af9b910616 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,4 @@ public/swe-worker* *.patch *.pdf vertex-ai-key.json +.pnpm-store \ No newline at end of file diff --git a/.remarkrc.mdx.js b/.remarkrc.mdx.js new file mode 100644 index 0000000000000..22af1dc8a10a1 --- /dev/null +++ b/.remarkrc.mdx.js @@ -0,0 +1,6 @@ +const config = require('@lobehub/lint').remarklint; + +module.exports = { + ...config, + plugins: ['remark-mdx', ...config.plugins], +}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 748850639cd19..4d00ec0040249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,3799 @@ # Changelog +## [Version 1.59.0](https://github.com/lobehub/lobe-chat/compare/v1.58.0...v1.59.0) + +Released on **2025-02-16** + +#### ✨ Features + +- **misc**: Add volcengine as a new provider. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add volcengine as a new provider, closes [#6221](https://github.com/lobehub/lobe-chat/issues/6221) ([09bf8f0](https://github.com/lobehub/lobe-chat/commit/09bf8f0)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.58.0](https://github.com/lobehub/lobe-chat/compare/v1.57.1...v1.58.0) + +Released on **2025-02-16** + +#### ✨ Features + +- **misc**: Add Azure AI as new Provider. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add Azure AI as new Provider, closes [#6214](https://github.com/lobehub/lobe-chat/issues/6214) ([30e010f](https://github.com/lobehub/lobe-chat/commit/30e010f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.57.1](https://github.com/lobehub/lobe-chat/compare/v1.57.0...v1.57.1) + +Released on **2025-02-16** + +#### 💄 Styles + +- **misc**: Fix mobile agent settings not show correctly. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Fix mobile agent settings not show correctly, closes [#6203](https://github.com/lobehub/lobe-chat/issues/6203) ([0285d95](https://github.com/lobehub/lobe-chat/commit/0285d95)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.57.0](https://github.com/lobehub/lobe-chat/compare/v1.56.5...v1.57.0) + +Released on **2025-02-16** + +#### ✨ Features + +- **misc**: Add Jina AI model provider support. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add Jina AI model provider support, closes [#6140](https://github.com/lobehub/lobe-chat/issues/6140) ([6b4c15b](https://github.com/lobehub/lobe-chat/commit/6b4c15b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.56.5](https://github.com/lobehub/lobe-chat/compare/v1.56.4...v1.56.5) + +Released on **2025-02-16** + +#### 🐛 Bug Fixes + +- **misc**: Match o1 series models more robust in Azure OpenAI provider, set max_completion_tokens to null for Azure OpenAI. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Match o1 series models more robust in Azure OpenAI provider, closes [#6193](https://github.com/lobehub/lobe-chat/issues/6193) ([f444e66](https://github.com/lobehub/lobe-chat/commit/f444e66)) +- **misc**: Set max_completion_tokens to null for Azure OpenAI, closes [#6198](https://github.com/lobehub/lobe-chat/issues/6198) ([e9e8da4](https://github.com/lobehub/lobe-chat/commit/e9e8da4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.56.4](https://github.com/lobehub/lobe-chat/compare/v1.56.3...v1.56.4) + +Released on **2025-02-16** + +#### 🐛 Bug Fixes + +- **misc**: Fix ai provider description not show correctly. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix ai provider description not show correctly, closes [#6199](https://github.com/lobehub/lobe-chat/issues/6199) ([3e8d9c5](https://github.com/lobehub/lobe-chat/commit/3e8d9c5)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.56.3](https://github.com/lobehub/lobe-chat/compare/v1.56.2...v1.56.3) + +Released on **2025-02-16** + +#### 💄 Styles + +- **misc**: Improve inbox agent settings. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve inbox agent settings, closes [#6197](https://github.com/lobehub/lobe-chat/issues/6197) ([37b70f0](https://github.com/lobehub/lobe-chat/commit/37b70f0)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.56.2](https://github.com/lobehub/lobe-chat/compare/v1.56.1...v1.56.2) + +Released on **2025-02-16** + +#### 🐛 Bug Fixes + +- **misc**: Fix inbox agent can not save config. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix inbox agent can not save config, closes [#6186](https://github.com/lobehub/lobe-chat/issues/6186) ([588cba7](https://github.com/lobehub/lobe-chat/commit/588cba7)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.56.1](https://github.com/lobehub/lobe-chat/compare/v1.56.0...v1.56.1) + +Released on **2025-02-16** + +#### 🐛 Bug Fixes + +- **misc**: Fix inbox agent edit way in the new mode. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix inbox agent edit way in the new mode, closes [#6190](https://github.com/lobehub/lobe-chat/issues/6190) ([6398362](https://github.com/lobehub/lobe-chat/commit/6398362)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.56.0](https://github.com/lobehub/lobe-chat/compare/v1.55.4...v1.56.0) + +Released on **2025-02-15** + +#### ✨ Features + +- **misc**: Add configurable PDF processing method with Unstructured. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add configurable PDF processing method with Unstructured, closes [#5927](https://github.com/lobehub/lobe-chat/issues/5927) ([35fa3ee](https://github.com/lobehub/lobe-chat/commit/35fa3ee)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.55.4](https://github.com/lobehub/lobe-chat/compare/v1.55.3...v1.55.4) + +Released on **2025-02-15** + +#### 💄 Styles + +- **misc**: Improve mobile params style. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve mobile params style, closes [#6176](https://github.com/lobehub/lobe-chat/issues/6176) ([b5276de](https://github.com/lobehub/lobe-chat/commit/b5276de)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.55.3](https://github.com/lobehub/lobe-chat/compare/v1.55.2...v1.55.3) + +Released on **2025-02-15** + +#### 💄 Styles + +- **misc**: Add deepseek r1 distill models for qwen series. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add deepseek r1 distill models for qwen series, closes [#5850](https://github.com/lobehub/lobe-chat/issues/5850) ([4a96a05](https://github.com/lobehub/lobe-chat/commit/4a96a05)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.55.2](https://github.com/lobehub/lobe-chat/compare/v1.55.1...v1.55.2) + +Released on **2025-02-15** + +#### 🐛 Bug Fixes + +- **misc**: Avoid blank reasoning with OpenRouter. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Avoid blank reasoning with OpenRouter, closes [#6153](https://github.com/lobehub/lobe-chat/issues/6153) ([c2278d1](https://github.com/lobehub/lobe-chat/commit/c2278d1)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.55.1](https://github.com/lobehub/lobe-chat/compare/v1.55.0...v1.55.1) + +Released on **2025-02-15** + +#### 🐛 Bug Fixes + +- **misc**: Fix Azure OpenAI O1 models and refactor the Azure OpenAI implement. + +#### 💄 Styles + +- **misc**: Update openrouter model list and descriptions. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix Azure OpenAI O1 models and refactor the Azure OpenAI implement, closes [#6079](https://github.com/lobehub/lobe-chat/issues/6079) ([6a89a8c](https://github.com/lobehub/lobe-chat/commit/6a89a8c)) + +#### Styles + +- **misc**: Update openrouter model list and descriptions, closes [#6160](https://github.com/lobehub/lobe-chat/issues/6160) ([3ce0485](https://github.com/lobehub/lobe-chat/commit/3ce0485)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.55.0](https://github.com/lobehub/lobe-chat/compare/v1.54.0...v1.55.0) + +Released on **2025-02-14** + +#### ✨ Features + +- **misc**: Add vLLM provider support. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add vLLM provider support, closes [#6154](https://github.com/lobehub/lobe-chat/issues/6154) ([1708e32](https://github.com/lobehub/lobe-chat/commit/1708e32)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.54.0](https://github.com/lobehub/lobe-chat/compare/v1.53.12...v1.54.0) + +Released on **2025-02-14** + +#### ✨ Features + +- **misc**: Add Nvidia NIM provider support. + +#### 💄 Styles + +- **misc**: Improve advanced params settings. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add Nvidia NIM provider support, closes [#6142](https://github.com/lobehub/lobe-chat/issues/6142) ([ab796a7](https://github.com/lobehub/lobe-chat/commit/ab796a7)) + +#### Styles + +- **misc**: Improve advanced params settings, closes [#6149](https://github.com/lobehub/lobe-chat/issues/6149) ([bf6699c](https://github.com/lobehub/lobe-chat/commit/bf6699c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.12](https://github.com/lobehub/lobe-chat/compare/v1.53.11...v1.53.12) + +Released on **2025-02-14** + +#### ♻ Code Refactoring + +- **misc**: Improve model fetch behavior. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Improve model fetch behavior, closes [#6055](https://github.com/lobehub/lobe-chat/issues/6055) ([4c2aaf6](https://github.com/lobehub/lobe-chat/commit/4c2aaf6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.11](https://github.com/lobehub/lobe-chat/compare/v1.53.10...v1.53.11) + +Released on **2025-02-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix provider form api key. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix provider form api key, closes [#6115](https://github.com/lobehub/lobe-chat/issues/6115) ([d074238](https://github.com/lobehub/lobe-chat/commit/d074238)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.10](https://github.com/lobehub/lobe-chat/compare/v1.53.9...v1.53.10) + +Released on **2025-02-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix api key input issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix api key input issue, closes [#6112](https://github.com/lobehub/lobe-chat/issues/6112) ([48e3b85](https://github.com/lobehub/lobe-chat/commit/48e3b85)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.9](https://github.com/lobehub/lobe-chat/compare/v1.53.8...v1.53.9) + +Released on **2025-02-13** + +#### 💄 Styles + +- **misc**: Support select check models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support select check models, closes [#6106](https://github.com/lobehub/lobe-chat/issues/6106) ([2243bbb](https://github.com/lobehub/lobe-chat/commit/2243bbb)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.8](https://github.com/lobehub/lobe-chat/compare/v1.53.7...v1.53.8) + +Released on **2025-02-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix model fetch for spark and fix the support of model reset. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix model fetch for spark and fix the support of model reset, closes [#6080](https://github.com/lobehub/lobe-chat/issues/6080) ([257fda1](https://github.com/lobehub/lobe-chat/commit/257fda1)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.7](https://github.com/lobehub/lobe-chat/compare/v1.53.6...v1.53.7) + +Released on **2025-02-13** + +#### 💄 Styles + +- **misc**: Update model list. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update model list, closes [#6056](https://github.com/lobehub/lobe-chat/issues/6056) ([be0d7f6](https://github.com/lobehub/lobe-chat/commit/be0d7f6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.6](https://github.com/lobehub/lobe-chat/compare/v1.53.5...v1.53.6) + +Released on **2025-02-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix not enable models correctly. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix not enable models correctly, closes [#6071](https://github.com/lobehub/lobe-chat/issues/6071) ([b78328e](https://github.com/lobehub/lobe-chat/commit/b78328e)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.5](https://github.com/lobehub/lobe-chat/compare/v1.53.4...v1.53.5) + +Released on **2025-02-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix latex in thinking tag render. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix latex in thinking tag render, closes [#6063](https://github.com/lobehub/lobe-chat/issues/6063) ([7e89b2d](https://github.com/lobehub/lobe-chat/commit/7e89b2d)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.4](https://github.com/lobehub/lobe-chat/compare/v1.53.3...v1.53.4) + +Released on **2025-02-12** + +#### 🐛 Bug Fixes + +- **misc**: Fix ai model abilities issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix ai model abilities issue, closes [#6060](https://github.com/lobehub/lobe-chat/issues/6060) ([718f477](https://github.com/lobehub/lobe-chat/commit/718f477)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.3](https://github.com/lobehub/lobe-chat/compare/v1.53.2...v1.53.3) + +Released on **2025-02-12** + +#### 🐛 Bug Fixes + +- **misc**: Fix tencent cloud api issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix tencent cloud api issue, closes [#6058](https://github.com/lobehub/lobe-chat/issues/6058) ([025d0bc](https://github.com/lobehub/lobe-chat/commit/025d0bc)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.2](https://github.com/lobehub/lobe-chat/compare/v1.53.1...v1.53.2) + +Released on **2025-02-12** + +#### 🐛 Bug Fixes + +- **misc**: Disable openrouter client fetch. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Disable openrouter client fetch, closes [#6043](https://github.com/lobehub/lobe-chat/issues/6043) ([63b22ce](https://github.com/lobehub/lobe-chat/commit/63b22ce)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.53.1](https://github.com/lobehub/lobe-chat/compare/v1.53.0...v1.53.1) + +Released on **2025-02-12** + +#### 🐛 Bug Fixes + +- **misc**: Fix reasoning output for OpenRouter reasoning models like deepseek-r1. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix reasoning output for OpenRouter reasoning models like deepseek-r1, closes [#5903](https://github.com/lobehub/lobe-chat/issues/5903) [#5766](https://github.com/lobehub/lobe-chat/issues/5766) ([bfd9317](https://github.com/lobehub/lobe-chat/commit/bfd9317)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.53.0](https://github.com/lobehub/lobe-chat/compare/v1.52.19...v1.53.0) + +Released on **2025-02-11** + +#### ✨ Features + +- **misc**: Support tencent cloud provider. + +#### 💄 Styles + +- **misc**: Update i18n, update provider i18n. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Support tencent cloud provider, closes [#6029](https://github.com/lobehub/lobe-chat/issues/6029) ([6ec6b08](https://github.com/lobehub/lobe-chat/commit/6ec6b08)) + +#### Styles + +- **misc**: Update i18n, closes [#6030](https://github.com/lobehub/lobe-chat/issues/6030) ([ee48e30](https://github.com/lobehub/lobe-chat/commit/ee48e30)) +- **misc**: Update provider i18n, closes [#6031](https://github.com/lobehub/lobe-chat/issues/6031) ([e0e231c](https://github.com/lobehub/lobe-chat/commit/e0e231c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.19](https://github.com/lobehub/lobe-chat/compare/v1.52.18...v1.52.19) + +Released on **2025-02-11** + +#### ♻ Code Refactoring + +- **misc**: Refactor the agent runtime test case. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor the agent runtime test case, closes [#6025](https://github.com/lobehub/lobe-chat/issues/6025) ([3414fdd](https://github.com/lobehub/lobe-chat/commit/3414fdd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.18](https://github.com/lobehub/lobe-chat/compare/v1.52.17...v1.52.18) + +Released on **2025-02-11** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.17](https://github.com/lobehub/lobe-chat/compare/v1.52.16...v1.52.17) + +Released on **2025-02-11** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.16](https://github.com/lobehub/lobe-chat/compare/v1.52.15...v1.52.16) + +Released on **2025-02-11** + +#### 💄 Styles + +- **misc**: Support mistral proxy url. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support mistral proxy url, closes [#6002](https://github.com/lobehub/lobe-chat/issues/6002) ([dcb465e](https://github.com/lobehub/lobe-chat/commit/dcb465e)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.15](https://github.com/lobehub/lobe-chat/compare/v1.52.14...v1.52.15) + +Released on **2025-02-10** + +#### 🐛 Bug Fixes + +- **misc**: Fix lmstudio baseURL. + +#### 💄 Styles + +- **misc**: Optimized MaxToken Slider. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix lmstudio baseURL, closes [#5988](https://github.com/lobehub/lobe-chat/issues/5988) ([1d19aa6](https://github.com/lobehub/lobe-chat/commit/1d19aa6)) + +#### Styles + +- **misc**: Optimized MaxToken Slider, closes [#5952](https://github.com/lobehub/lobe-chat/issues/5952) ([3cdcb95](https://github.com/lobehub/lobe-chat/commit/3cdcb95)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.14](https://github.com/lobehub/lobe-chat/compare/v1.52.13...v1.52.14) + +Released on **2025-02-10** + +#### 💄 Styles + +- **misc**: Refactor agent settings modal. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Refactor agent settings modal, closes [#5987](https://github.com/lobehub/lobe-chat/issues/5987) ([6482f8a](https://github.com/lobehub/lobe-chat/commit/6482f8a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.13](https://github.com/lobehub/lobe-chat/compare/v1.52.12...v1.52.13) + +Released on **2025-02-10** + +#### 🐛 Bug Fixes + +- **misc**: Fix Aliyun deepseek-r1 reasoning parsing with oneapi, Support Aliyun deepseek-r1 reasoning. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix Aliyun deepseek-r1 reasoning parsing with oneapi, closes [#5964](https://github.com/lobehub/lobe-chat/issues/5964) ([0d7e665](https://github.com/lobehub/lobe-chat/commit/0d7e665)) +- **misc**: Support Aliyun deepseek-r1 reasoning, closes [#5954](https://github.com/lobehub/lobe-chat/issues/5954) ([cf7a2d6](https://github.com/lobehub/lobe-chat/commit/cf7a2d6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.12](https://github.com/lobehub/lobe-chat/compare/v1.52.11...v1.52.12) + +Released on **2025-02-10** + +#### 🐛 Bug Fixes + +- **misc**: Fix language incorrect on page hydration. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix language incorrect on page hydration, closes [#5970](https://github.com/lobehub/lobe-chat/issues/5970) ([91912cf](https://github.com/lobehub/lobe-chat/commit/91912cf)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.11](https://github.com/lobehub/lobe-chat/compare/v1.52.10...v1.52.11) + +Released on **2025-02-10** + +#### 💄 Styles + +- **misc**: Support Mermaid in Artifacts. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support Mermaid in Artifacts, closes [#5947](https://github.com/lobehub/lobe-chat/issues/5947) ([892f961](https://github.com/lobehub/lobe-chat/commit/892f961)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.10](https://github.com/lobehub/lobe-chat/compare/v1.52.9...v1.52.10) + +Released on **2025-02-09** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.9](https://github.com/lobehub/lobe-chat/compare/v1.52.8...v1.52.9) + +Released on **2025-02-09** + +#### 🐛 Bug Fixes + +- **misc**: Fix changelog issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix changelog issue, closes [#5941](https://github.com/lobehub/lobe-chat/issues/5941) ([9df47a3](https://github.com/lobehub/lobe-chat/commit/9df47a3)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.8](https://github.com/lobehub/lobe-chat/compare/v1.52.7...v1.52.8) + +Released on **2025-02-09** + +#### 💄 Styles + +- **misc**: Update github model list, Update openrouter model list. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update github model list, closes [#5920](https://github.com/lobehub/lobe-chat/issues/5920) ([0676d0a](https://github.com/lobehub/lobe-chat/commit/0676d0a)) +- **misc**: Update openrouter model list, closes [#5919](https://github.com/lobehub/lobe-chat/issues/5919) ([8a185d3](https://github.com/lobehub/lobe-chat/commit/8a185d3)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.7](https://github.com/lobehub/lobe-chat/compare/v1.52.6...v1.52.7) + +Released on **2025-02-09** + +#### 🐛 Bug Fixes + +- **misc**: Rewrite to local container in docker deployment mode. + +#### 💄 Styles + +- **misc**: Update Cloudflare models. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Rewrite to local container in docker deployment mode, closes [#5910](https://github.com/lobehub/lobe-chat/issues/5910) ([f399197](https://github.com/lobehub/lobe-chat/commit/f399197)) + +#### Styles + +- **misc**: Update Cloudflare models, closes [#5899](https://github.com/lobehub/lobe-chat/issues/5899) ([b71206d](https://github.com/lobehub/lobe-chat/commit/b71206d)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.6](https://github.com/lobehub/lobe-chat/compare/v1.52.5...v1.52.6) + +Released on **2025-02-08** + +#### 💄 Styles + +- **misc**: Update ZeroOne models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update ZeroOne models, closes [#5904](https://github.com/lobehub/lobe-chat/issues/5904) ([6e8d1a7](https://github.com/lobehub/lobe-chat/commit/6e8d1a7)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.5](https://github.com/lobehub/lobe-chat/compare/v1.52.4...v1.52.5) + +Released on **2025-02-08** + +#### 🐛 Bug Fixes + +- **misc**: Fix changelog modal. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix changelog modal, closes [#5906](https://github.com/lobehub/lobe-chat/issues/5906) ([cbc5967](https://github.com/lobehub/lobe-chat/commit/cbc5967)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.4](https://github.com/lobehub/lobe-chat/compare/v1.52.3...v1.52.4) + +Released on **2025-02-08** + +#### 🐛 Bug Fixes + +- **misc**: Fix changelog modal. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix changelog modal, closes [#5894](https://github.com/lobehub/lobe-chat/issues/5894) ([2a3840b](https://github.com/lobehub/lobe-chat/commit/2a3840b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.3](https://github.com/lobehub/lobe-chat/compare/v1.52.2...v1.52.3) + +Released on **2025-02-08** + +#### 🐛 Bug Fixes + +- **misc**: Add Zhipu param limit, Fix translation in variants mode. + +#### 💄 Styles + +- **misc**: Update Gemini 2.0 models. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Add Zhipu param limit, closes [#5858](https://github.com/lobehub/lobe-chat/issues/5858) ([c299d78](https://github.com/lobehub/lobe-chat/commit/c299d78)) +- **misc**: Fix translation in variants mode, closes [#5878](https://github.com/lobehub/lobe-chat/issues/5878) ([fcbc7b9](https://github.com/lobehub/lobe-chat/commit/fcbc7b9)) + +#### Styles + +- **misc**: Update Gemini 2.0 models, closes [#5777](https://github.com/lobehub/lobe-chat/issues/5777) ([89803a5](https://github.com/lobehub/lobe-chat/commit/89803a5)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.2](https://github.com/lobehub/lobe-chat/compare/v1.52.1...v1.52.2) + +Released on **2025-02-08** + +#### 💄 Styles + +- **misc**: Add siliconcloud pro models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add siliconcloud pro models, closes [#5851](https://github.com/lobehub/lobe-chat/issues/5851) ([9b321e6](https://github.com/lobehub/lobe-chat/commit/9b321e6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.52.1](https://github.com/lobehub/lobe-chat/compare/v1.52.0...v1.52.1) + +Released on **2025-02-08** + +#### 🐛 Bug Fixes + +- **misc**: Fix static relative issues. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix static relative issues, closes [#5874](https://github.com/lobehub/lobe-chat/issues/5874) ([419977b](https://github.com/lobehub/lobe-chat/commit/419977b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.52.0](https://github.com/lobehub/lobe-chat/compare/v1.51.16...v1.52.0) + +Released on **2025-02-08** + +#### ✨ Features + +- **misc**: Refactor the auth condition in Next Auth. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Refactor the auth condition in Next Auth, closes [#5866](https://github.com/lobehub/lobe-chat/issues/5866) ([e529108](https://github.com/lobehub/lobe-chat/commit/e529108)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.16](https://github.com/lobehub/lobe-chat/compare/v1.51.15...v1.51.16) + +Released on **2025-02-07** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.15](https://github.com/lobehub/lobe-chat/compare/v1.51.14...v1.51.15) + +Released on **2025-02-07** + +#### 🐛 Bug Fixes + +- **misc**: Fix home next auth error and update pnpm. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix home next auth error and update pnpm, closes [#5833](https://github.com/lobehub/lobe-chat/issues/5833) ([aa74d20](https://github.com/lobehub/lobe-chat/commit/aa74d20)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.14](https://github.com/lobehub/lobe-chat/compare/v1.51.13...v1.51.14) + +Released on **2025-02-07** + +#### ♻ Code Refactoring + +- **misc**: Update changelog cache and upgrade anthropic sdk. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Update changelog cache and upgrade anthropic sdk, closes [#5829](https://github.com/lobehub/lobe-chat/issues/5829) ([620df2f](https://github.com/lobehub/lobe-chat/commit/620df2f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.13](https://github.com/lobehub/lobe-chat/compare/v1.51.12...v1.51.13) + +Released on **2025-02-07** + +#### 🐛 Bug Fixes + +- **misc**: Fix next auth error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix next auth error, closes [#5825](https://github.com/lobehub/lobe-chat/issues/5825) ([4509b7a](https://github.com/lobehub/lobe-chat/commit/4509b7a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.12](https://github.com/lobehub/lobe-chat/compare/v1.51.11...v1.51.12) + +Released on **2025-02-07** + +#### 🐛 Bug Fixes + +- **misc**: Try to fix next-auth issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Try to fix next-auth issue, closes [#5813](https://github.com/lobehub/lobe-chat/issues/5813) ([8e316bd](https://github.com/lobehub/lobe-chat/commit/8e316bd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.11](https://github.com/lobehub/lobe-chat/compare/v1.51.10...v1.51.11) + +Released on **2025-02-06** + +#### 🐛 Bug Fixes + +- **misc**: Fix `/file/[id]` 500 issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix `/file/[id]` 500 issue, closes [#5812](https://github.com/lobehub/lobe-chat/issues/5812) ([9bb387e](https://github.com/lobehub/lobe-chat/commit/9bb387e)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.10](https://github.com/lobehub/lobe-chat/compare/v1.51.9...v1.51.10) + +Released on **2025-02-06** + +#### 🐛 Bug Fixes + +- **misc**: Fix provider 500 issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix provider 500 issue, closes [#5807](https://github.com/lobehub/lobe-chat/issues/5807) ([db860b5](https://github.com/lobehub/lobe-chat/commit/db860b5)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.9](https://github.com/lobehub/lobe-chat/compare/v1.51.8...v1.51.9) + +Released on **2025-02-06** + +#### 💄 Styles + +- **misc**: Update edtion tag display and improve prerender. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update edtion tag display and improve prerender, closes [#5800](https://github.com/lobehub/lobe-chat/issues/5800) ([673109b](https://github.com/lobehub/lobe-chat/commit/673109b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.8](https://github.com/lobehub/lobe-chat/compare/v1.51.7...v1.51.8) + +Released on **2025-02-06** + +#### ♻ Code Refactoring + +- **misc**: Refactor model fetch method. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor model fetch method, closes [#5768](https://github.com/lobehub/lobe-chat/issues/5768) ([e406908](https://github.com/lobehub/lobe-chat/commit/e406908)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.7](https://github.com/lobehub/lobe-chat/compare/v1.51.6...v1.51.7) + +Released on **2025-02-06** + +#### 💄 Styles + +- **misc**: Add Aliyun deepseek-r1 distill models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add Aliyun deepseek-r1 distill models, closes [#5769](https://github.com/lobehub/lobe-chat/issues/5769) ([8b68190](https://github.com/lobehub/lobe-chat/commit/8b68190)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.6](https://github.com/lobehub/lobe-chat/compare/v1.51.5...v1.51.6) + +Released on **2025-02-06** + +#### 🐛 Bug Fixes + +- **misc**: Try to fix discover error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Try to fix discover error, closes [#5794](https://github.com/lobehub/lobe-chat/issues/5794) ([9b7bd99](https://github.com/lobehub/lobe-chat/commit/9b7bd99)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.5](https://github.com/lobehub/lobe-chat/compare/v1.51.4...v1.51.5) + +Released on **2025-02-06** + +#### 💄 Styles + +- **misc**: Add siliconcloud models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add siliconcloud models, closes [#5725](https://github.com/lobehub/lobe-chat/issues/5725) ([e84853c](https://github.com/lobehub/lobe-chat/commit/e84853c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.4](https://github.com/lobehub/lobe-chat/compare/v1.51.3...v1.51.4) + +Released on **2025-02-06** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.3](https://github.com/lobehub/lobe-chat/compare/v1.51.2...v1.51.3) + +Released on **2025-02-05** + +#### ♻ Code Refactoring + +- **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory. + +#### 🐛 Bug Fixes + +- **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash. + +#### 💄 Styles + +- **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory, closes [#5729](https://github.com/lobehub/lobe-chat/issues/5729) ([a90a75e](https://github.com/lobehub/lobe-chat/commit/a90a75e)) + +#### What's fixed + +- **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash, closes [#5633](https://github.com/lobehub/lobe-chat/issues/5633) ([7d782b1](https://github.com/lobehub/lobe-chat/commit/7d782b1)) + +#### Styles + +- **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel, closes [#5764](https://github.com/lobehub/lobe-chat/issues/5764) ([db4e9c7](https://github.com/lobehub/lobe-chat/commit/db4e9c7)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.2](https://github.com/lobehub/lobe-chat/compare/v1.51.1...v1.51.2) + +Released on **2025-02-05** + +#### 💄 Styles + +- **misc**: Update model list, add reasoning tag. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update model list, add reasoning tag, closes [#5696](https://github.com/lobehub/lobe-chat/issues/5696) ([dedd784](https://github.com/lobehub/lobe-chat/commit/dedd784)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.51.1](https://github.com/lobehub/lobe-chat/compare/v1.51.0...v1.51.1) + +Released on **2025-02-05** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.51.0](https://github.com/lobehub/lobe-chat/compare/v1.50.5...v1.51.0) + +Released on **2025-02-05** + +#### ✨ Features + +- **misc**: Add reasoning tag support for custom models via UI or ENV. + +#### 🐛 Bug Fixes + +- **misc**: Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, fix model ability missing. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add reasoning tag support for custom models via UI or ENV, closes [#5684](https://github.com/lobehub/lobe-chat/issues/5684) ([3499403](https://github.com/lobehub/lobe-chat/commit/3499403)) + +#### What's fixed + +- **misc**: Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, closes [#5741](https://github.com/lobehub/lobe-chat/issues/5741) ([ee61653](https://github.com/lobehub/lobe-chat/commit/ee61653)) +- **misc**: Fix model ability missing, closes [#5739](https://github.com/lobehub/lobe-chat/issues/5739) ([0e1a022](https://github.com/lobehub/lobe-chat/commit/0e1a022)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.50.5](https://github.com/lobehub/lobe-chat/compare/v1.50.4...v1.50.5) + +Released on **2025-02-04** + +#### 💄 Styles + +- **misc**: Add/Update Aliyun Cloud Models, update GitHub Models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add/Update Aliyun Cloud Models, closes [#5613](https://github.com/lobehub/lobe-chat/issues/5613) ([95cd822](https://github.com/lobehub/lobe-chat/commit/95cd822)) +- **misc**: Update GitHub Models, closes [#5683](https://github.com/lobehub/lobe-chat/issues/5683) ([ed4e048](https://github.com/lobehub/lobe-chat/commit/ed4e048)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.50.4](https://github.com/lobehub/lobe-chat/compare/v1.50.3...v1.50.4) + +Released on **2025-02-04** + +#### 🐛 Bug Fixes + +- **misc**: Fix invalid utf8 character. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix invalid utf8 character, closes [#5732](https://github.com/lobehub/lobe-chat/issues/5732) ([2905cb5](https://github.com/lobehub/lobe-chat/commit/2905cb5)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.50.3](https://github.com/lobehub/lobe-chat/compare/v1.50.2...v1.50.3) + +Released on **2025-02-04** + +#### 💄 Styles + +- **misc**: Update model locale. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update model locale, closes [#5731](https://github.com/lobehub/lobe-chat/issues/5731) ([d3d26d7](https://github.com/lobehub/lobe-chat/commit/d3d26d7)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.50.2](https://github.com/lobehub/lobe-chat/compare/v1.50.1...v1.50.2) + +Released on **2025-02-04** + +#### 🐛 Bug Fixes + +- **misc**: Fix `o1` series calling issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix `o1` series calling issue, closes [#5714](https://github.com/lobehub/lobe-chat/issues/5714) ([d74653e](https://github.com/lobehub/lobe-chat/commit/d74653e)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.50.1](https://github.com/lobehub/lobe-chat/compare/v1.50.0...v1.50.1) + +Released on **2025-02-03** + +#### 🐛 Bug Fixes + +- **misc**: Bind the selected group name in the rename modal.. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Bind the selected group name in the rename modal., closes [#5159](https://github.com/lobehub/lobe-chat/issues/5159) ([7da05ce](https://github.com/lobehub/lobe-chat/commit/7da05ce)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.50.0](https://github.com/lobehub/lobe-chat/compare/v1.49.16...v1.50.0) + +Released on **2025-02-03** + +#### ✨ Features + +- **misc**: Add `o3-mini` support for OpenAI & GitHub Models. + +#### 🐛 Bug Fixes + +- **misc**: Fix parse of deepseek r1 in siliconflow provider. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add `o3-mini` support for OpenAI & GitHub Models, closes [#5657](https://github.com/lobehub/lobe-chat/issues/5657) ([492cfd4](https://github.com/lobehub/lobe-chat/commit/492cfd4)) + +#### What's fixed + +- **misc**: Fix parse of deepseek r1 in siliconflow provider, closes [#5687](https://github.com/lobehub/lobe-chat/issues/5687) ([44e81e2](https://github.com/lobehub/lobe-chat/commit/44e81e2)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.16](https://github.com/lobehub/lobe-chat/compare/v1.49.15...v1.49.16) + +Released on **2025-02-03** + +#### 💄 Styles + +- **misc**: Update perplexity models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update perplexity models, closes [#5624](https://github.com/lobehub/lobe-chat/issues/5624) ([58a86fc](https://github.com/lobehub/lobe-chat/commit/58a86fc)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.15](https://github.com/lobehub/lobe-chat/compare/v1.49.14...v1.49.15) + +Released on **2025-02-03** + +#### 💄 Styles + +- **misc**: Update Fireworks check model and fix check error. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update Fireworks check model and fix check error, closes [#5680](https://github.com/lobehub/lobe-chat/issues/5680) ([64ea539](https://github.com/lobehub/lobe-chat/commit/64ea539)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.14](https://github.com/lobehub/lobe-chat/compare/v1.49.13...v1.49.14) + +Released on **2025-02-03** + +#### 🐛 Bug Fixes + +- **misc**: Fix provider update issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix provider update issue, closes [#5676](https://github.com/lobehub/lobe-chat/issues/5676) ([e5d81ea](https://github.com/lobehub/lobe-chat/commit/e5d81ea)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.13](https://github.com/lobehub/lobe-chat/compare/v1.49.12...v1.49.13) + +Released on **2025-02-03** + +#### 🐛 Bug Fixes + +- **misc**: Optimize requests without historical messages. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Optimize requests without historical messages, closes [#5174](https://github.com/lobehub/lobe-chat/issues/5174) ([182f8d9](https://github.com/lobehub/lobe-chat/commit/182f8d9)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.12](https://github.com/lobehub/lobe-chat/compare/v1.49.11...v1.49.12) + +Released on **2025-02-02** + +#### 🐛 Bug Fixes + +- **misc**: Fix can not stop generating. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix can not stop generating, closes [#5671](https://github.com/lobehub/lobe-chat/issues/5671) ([ae39c35](https://github.com/lobehub/lobe-chat/commit/ae39c35)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.11](https://github.com/lobehub/lobe-chat/compare/v1.49.10...v1.49.11) + +Released on **2025-02-02** + +#### 🐛 Bug Fixes + +- **misc**: Fix ollama intergration checker and client fetch issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix ollama intergration checker and client fetch issue, closes [#5665](https://github.com/lobehub/lobe-chat/issues/5665) ([cd09a07](https://github.com/lobehub/lobe-chat/commit/cd09a07)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.10](https://github.com/lobehub/lobe-chat/compare/v1.49.9...v1.49.10) + +Released on **2025-02-02** + +#### 🐛 Bug Fixes + +- **misc**: Fix `` tag crash with special markdown content. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix `` tag crash with special markdown content, closes [#5670](https://github.com/lobehub/lobe-chat/issues/5670) ([b719522](https://github.com/lobehub/lobe-chat/commit/b719522)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.9](https://github.com/lobehub/lobe-chat/compare/v1.49.8...v1.49.9) + +Released on **2025-02-01** + +#### 💄 Styles + +- **misc**: Update siliconcloud models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update siliconcloud models, closes [#5647](https://github.com/lobehub/lobe-chat/issues/5647) ([4b41ad4](https://github.com/lobehub/lobe-chat/commit/4b41ad4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.8](https://github.com/lobehub/lobe-chat/compare/v1.49.7...v1.49.8) + +Released on **2025-02-01** + +#### 💄 Styles + +- **misc**: Support thinking for all non DeepSeek official api R1 models. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support thinking for all non DeepSeek official api R1 models, closes [#5654](https://github.com/lobehub/lobe-chat/issues/5654) ([9b32137](https://github.com/lobehub/lobe-chat/commit/9b32137)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.7](https://github.com/lobehub/lobe-chat/compare/v1.49.6...v1.49.7) + +Released on **2025-02-01** + +#### 🐛 Bug Fixes + +- **misc**: Multiple deepseek-reasoner request errors. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Multiple deepseek-reasoner request errors, closes [#5601](https://github.com/lobehub/lobe-chat/issues/5601) ([71cc32b](https://github.com/lobehub/lobe-chat/commit/71cc32b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.6](https://github.com/lobehub/lobe-chat/compare/v1.49.5...v1.49.6) + +Released on **2025-01-30** + +#### 🐛 Bug Fixes + +- **misc**: Support litellm reasoning streaming. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Support litellm reasoning streaming, closes [#5632](https://github.com/lobehub/lobe-chat/issues/5632) ([9942fb3](https://github.com/lobehub/lobe-chat/commit/9942fb3)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.5](https://github.com/lobehub/lobe-chat/compare/v1.49.4...v1.49.5) + +Released on **2025-01-28** + +#### 🐛 Bug Fixes + +- **misc**: Pin `@clerk/nextjs@6.10.2` to avoid build error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Pin `@clerk/nextjs@6.10.2` to avoid build error, closes [#5611](https://github.com/lobehub/lobe-chat/issues/5611) ([deb03ad](https://github.com/lobehub/lobe-chat/commit/deb03ad)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.4](https://github.com/lobehub/lobe-chat/compare/v1.49.3...v1.49.4) + +Released on **2025-01-28** + +#### 🐛 Bug Fixes + +- **misc**: Fix changelog locale not showing English. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix changelog locale not showing English, closes [#5607](https://github.com/lobehub/lobe-chat/issues/5607) ([9104242](https://github.com/lobehub/lobe-chat/commit/9104242)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.3](https://github.com/lobehub/lobe-chat/compare/v1.49.2...v1.49.3) + +Released on **2025-01-27** + +#### 🐛 Bug Fixes + +- **misc**: Fix discover ssr hydration error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix discover ssr hydration error, closes [#5605](https://github.com/lobehub/lobe-chat/issues/5605) ([e3702a6](https://github.com/lobehub/lobe-chat/commit/e3702a6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.2](https://github.com/lobehub/lobe-chat/compare/v1.49.1...v1.49.2) + +Released on **2025-01-27** + +#### ♻ Code Refactoring + +- **misc**: Remove use query. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Remove use query, closes [#5604](https://github.com/lobehub/lobe-chat/issues/5604) ([58c60de](https://github.com/lobehub/lobe-chat/commit/58c60de)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.49.1](https://github.com/lobehub/lobe-chat/compare/v1.49.0...v1.49.1) + +Released on **2025-01-27** + +#### ♻ Code Refactoring + +- **misc**: UseMobileWorkspace use nqus to replace useQuery. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: UseMobileWorkspace use nqus to replace useQuery, closes [#5603](https://github.com/lobehub/lobe-chat/issues/5603) ([70e5272](https://github.com/lobehub/lobe-chat/commit/70e5272)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.49.0](https://github.com/lobehub/lobe-chat/compare/v1.48.4...v1.49.0) + +Released on **2025-01-27** + +#### ✨ Features + +- **misc**: Support Doubao Models. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Support Doubao Models, closes [#5481](https://github.com/lobehub/lobe-chat/issues/5481) ([d8afe47](https://github.com/lobehub/lobe-chat/commit/d8afe47)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.48.4](https://github.com/lobehub/lobe-chat/compare/v1.48.3...v1.48.4) + +Released on **2025-01-27** + +#### 💄 Styles + +- **misc**: Improve thinking style. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve thinking style, closes [#5602](https://github.com/lobehub/lobe-chat/issues/5602) ([d4dc3f2](https://github.com/lobehub/lobe-chat/commit/d4dc3f2)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.48.3](https://github.com/lobehub/lobe-chat/compare/v1.48.2...v1.48.3) + +Released on **2025-01-26** + +#### 💄 Styles + +- **misc**: Improve model pricing with CNY. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve model pricing with CNY, closes [#5599](https://github.com/lobehub/lobe-chat/issues/5599) ([6d91457](https://github.com/lobehub/lobe-chat/commit/6d91457)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.48.2](https://github.com/lobehub/lobe-chat/compare/v1.48.1...v1.48.2) + +Released on **2025-01-25** + +#### 💄 Styles + +- **misc**: Add `parallel_tool_calls` support for Qwen, fix tag version and add provider changelog. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add `parallel_tool_calls` support for Qwen, closes [#5584](https://github.com/lobehub/lobe-chat/issues/5584) ([b89aeeb](https://github.com/lobehub/lobe-chat/commit/b89aeeb)) +- **misc**: Fix tag version and add provider changelog, closes [#5582](https://github.com/lobehub/lobe-chat/issues/5582) ([63c571b](https://github.com/lobehub/lobe-chat/commit/63c571b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.48.1](https://github.com/lobehub/lobe-chat/compare/v1.48.0...v1.48.1) + +Released on **2025-01-25** + +#### 🐛 Bug Fixes + +- **misc**: Fix ollama Browser Request failed in PG mode. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix ollama Browser Request failed in PG mode, closes [#5585](https://github.com/lobehub/lobe-chat/issues/5585) ([b2f3c33](https://github.com/lobehub/lobe-chat/commit/b2f3c33)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.48.0](https://github.com/lobehub/lobe-chat/compare/v1.47.23...v1.48.0) + +Released on **2025-01-24** + +#### ✨ Features + +- **misc**: Support display thinking for DeepSeek R1. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Support display thinking for DeepSeek R1, closes [#5558](https://github.com/lobehub/lobe-chat/issues/5558) ([f98bb5a](https://github.com/lobehub/lobe-chat/commit/f98bb5a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.23](https://github.com/lobehub/lobe-chat/compare/v1.47.22...v1.47.23) + +Released on **2025-01-24** + +#### 💄 Styles + +- **misc**: Fix model fetch match tag error & add Hunyuan model fetch support. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Fix model fetch match tag error & add Hunyuan model fetch support, closes [#5566](https://github.com/lobehub/lobe-chat/issues/5566) ([7b075ef](https://github.com/lobehub/lobe-chat/commit/7b075ef)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.22](https://github.com/lobehub/lobe-chat/compare/v1.47.21...v1.47.22) + +Released on **2025-01-24** + +#### 🐛 Bug Fixes + +- **misc**: Fix form input in provider. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix form input in provider, closes [#5571](https://github.com/lobehub/lobe-chat/issues/5571) ([07e2396](https://github.com/lobehub/lobe-chat/commit/07e2396)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.21](https://github.com/lobehub/lobe-chat/compare/v1.47.20...v1.47.21) + +Released on **2025-01-23** + +#### 💄 Styles + +- **misc**: Add HuggingFace Model: DeepSeek R1. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add HuggingFace Model: DeepSeek R1, closes [#5564](https://github.com/lobehub/lobe-chat/issues/5564) ([66d4edd](https://github.com/lobehub/lobe-chat/commit/66d4edd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.20](https://github.com/lobehub/lobe-chat/compare/v1.47.19...v1.47.20) + +Released on **2025-01-23** + +#### 🐛 Bug Fixes + +- **misc**: Fix tts in new provider model. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix tts in new provider model, closes [#5569](https://github.com/lobehub/lobe-chat/issues/5569) ([3fef83e](https://github.com/lobehub/lobe-chat/commit/3fef83e)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.19](https://github.com/lobehub/lobe-chat/compare/v1.47.18...v1.47.19) + +Released on **2025-01-23** + +#### 💄 Styles + +- **misc**: Add new stepfun model. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add new stepfun model, closes [#5560](https://github.com/lobehub/lobe-chat/issues/5560) ([6e027e8](https://github.com/lobehub/lobe-chat/commit/6e027e8)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.18](https://github.com/lobehub/lobe-chat/compare/v1.47.17...v1.47.18) + +Released on **2025-01-23** + +#### 🐛 Bug Fixes + +- **misc**: Fix debounce issue of provider config. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix debounce issue of provider config, closes [#5557](https://github.com/lobehub/lobe-chat/issues/5557) ([c971530](https://github.com/lobehub/lobe-chat/commit/c971530)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.17](https://github.com/lobehub/lobe-chat/compare/v1.47.16...v1.47.17) + +Released on **2025-01-22** + +#### 🐛 Bug Fixes + +- **misc**: Upgrade `react-i18next` to ^15. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Upgrade `react-i18next` to ^15, closes [#5553](https://github.com/lobehub/lobe-chat/issues/5553) ([d0275fd](https://github.com/lobehub/lobe-chat/commit/d0275fd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.16](https://github.com/lobehub/lobe-chat/compare/v1.47.15...v1.47.16) + +Released on **2025-01-22** + +#### ♻ Code Refactoring + +- **misc**: Move hooks and component. + +#### 💄 Styles + +- **misc**: Add gemini new model. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Move hooks and component, closes [#5551](https://github.com/lobehub/lobe-chat/issues/5551) ([c5db091](https://github.com/lobehub/lobe-chat/commit/c5db091)) + +#### Styles + +- **misc**: Add gemini new model, closes [#5546](https://github.com/lobehub/lobe-chat/issues/5546) ([ebdd626](https://github.com/lobehub/lobe-chat/commit/ebdd626)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.15](https://github.com/lobehub/lobe-chat/compare/v1.47.14...v1.47.15) + +Released on **2025-01-22** + +#### 💄 Styles + +- **misc**: Improve discover model page. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve discover model page, closes [#5544](https://github.com/lobehub/lobe-chat/issues/5544) ([979849c](https://github.com/lobehub/lobe-chat/commit/979849c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.14](https://github.com/lobehub/lobe-chat/compare/v1.47.13...v1.47.14) + +Released on **2025-01-22** + +#### 💄 Styles + +- **misc**: Support model list with model fetcher settings. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support model list with model fetcher settings, closes [#5540](https://github.com/lobehub/lobe-chat/issues/5540) ([637fbf4](https://github.com/lobehub/lobe-chat/commit/637fbf4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.13](https://github.com/lobehub/lobe-chat/compare/v1.47.12...v1.47.13) + +Released on **2025-01-21** + +#### 💄 Styles + +- **misc**: Add `ModelFetcher` for supported providers. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add `ModelFetcher` for supported providers, closes [#5316](https://github.com/lobehub/lobe-chat/issues/5316) [#252](https://github.com/lobehub/lobe-chat/issues/252) ([a189c81](https://github.com/lobehub/lobe-chat/commit/a189c81)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.12](https://github.com/lobehub/lobe-chat/compare/v1.47.11...v1.47.12) + +Released on **2025-01-21** + +#### 💄 Styles + +- **misc**: Refactor `[@nav](https://github.com/nav)` layout and improve pin list style. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Refactor `[@nav](https://github.com/nav)` layout and improve pin list style, closes [#5533](https://github.com/lobehub/lobe-chat/issues/5533) ([cc8a7f4](https://github.com/lobehub/lobe-chat/commit/cc8a7f4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.11](https://github.com/lobehub/lobe-chat/compare/v1.47.10...v1.47.11) + +Released on **2025-01-21** + +#### ♻ Code Refactoring + +- **misc**: Improve code for ai provider. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Improve code for ai provider, closes [#5532](https://github.com/lobehub/lobe-chat/issues/5532) ([ea59e24](https://github.com/lobehub/lobe-chat/commit/ea59e24)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.10](https://github.com/lobehub/lobe-chat/compare/v1.47.9...v1.47.10) + +Released on **2025-01-21** + +#### 💄 Styles + +- **misc**: Support assistant blacklist. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Support assistant blacklist, closes [#5527](https://github.com/lobehub/lobe-chat/issues/5527) ([3534c0d](https://github.com/lobehub/lobe-chat/commit/3534c0d)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.9](https://github.com/lobehub/lobe-chat/compare/v1.47.8...v1.47.9) + +Released on **2025-01-20** + +#### ♻ Code Refactoring + +- **misc**: Improve error code. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Improve error code, closes [#5525](https://github.com/lobehub/lobe-chat/issues/5525) ([4fc4fa6](https://github.com/lobehub/lobe-chat/commit/4fc4fa6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.8](https://github.com/lobehub/lobe-chat/compare/v1.47.7...v1.47.8) + +Released on **2025-01-20** + +#### 💄 Styles + +- **misc**: Add deepseek r1 model. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add deepseek r1 model, closes [#5520](https://github.com/lobehub/lobe-chat/issues/5520) ([414477f](https://github.com/lobehub/lobe-chat/commit/414477f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.7](https://github.com/lobehub/lobe-chat/compare/v1.47.6...v1.47.7) + +Released on **2025-01-20** + +#### ♻ Code Refactoring + +- **misc**: Remove redundant payload remapping in client-fetch. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Remove redundant payload remapping in client-fetch, closes [#5267](https://github.com/lobehub/lobe-chat/issues/5267) ([0c7dd82](https://github.com/lobehub/lobe-chat/commit/0c7dd82)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.6](https://github.com/lobehub/lobe-chat/compare/v1.47.5...v1.47.6) + +Released on **2025-01-20** + +#### ♻ Code Refactoring + +- **misc**: Refactor provider code. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor provider code, closes [#5516](https://github.com/lobehub/lobe-chat/issues/5516) ([fa1a07f](https://github.com/lobehub/lobe-chat/commit/fa1a07f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.5](https://github.com/lobehub/lobe-chat/compare/v1.47.4...v1.47.5) + +Released on **2025-01-20** + +#### ♻ Code Refactoring + +- **misc**: Improve ai provider code. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Improve ai provider code, closes [#5514](https://github.com/lobehub/lobe-chat/issues/5514) ([92789cd](https://github.com/lobehub/lobe-chat/commit/92789cd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.4](https://github.com/lobehub/lobe-chat/compare/v1.47.3...v1.47.4) + +Released on **2025-01-18** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.3](https://github.com/lobehub/lobe-chat/compare/v1.47.2...v1.47.3) + +Released on **2025-01-18** + +#### 🐛 Bug Fixes + +- **misc**: Fix hydration error. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix hydration error, closes [#5502](https://github.com/lobehub/lobe-chat/issues/5502) ([cbe469a](https://github.com/lobehub/lobe-chat/commit/cbe469a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.2](https://github.com/lobehub/lobe-chat/compare/v1.47.1...v1.47.2) + +Released on **2025-01-17** + +#### 🐛 Bug Fixes + +- **misc**: Fix api key in api key form. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix api key in api key form, closes [#5498](https://github.com/lobehub/lobe-chat/issues/5498) ([b4a160b](https://github.com/lobehub/lobe-chat/commit/b4a160b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.47.1](https://github.com/lobehub/lobe-chat/compare/v1.47.0...v1.47.1) + +Released on **2025-01-17** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.47.0](https://github.com/lobehub/lobe-chat/compare/v1.46.7...v1.47.0) + +Released on **2025-01-17** + +#### ✨ Features + +- **misc**: Support new ai provider in client pglite. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Support new ai provider in client pglite, closes [#5488](https://github.com/lobehub/lobe-chat/issues/5488) ([08f505f](https://github.com/lobehub/lobe-chat/commit/08f505f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.7](https://github.com/lobehub/lobe-chat/compare/v1.46.6...v1.46.7) + +Released on **2025-01-17** + +#### 🐛 Bug Fixes + +- **misc**: Improve validation for provider and model in parseFilesConfig, temporarily disable S3 client integrity check for Cloudflare R2. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Improve validation for provider and model in parseFilesConfig, closes [#5454](https://github.com/lobehub/lobe-chat/issues/5454) ([b4808f8](https://github.com/lobehub/lobe-chat/commit/b4808f8)) +- **misc**: Temporarily disable S3 client integrity check for Cloudflare R2, closes [#5479](https://github.com/lobehub/lobe-chat/issues/5479) ([a638238](https://github.com/lobehub/lobe-chat/commit/a638238)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.6](https://github.com/lobehub/lobe-chat/compare/v1.46.5...v1.46.6) + +Released on **2025-01-16** + +#### 🐛 Bug Fixes + +- **misc**: Gemini models HarmBlockThreshold. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Gemini models HarmBlockThreshold, closes [#5477](https://github.com/lobehub/lobe-chat/issues/5477) ([f98375c](https://github.com/lobehub/lobe-chat/commit/f98375c)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.5](https://github.com/lobehub/lobe-chat/compare/v1.46.4...v1.46.5) + +Released on **2025-01-16** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.4](https://github.com/lobehub/lobe-chat/compare/v1.46.3...v1.46.4) + +Released on **2025-01-16** + +#### ♻ Code Refactoring + +- **misc**: Refactor some implement for the next performance improvement. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor some implement for the next performance improvement, closes [#5462](https://github.com/lobehub/lobe-chat/issues/5462) ([b5e1146](https://github.com/lobehub/lobe-chat/commit/b5e1146)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.3](https://github.com/lobehub/lobe-chat/compare/v1.46.2...v1.46.3) + +Released on **2025-01-15** + +#### 🐛 Bug Fixes + +- **misc**: Fix azure in new ai provider. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix azure in new ai provider, closes [#5448](https://github.com/lobehub/lobe-chat/issues/5448) ([b5042c3](https://github.com/lobehub/lobe-chat/commit/b5042c3)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.2](https://github.com/lobehub/lobe-chat/compare/v1.46.1...v1.46.2) + +Released on **2025-01-15** + +
+ +
+Improvements and Fixes + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.46.1](https://github.com/lobehub/lobe-chat/compare/v1.46.0...v1.46.1) + +Released on **2025-01-15** + +#### 💄 Styles + +- **misc**: Add auth support for `PROXY_URL`. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Add auth support for `PROXY_URL`, closes [#5304](https://github.com/lobehub/lobe-chat/issues/5304) ([eb26c79](https://github.com/lobehub/lobe-chat/commit/eb26c79)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.46.0](https://github.com/lobehub/lobe-chat/compare/v1.45.17...v1.46.0) + +Released on **2025-01-15** + +#### ✨ Features + +- **misc**: Add lm studio provider, support to customize Embedding model with env. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Add lm studio provider, closes [#4483](https://github.com/lobehub/lobe-chat/issues/4483) ([0ac5802](https://github.com/lobehub/lobe-chat/commit/0ac5802)) +- **misc**: Support to customize Embedding model with env, closes [#5177](https://github.com/lobehub/lobe-chat/issues/5177) ([eed9357](https://github.com/lobehub/lobe-chat/commit/eed9357)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.17](https://github.com/lobehub/lobe-chat/compare/v1.45.16...v1.45.17) + +Released on **2025-01-15** + +#### ♻ Code Refactoring + +- **misc**: Refactor Minimax with LobeOpenAICompatibleFactory. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Refactor Minimax with LobeOpenAICompatibleFactory, closes [#5325](https://github.com/lobehub/lobe-chat/issues/5325) ([da11b55](https://github.com/lobehub/lobe-chat/commit/da11b55)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.16](https://github.com/lobehub/lobe-chat/compare/v1.45.15...v1.45.16) + +Released on **2025-01-14** + +#### ♻ Code Refactoring + +- **misc**: Improve ai provider code. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **misc**: Improve ai provider code, closes [#5442](https://github.com/lobehub/lobe-chat/issues/5442) ([32013b4](https://github.com/lobehub/lobe-chat/commit/32013b4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.15](https://github.com/lobehub/lobe-chat/compare/v1.45.14...v1.45.15) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Fix pull models error in new ai provider. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix pull models error in new ai provider, closes [#5441](https://github.com/lobehub/lobe-chat/issues/5441) ([1726d85](https://github.com/lobehub/lobe-chat/commit/1726d85)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.14](https://github.com/lobehub/lobe-chat/compare/v1.45.13...v1.45.14) + +Released on **2025-01-14** + +#### ♻ Code Refactoring + +- **plugin**: Update plugin prompt. + +
+ +
+Improvements and Fixes + +#### Code refactoring + +- **plugin**: Update plugin prompt, closes [#5083](https://github.com/lobehub/lobe-chat/issues/5083) ([ddd3b53](https://github.com/lobehub/lobe-chat/commit/ddd3b53)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.13](https://github.com/lobehub/lobe-chat/compare/v1.45.12...v1.45.13) + +Released on **2025-01-14** + +#### 💄 Styles + +- **misc**: Improve model config form modal. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Improve model config form modal, closes [#5438](https://github.com/lobehub/lobe-chat/issues/5438) ([9b303e0](https://github.com/lobehub/lobe-chat/commit/9b303e0)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.12](https://github.com/lobehub/lobe-chat/compare/v1.45.11...v1.45.12) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Fix `enable_search` parameter intro condition in Qwen. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix `enable_search` parameter intro condition in Qwen, closes [#5297](https://github.com/lobehub/lobe-chat/issues/5297) ([0b19c20](https://github.com/lobehub/lobe-chat/commit/0b19c20)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.11](https://github.com/lobehub/lobe-chat/compare/v1.45.10...v1.45.11) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Support Gemini 2.0 HarmBlockThreshold. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Support Gemini 2.0 HarmBlockThreshold, closes [#5422](https://github.com/lobehub/lobe-chat/issues/5422) ([4d1a4cd](https://github.com/lobehub/lobe-chat/commit/4d1a4cd)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.10](https://github.com/lobehub/lobe-chat/compare/v1.45.9...v1.45.10) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Fix some providers issues. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix some providers issues, closes [#5429](https://github.com/lobehub/lobe-chat/issues/5429) ([b7edbd3](https://github.com/lobehub/lobe-chat/commit/b7edbd3)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.9](https://github.com/lobehub/lobe-chat/compare/v1.45.8...v1.45.9) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Fix pin package manager to pnpm\@9 for docker. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix pin package manager to pnpm\@9 for docker, closes [#5436](https://github.com/lobehub/lobe-chat/issues/5436) ([00dc29b](https://github.com/lobehub/lobe-chat/commit/00dc29b)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.8](https://github.com/lobehub/lobe-chat/compare/v1.45.7...v1.45.8) + +Released on **2025-01-14** + +#### 🐛 Bug Fixes + +- **misc**: Refactor dynamic import in RSC. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Refactor dynamic import in RSC, closes [#5434](https://github.com/lobehub/lobe-chat/issues/5434) ([6a663a7](https://github.com/lobehub/lobe-chat/commit/6a663a7)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.7](https://github.com/lobehub/lobe-chat/compare/v1.45.6...v1.45.7) + +Released on **2025-01-13** + +#### 🐛 Bug Fixes + +- **misc**: Fix released at for undefined condition. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix released at for undefined condition, closes [#5391](https://github.com/lobehub/lobe-chat/issues/5391) ([9c5822a](https://github.com/lobehub/lobe-chat/commit/9c5822a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.6](https://github.com/lobehub/lobe-chat/compare/v1.45.5...v1.45.6) + +Released on **2025-01-10** + +#### 🐛 Bug Fixes + +- **misc**: Fix `*_MODEL_LIST` env in new provider. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix `*_MODEL_LIST` env in new provider, closes [#5350](https://github.com/lobehub/lobe-chat/issues/5350) ([2b1b2a2](https://github.com/lobehub/lobe-chat/commit/2b1b2a2)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.5](https://github.com/lobehub/lobe-chat/compare/v1.45.4...v1.45.5) + +Released on **2025-01-09** + +#### 🐛 Bug Fixes + +- **misc**: Revert officeparser. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Revert officeparser, closes [#5370](https://github.com/lobehub/lobe-chat/issues/5370) ([ea116c2](https://github.com/lobehub/lobe-chat/commit/ea116c2)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.4](https://github.com/lobehub/lobe-chat/compare/v1.45.3...v1.45.4) + +Released on **2025-01-09** + +#### 🐛 Bug Fixes + +- **misc**: Fix GitHub and huggingface provider config unusable. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix GitHub and huggingface provider config unusable, closes [#5366](https://github.com/lobehub/lobe-chat/issues/5366) ([aec67b4](https://github.com/lobehub/lobe-chat/commit/aec67b4)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.3](https://github.com/lobehub/lobe-chat/compare/v1.45.2...v1.45.3) + +Released on **2025-01-09** + +#### 🐛 Bug Fixes + +- **misc**: Fix some ai provider known issues. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix some ai provider known issues, closes [#5361](https://github.com/lobehub/lobe-chat/issues/5361) ([b2775b5](https://github.com/lobehub/lobe-chat/commit/b2775b5)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.2](https://github.com/lobehub/lobe-chat/compare/v1.45.1...v1.45.2) + +Released on **2025-01-09** + +#### 💄 Styles + +- **misc**: Update siliconcloud model list. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Update siliconcloud model list, closes [#5360](https://github.com/lobehub/lobe-chat/issues/5360) ([69085ac](https://github.com/lobehub/lobe-chat/commit/69085ac)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.45.1](https://github.com/lobehub/lobe-chat/compare/v1.45.0...v1.45.1) + +Released on **2025-01-09** + +#### 🐛 Bug Fixes + +- **misc**: Fix remark gfm regex breaks in Safari versions < 16.4. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix remark gfm regex breaks in Safari versions < 16.4, closes [#5357](https://github.com/lobehub/lobe-chat/issues/5357) ([9086570](https://github.com/lobehub/lobe-chat/commit/9086570)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.45.0](https://github.com/lobehub/lobe-chat/compare/v1.44.3...v1.45.0) + +Released on **2025-01-08** + +#### ✨ Features + +- **misc**: Update Remark. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Update Remark, closes [#5340](https://github.com/lobehub/lobe-chat/issues/5340) ([2c3331a](https://github.com/lobehub/lobe-chat/commit/2c3331a)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.44.3](https://github.com/lobehub/lobe-chat/compare/v1.44.2...v1.44.3) + +Released on **2025-01-08** + +#### 🐛 Bug Fixes + +- **misc**: Fix provider enabled issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix provider enabled issue, closes [#5337](https://github.com/lobehub/lobe-chat/issues/5337) ([8e0b634](https://github.com/lobehub/lobe-chat/commit/8e0b634)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.44.2](https://github.com/lobehub/lobe-chat/compare/v1.44.1...v1.44.2) + +Released on **2025-01-08** + +#### 🐛 Bug Fixes + +- **misc**: Add provider id validate. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Add provider id validate, closes [#5336](https://github.com/lobehub/lobe-chat/issues/5336) ([7f8a1b6](https://github.com/lobehub/lobe-chat/commit/7f8a1b6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.44.1](https://github.com/lobehub/lobe-chat/compare/v1.44.0...v1.44.1) + +Released on **2025-01-08** + +#### 🐛 Bug Fixes + +- **misc**: Fix model select not auto update and sort issue. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix model select not auto update and sort issue, closes [#5330](https://github.com/lobehub/lobe-chat/issues/5330) ([dc76d6f](https://github.com/lobehub/lobe-chat/commit/dc76d6f)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +## [Version 1.44.0](https://github.com/lobehub/lobe-chat/compare/v1.43.6...v1.44.0) + +Released on **2025-01-07** + +#### ✨ Features + +- **misc**: Brand new AI provider. + +
+ +
+Improvements and Fixes + +#### What's improved + +- **misc**: Brand new AI provider, closes [#5158](https://github.com/lobehub/lobe-chat/issues/5158) ([bde6d64](https://github.com/lobehub/lobe-chat/commit/bde6d64)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.43.6](https://github.com/lobehub/lobe-chat/compare/v1.43.5...v1.43.6) + +Released on **2025-01-07** + +#### 🐛 Bug Fixes + +- **misc**: Fix portal suspense error when first open. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix portal suspense error when first open, closes [#5322](https://github.com/lobehub/lobe-chat/issues/5322) ([0d4c487](https://github.com/lobehub/lobe-chat/commit/0d4c487)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.43.5](https://github.com/lobehub/lobe-chat/compare/v1.43.4...v1.43.5) + +Released on **2025-01-07** + +#### 💄 Styles + +- **misc**: Fix style warning in antd 5.23.0 and some error logs. + +
+ +
+Improvements and Fixes + +#### Styles + +- **misc**: Fix style warning in antd 5.23.0 and some error logs, closes [#5319](https://github.com/lobehub/lobe-chat/issues/5319) ([4fcf5d6](https://github.com/lobehub/lobe-chat/commit/4fcf5d6)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ +### [Version 1.43.4](https://github.com/lobehub/lobe-chat/compare/v1.43.3...v1.43.4) + +Released on **2025-01-06** + +#### 🐛 Bug Fixes + +- **misc**: Fix format short number. + +
+ +
+Improvements and Fixes + +#### What's fixed + +- **misc**: Fix format short number, closes [#5294](https://github.com/lobehub/lobe-chat/issues/5294) ([d8a29ec](https://github.com/lobehub/lobe-chat/commit/d8a29ec)) + +
+ +
+ +[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) + +
+ ### [Version 1.43.3](https://github.com/lobehub/lobe-chat/compare/v1.43.2...v1.43.3) Released on **2025-01-04** diff --git a/Dockerfile b/Dockerfile index 369f52b9364dc..880329856a146 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,10 +79,12 @@ RUN \ fi \ # Set the registry for corepack && export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\/$//') \ + # Update corepack to latest (nodejs/corepack#612) + && npm i -g corepack@latest \ # Enable corepack && corepack enable \ # Use pnpm for corepack - && corepack use pnpm \ + && corepack use $(sed -n 's/.*"packageManager": "\(.*\)".*/\1/p' package.json) \ # Install the dependencies && pnpm i \ # Add sharp dependencies @@ -129,6 +131,10 @@ ENV NODE_ENV="production" \ NODE_TLS_REJECT_UNAUTHORIZED="" \ SSL_CERT_DIR="/etc/ssl/certs/ca-certificates.crt" +# Make the middleware rewrite through local as default +# refs: https://github.com/lobehub/lobe-chat/issues/5876 +ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1" + # set hostname to localhost ENV HOSTNAME="0.0.0.0" \ PORT="3210" @@ -177,6 +183,8 @@ ENV \ HUNYUAN_API_KEY="" HUNYUAN_MODEL_LIST="" \ # InternLM INTERNLM_API_KEY="" INTERNLM_MODEL_LIST="" \ + # Jina + JINA_API_KEY="" JINA_MODEL_LIST="" JINA_PROXY_URL="" \ # Minimax MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \ # Mistral @@ -185,6 +193,8 @@ ENV \ MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \ # Novita NOVITA_API_KEY="" NOVITA_MODEL_LIST="" \ + # Nvidia NIM + NVIDIA_API_KEY="" NVIDIA_MODEL_LIST="" NVIDIA_PROXY_URL="" \ # Ollama ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \ # OpenAI @@ -209,14 +219,18 @@ ENV \ TOGETHERAI_API_KEY="" TOGETHERAI_MODEL_LIST="" \ # Upstage UPSTAGE_API_KEY="" UPSTAGE_MODEL_LIST="" \ + # vLLM + VLLM_API_KEY="" VLLM_MODEL_LIST="" VLLM_PROXY_URL="" \ # Wenxin - WENXIN_ACCESS_KEY="" WENXIN_SECRET_KEY="" WENXIN_MODEL_LIST="" \ + WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \ # xAI XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \ # 01.AI ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \ # Zhipu - ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" + ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \ + # Tencent Cloud + TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" USER nextjs diff --git a/Dockerfile.database b/Dockerfile.database index 144e2c1ca27a7..ca05a770cb3d9 100644 --- a/Dockerfile.database +++ b/Dockerfile.database @@ -38,6 +38,7 @@ FROM base AS builder ARG USE_CN_MIRROR ARG NEXT_PUBLIC_BASE_PATH ARG NEXT_PUBLIC_SERVICE_MODE +ARG NEXT_PUBLIC_ENABLE_NEXT_AUTH ARG NEXT_PUBLIC_SENTRY_DSN ARG NEXT_PUBLIC_ANALYTICS_POSTHOG ARG NEXT_PUBLIC_POSTHOG_HOST @@ -49,6 +50,7 @@ ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}" ENV NEXT_PUBLIC_SERVICE_MODE="${NEXT_PUBLIC_SERVICE_MODE:-server}" \ + NEXT_PUBLIC_ENABLE_NEXT_AUTH="${NEXT_PUBLIC_ENABLE_NEXT_AUTH:-1}" \ APP_URL="http://app.com" \ DATABASE_DRIVER="node" \ DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" \ @@ -86,10 +88,12 @@ RUN \ fi \ # Set the registry for corepack && export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\/$//') \ + # Update corepack to latest (nodejs/corepack#612) + && npm i -g corepack@latest \ # Enable corepack && corepack enable \ # Use pnpm for corepack - && corepack use pnpm \ + && corepack use $(sed -n 's/.*"packageManager": "\(.*\)".*/\1/p' package.json) \ # Install the dependencies && pnpm i \ # Add sharp and db migration dependencies @@ -145,6 +149,10 @@ ENV NODE_ENV="production" \ NODE_TLS_REJECT_UNAUTHORIZED="" \ SSL_CERT_DIR="/etc/ssl/certs/ca-certificates.crt" +# Make the middleware rewrite through local as default +# refs: https://github.com/lobehub/lobe-chat/issues/5876 +ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1" + # set hostname to localhost ENV HOSTNAME="0.0.0.0" \ PORT="3210" @@ -212,6 +220,8 @@ ENV \ HUNYUAN_API_KEY="" HUNYUAN_MODEL_LIST="" \ # InternLM INTERNLM_API_KEY="" INTERNLM_MODEL_LIST="" \ + # Jina + JINA_API_KEY="" JINA_MODEL_LIST="" JINA_PROXY_URL="" \ # Minimax MINIMAX_API_KEY="" MINIMAX_MODEL_LIST="" \ # Mistral @@ -220,6 +230,8 @@ ENV \ MOONSHOT_API_KEY="" MOONSHOT_MODEL_LIST="" MOONSHOT_PROXY_URL="" \ # Novita NOVITA_API_KEY="" NOVITA_MODEL_LIST="" \ + # Nvidia NIM + NVIDIA_API_KEY="" NVIDIA_MODEL_LIST="" NVIDIA_PROXY_URL="" \ # Ollama ENABLED_OLLAMA="" OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \ # OpenAI @@ -244,14 +256,18 @@ ENV \ TOGETHERAI_API_KEY="" TOGETHERAI_MODEL_LIST="" \ # Upstage UPSTAGE_API_KEY="" UPSTAGE_MODEL_LIST="" \ + # vLLM + VLLM_API_KEY="" VLLM_MODEL_LIST="" VLLM_PROXY_URL="" \ # Wenxin - WENXIN_ACCESS_KEY="" WENXIN_SECRET_KEY="" WENXIN_MODEL_LIST="" \ + WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \ # xAI XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \ # 01.AI ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \ # Zhipu - ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" + ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \ + # Tencent Cloud + TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST="" USER nextjs diff --git a/README.ja-JP.md b/README.ja-JP.md deleted file mode 100644 index 4c6f19af12178..0000000000000 --- a/README.ja-JP.md +++ /dev/null @@ -1,844 +0,0 @@ -
- -[![][image-banner]][vercel-link] - -# Lobe Chat - -オープンソースのモダンデザイン ChatGPT/LLMs UI / フレームワーク。
-音声合成、マルチモーダル、拡張可能な([function call][docs-functionc-call])プラグインシステムをサポート。
-プライベートな OpenAI ChatGPT/Claude/Gemini/Groq/Ollama チャットアプリケーションをワンクリックで**無料**でデプロイ。 - -[English](./README.md) · [简体中文](./README.zh-CN.md) · **日本語** · [公式サイト][official-site] · [変更履歴][changelog] · [ドキュメント][docs] · [ブログ][blog] · [フィードバック][github-issues-link] - - - -[![][github-release-shield]][github-release-link] -[![][docker-release-shield]][docker-release-link] -[![][vercel-shield]][vercel-link] -[![][discord-shield]][discord-link]
-[![][codecov-shield]][codecov-link] -[![][github-action-test-shield]][github-action-test-link] -[![][github-action-release-shield]][github-action-release-link] -[![][github-releasedate-shield]][github-releasedate-link]
-[![][github-contributors-shield]][github-contributors-link] -[![][github-forks-shield]][github-forks-link] -[![][github-stars-shield]][github-stars-link] -[![][github-issues-shield]][github-issues-link] -[![][github-license-shield]][github-license-link]
-[![][sponsor-shield]][sponsor-link] - -**LobeChat リポジトリを共有** - -[![][share-x-shield]][share-x-link] -[![][share-telegram-shield]][share-telegram-link] -[![][share-whatsapp-shield]][share-whatsapp-link] -[![][share-reddit-shield]][share-reddit-link] -[![][share-weibo-shield]][share-weibo-link] -[![][share-mastodon-shield]][share-mastodon-link] -[![][share-linkedin-shield]][share-linkedin-link] - -新しい時代の思考と創造を先導します。あなたのために、スーパー個人のために作られました。 - -[![][github-trending-shield]][github-trending-url] - -[![][image-overview]][vercel-link] - -
- -
-目次 - -#### TOC - -- [👋🏻 はじめに & コミュニティに参加](#-はじめに--コミュニティに参加) -- [✨ 特徴](#-特徴) - - [`1` マルチモデルサービスプロバイダーのサポート](#1-マルチモデルサービスプロバイダーのサポート) - - [`2` ローカル大規模言語モデル (LLM) のサポート](#2-ローカル大規模言語モデル-llm-のサポート) - - [`3` モデルの視覚認識](#3-モデルの視覚認識) - - [`4` TTS & STT 音声会話](#4-tts--stt-音声会話) - - [`5` テキストから画像生成](#5-テキストから画像生成) - - [`6` プラグインシステム (Function Calling)](#6-プラグインシステム-function-calling) - - [`7` エージェントマーケット (GPTs)](#7-エージェントマーケット-gpts) - - [`8` ローカル / リモートデータベースのサポート](#8-ローカル--リモートデータベースのサポート) - - [`9` マルチユーザ管理のサポート](#9-マルチユーザ管理のサポート) - - [`10` プログレッシブウェブアプリ (PWA)](#10-プログレッシブウェブアプリ-pwa) - - [`11` モバイルデバイスの適応](#11-モバイルデバイスの適応) - - [`12` カスタムテーマ](#12-カスタムテーマ) - - [`*` その他の特徴](#-その他の特徴) -- [⚡️ パフォーマンス](#️-パフォーマンス) -- [🛳 自己ホスティング](#-自己ホスティング) - - [`A` Vercel、Zeabur、Sealos でのデプロイ](#a-vercelzeabursealos-でのデプロイ) - - [`B` Docker でのデプロイ](#b-docker-でのデプロイ) - - [環境変数](#環境変数) -- [📦 エコシステム](#-エコシステム) -- [🧩 プラグイン](#-プラグイン) -- [⌨️ ローカル開発](#️-ローカル開発) -- [🤝 コントリビュート](#-コントリビュート) -- [❤️ スポンサー](#️-スポンサー) -- [🔗 その他の製品](#-その他の製品) - -#### - -
- -
- -## 👋🏻 はじめに & コミュニティに参加 - -私たちは、AIGC のためのモダンデザインコンポーネントとツールを提供することを目指すデザインエンジニアのグループです。 -ブートストラッピングアプローチを採用することで、開発者とユーザーに対してよりオープンで透明性のある、使いやすい製品エコシステムを提供することを目指しています。 - -ユーザーやプロの開発者にとって、LobeHub はあなたの AI エージェントの遊び場となるでしょう。LobeChat は現在アクティブに開発中であり、遭遇した[問題][issues-link]についてのフィードバックを歓迎します。 - -| [![][vercel-shield-badge]][vercel-link] | インストールや登録は不要です!私たちのウェブサイトにアクセスして、直接体験してください。 | -| :---------------------------------------- | :---------------------------------------------------------------------------------------------------------------------- | -| [![][discord-shield-badge]][discord-link] | 私たちの Discord コミュニティに参加しましょう!ここでは、LobeHub の開発者や他の熱心なユーザーとつながることができます。 | - -> \[!IMPORTANT] -> -> **スターを付けてください**。GitHub からのすべてのリリース通知を遅延なく受け取ることができます~⭐️ - -[![][image-star]][github-stars-link] - -
- スター履歴 - - - - -
- -## ✨ 特徴 - -[![][image-feat-privoder]][docs-feat-provider] - -### `1` [マルチモデルサービスプロバイダーのサポート][docs-feat-provider] - -LobeChat の継続的な開発において、AI 会話サービスを提供する際のモデルサービスプロバイダーの多様性がコミュニティのニーズを満たすために重要であることを深く理解しています。そのため、単一のモデルサービスプロバイダーに限定せず、複数のモデルサービスプロバイダーをサポートすることで、ユーザーにより多様で豊富な会話の選択肢を提供しています。 - -このようにして、LobeChat は異なるユーザーのニーズにより柔軟に対応し、開発者にも幅広い選択肢を提供します。 - -#### サポートされているモデルサービスプロバイダー - -以下のモデルサービスプロバイダーをサポートしています: - - - -- **[OpenAI](https://lobechat.com/discover/provider/openai)**: OpenAI は、世界をリードする人工知能研究機関であり、GPT シリーズなどのモデルを開発し、自然言語処理の最前線を推進しています。OpenAI は、革新と効率的な AI ソリューションを通じて、さまざまな業界を変革することに取り組んでいます。彼らの製品は、顕著な性能と経済性を持ち、研究、ビジネス、革新アプリケーションで広く使用されています。 -- **[Ollama](https://lobechat.com/discover/provider/ollama)**: Ollama が提供するモデルは、コード生成、数学演算、多言語処理、対話インタラクションなどの分野を広くカバーし、企業向けおよびローカライズされた展開の多様なニーズに対応しています。 -- **[Anthropic](https://lobechat.com/discover/provider/anthropic)**: Anthropic は、人工知能の研究と開発に特化した企業であり、Claude 3.5 Sonnet、Claude 3 Sonnet、Claude 3 Opus、Claude 3 Haiku などの先進的な言語モデルを提供しています。これらのモデルは、知性、速度、コストの理想的なバランスを実現しており、企業向けのワークロードから迅速な応答が求められるさまざまなアプリケーションシーンに適しています。Claude 3.5 Sonnet は最新のモデルであり、複数の評価で優れたパフォーマンスを示し、高いコストパフォーマンスを維持しています。 -- **[Bedrock](https://lobechat.com/discover/provider/bedrock)**: Bedrock は、Amazon AWS が提供するサービスで、企業に先進的な AI 言語モデルと視覚モデルを提供することに特化しています。そのモデルファミリーには、Anthropic の Claude シリーズや Meta の Llama 3.1 シリーズなどが含まれ、軽量から高性能までのさまざまな選択肢を提供し、テキスト生成、対話、画像処理などの多様なタスクをサポートし、異なる規模とニーズの企業アプリケーションに適しています。 -- **[Google](https://lobechat.com/discover/provider/google)**: Google の Gemini シリーズは、Google DeepMind によって開発された最先端で汎用的な AI モデルであり、多モーダル設計に特化しており、テキスト、コード、画像、音声、動画のシームレスな理解と処理をサポートします。データセンターからモバイルデバイスまでのさまざまな環境に適しており、AI モデルの効率と適用範囲を大幅に向上させています。 -- **[DeepSeek](https://lobechat.com/discover/provider/deepseek)**: DeepSeek は、人工知能技術の研究と応用に特化した企業であり、最新のモデル DeepSeek-V2.5 は、汎用対話とコード処理能力を融合させ、人間の好みの整合、ライティングタスク、指示の遵守などの面で顕著な向上を実現しています。 -- **[HuggingFace](https://lobechat.com/discover/provider/huggingface)**: HuggingFace Inference API は、数千のモデルをさまざまなタスクに対して探索するための迅速かつ無料の方法を提供します。新しいアプリケーションのプロトタイプを作成している場合でも、機械学習の機能を試している場合でも、この API は複数の分野の高性能モデルに即座にアクセスできるようにします。 -- **[OpenRouter](https://lobechat.com/discover/provider/openrouter)**: OpenRouter は、OpenAI、Anthropic、LLaMA などのさまざまな最先端の大規模モデルインターフェースを提供するサービスプラットフォームであり、多様な開発と応用のニーズに適しています。ユーザーは、自身のニーズに応じて最適なモデルと価格を柔軟に選択し、AI 体験の向上を支援します。 -- **[Cloudflare Workers AI](https://lobechat.com/discover/provider/cloudflare)**: Cloudflare のグローバルネットワーク上で、サーバーレス GPU によって駆動される機械学習モデルを実行します。 -- **[GitHub](https://lobechat.com/discover/provider/github)**: GitHub モデルを使用することで、開発者は AI エンジニアになり、業界をリードする AI モデルを使って構築できます。 - -
See more providers (+26) - -- **[Novita](https://lobechat.com/discover/provider/novita)**: Novita AI は、さまざまな大規模言語モデルと AI 画像生成の API サービスを提供するプラットフォームであり、柔軟で信頼性が高く、コスト効率に優れています。Llama3、Mistral などの最新のオープンソースモデルをサポートし、生成的 AI アプリケーションの開発に向けた包括的でユーザーフレンドリーかつ自動スケーリングの API ソリューションを提供し、AI スタートアップの急成長を支援します。 -- **[Together AI](https://lobechat.com/discover/provider/togetherai)**: Together AI は、革新的な AI モデルを通じて先進的な性能を実現することに取り組んでおり、迅速なスケーリングサポートや直感的な展開プロセスを含む広範なカスタマイズ能力を提供し、企業のさまざまなニーズに応えています。 -- **[Fireworks AI](https://lobechat.com/discover/provider/fireworksai)**: Fireworks AI は、先進的な言語モデルサービスのリーダーであり、機能呼び出しと多モーダル処理に特化しています。最新のモデル Firefunction V2 は Llama-3 に基づいており、関数呼び出し、対話、指示の遵守に最適化されています。視覚言語モデル FireLLaVA-13B は、画像とテキストの混合入力をサポートしています。他の注目すべきモデルには、Llama シリーズや Mixtral シリーズがあり、高効率の多言語指示遵守と生成サポートを提供しています。 -- **[Groq](https://lobechat.com/discover/provider/groq)**: Groq の LPU 推論エンジンは、最新の独立した大規模言語モデル(LLM)ベンチマークテストで卓越したパフォーマンスを示し、その驚異的な速度と効率で AI ソリューションの基準を再定義しています。Groq は、即時推論速度の代表であり、クラウドベースの展開で良好なパフォーマンスを発揮しています。 -- **[Perplexity](https://lobechat.com/discover/provider/perplexity)**: Perplexity は、先進的な対話生成モデルの提供者であり、さまざまな Llama 3.1 モデルを提供し、オンラインおよびオフラインアプリケーションをサポートし、特に複雑な自然言語処理タスクに適しています。 -- **[Mistral](https://lobechat.com/discover/provider/mistral)**: Mistral は、先進的な汎用、専門、研究型モデルを提供し、複雑な推論、多言語タスク、コード生成などの分野で広く使用されています。機能呼び出しインターフェースを通じて、ユーザーはカスタム機能を統合し、特定のアプリケーションを実現できます。 -- **[Ai21Labs](https://lobechat.com/discover/provider/ai21)**: AI21 Labs は企業向けに基盤モデルと人工知能システムを構築し、生成的人工知能の生産への応用を加速します。 -- **[Upstage](https://lobechat.com/discover/provider/upstage)**: Upstage は、さまざまなビジネスニーズに応じた AI モデルの開発に特化しており、Solar LLM や文書 AI を含み、人造一般知能(AGI)の実現を目指しています。Chat API を通じてシンプルな対話エージェントを作成し、機能呼び出し、翻訳、埋め込み、特定分野のアプリケーションをサポートします。 -- **[xAI](https://lobechat.com/discover/provider/xai)**: xAI は、人類の科学的発見を加速するための人工知能を構築することに専念している企業です。私たちの使命は、宇宙に対する共通の理解を促進することです。 -- **[Qwen](https://lobechat.com/discover/provider/qwen)**: 通義千問は、アリババクラウドが独自に開発した超大規模言語モデルであり、強力な自然言語理解と生成能力を持っています。さまざまな質問に答えたり、文章を創作したり、意見を表現したり、コードを執筆したりすることができ、さまざまな分野で活躍しています。 -- **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: 企業向けのワンストップ大規模モデルと AI ネイティブアプリケーションの開発およびサービスプラットフォームで、最も包括的で使いやすい生成的人工知能モデルの開発とアプリケーション開発の全プロセスツールチェーンを提供します。 -- **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: テンセントが開発した大規模言語モデルであり、強力な中国語の創作能力、複雑な文脈における論理的推論能力、そして信頼性の高いタスク実行能力を備えています。 -- **[Spark](https://lobechat.com/discover/provider/spark)**: 科大訊飛星火大モデルは、多分野、多言語の強力な AI 能力を提供し、先進的な自然言語処理技術を利用して、スマートハードウェア、スマート医療、スマート金融などのさまざまな垂直シーンに適した革新的なアプリケーションを構築します。 -- **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: 智谱 AI は、多モーダルおよび言語モデルのオープンプラットフォームを提供し、テキスト処理、画像理解、プログラミング支援など、幅広い AI アプリケーションシーンをサポートしています。 -- **[01.AI](https://lobechat.com/discover/provider/zeroone)**: 01.AI は、AI 2.0 時代の人工知能技術に特化し、「人 + 人工知能」の革新と応用を推進し、超強力なモデルと先進的な AI 技術を用いて人類の生産性を向上させ、技術の力を実現します。 -- **[SenseNova](https://lobechat.com/discover/provider/sensenova)**: 商湯日日新は、商湯の強力な基盤支援に基づき、高効率で使いやすい全スタックの大規模モデルサービスを提供します。 -- **[Stepfun](https://lobechat.com/discover/provider/stepfun)**: 階級星辰大モデルは、業界をリードする多モーダルおよび複雑な推論能力を備え、超長文の理解と強力な自律的検索エンジン機能をサポートしています。 -- **[Moonshot](https://lobechat.com/discover/provider/moonshot)**: Moonshot は、北京月之暗面科技有限公司が提供するオープンプラットフォームであり、さまざまな自然言語処理モデルを提供し、コンテンツ創作、学術研究、スマート推薦、医療診断などの広範な応用分野を持ち、長文処理や複雑な生成タスクをサポートしています。 -- **[Baichuan](https://lobechat.com/discover/provider/baichuan)**: 百川智能は、人工知能大モデルの研究開発に特化した企業であり、そのモデルは国内の知識百科、長文処理、生成創作などの中国語タスクで卓越したパフォーマンスを示し、海外の主流モデルを超えています。百川智能は、業界をリードする多モーダル能力を持ち、複数の権威ある評価で優れたパフォーマンスを示しています。そのモデルには、Baichuan 4、Baichuan 3 Turbo、Baichuan 3 Turbo 128k などが含まれ、異なるアプリケーションシーンに最適化され、高コストパフォーマンスのソリューションを提供しています。 -- **[Minimax](https://lobechat.com/discover/provider/minimax)**: MiniMax は 2021 年に設立された汎用人工知能テクノロジー企業であり、ユーザーと共に知能を共創することに取り組んでいます。MiniMax は、さまざまなモードの汎用大モデルを独自に開発しており、トリリオンパラメータの MoE テキスト大モデル、音声大モデル、画像大モデルを含んでいます。また、海螺 AI などのアプリケーションも展開しています。 -- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI は、360 社が提供する AI モデルとサービスプラットフォームであり、360GPT2 Pro、360GPT Pro、360GPT Turbo、360GPT Turbo Responsibility 8K など、さまざまな先進的な自然言語処理モデルを提供しています。これらのモデルは、大規模なパラメータと多モーダル能力を組み合わせており、テキスト生成、意味理解、対話システム、コード生成などの分野で広く使用されています。柔軟な価格戦略を通じて、360 AI は多様なユーザーのニーズに応え、開発者の統合をサポートし、スマートアプリケーションの革新と発展を促進します。 -- **[Taichu](https://lobechat.com/discover/provider/taichu)**: 中科院自動化研究所と武漢人工知能研究院が新世代の多モーダル大モデルを発表し、多輪問答、テキスト創作、画像生成、3D 理解、信号分析などの包括的な問答タスクをサポートし、より強力な認知、理解、創作能力を持ち、新しいインタラクティブな体験を提供します。 -- **[InternLM](https://lobechat.com/discover/provider/internlm)**: 大規模モデルの研究と開発ツールチェーンに特化したオープンソース組織です。すべての AI 開発者に対して、高効率で使いやすいオープンプラットフォームを提供し、最先端の大規模モデルとアルゴリズム技術を身近に感じられるようにします。 -- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow は、AGI を加速させ、人類に利益をもたらすことを目指し、使いやすくコスト効率の高い GenAI スタックを通じて大規模 AI の効率を向上させることに取り組んでいます。 -- **[Higress](https://lobechat.com/discover/provider/higress)**: Higress は、阿里内部で Tengine のリロードが長期接続のビジネスに悪影響を及ぼすことや、gRPC/Dubbo の負荷分散能力が不足している問題を解決するために生まれた、クラウドネイティブな API ゲートウェイです。 -- **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI の Serverless API は、AI 開発者に開梱即使用の大モデル推論 API サービスを提供する。 - -
- -> 📊 Total providers: [**36**](https://lobechat.com/discover/providers) - - - -同時に、私たちはさらに多くのモデルサービスプロバイダーをサポートする計画を立てており、サービスプロバイダーのライブラリをさらに充実させる予定です。 LobeChat があなたのお気に入りのサービスプロバイダーをサポートすることを希望する場合は、[💬 コミュニティディスカッション](https://github.com/lobehub/lobe-chat/discussions/1284)に参加してください。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-local]][docs-feat-local] - -### `2` [ローカル大規模言語モデル (LLM) のサポート][docs-feat-local] - -特定のユーザーのニーズに応えるために、LobeChat は[Ollama](https://ollama.ai)に基づいてローカルモデルの使用をサポートしており、ユーザーが自分自身またはサードパーティのモデルを柔軟に使用できるようにしています。 - -> \[!TIP] -> -> [📘 LobeChat での Ollama の使用][docs-usage-ollama]について詳しくはこちらをご覧ください。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-vision]][docs-feat-vision] - -### `3` [モデルの視覚認識][docs-feat-vision] - -LobeChat は、OpenAI の最新の視覚認識機能を備えた[`gpt-4-vision`](https://platform.openai.com/docs/guides/vision)モデルをサポートしています。 -これは視覚を認識できるマルチモーダルインテリジェンスです。ユーザーは簡単に画像をアップロードしたり、画像をドラッグアンドドロップして対話ボックスに入れることができ、 -エージェントは画像の内容を認識し、これに基づいてインテリジェントな会話を行い、よりスマートで多様なチャットシナリオを作成します。 - -この機能は、新しいインタラクティブな方法を提供し、コミュニケーションがテキストを超えて視覚要素を含むことを可能にします。 -日常の使用での画像共有や特定の業界での画像解釈に関係なく、エージェントは優れた会話体験を提供します。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-tts]][docs-feat-tts] - -### `4` [TTS & STT 音声会話][docs-feat-tts] - -LobeChat は、テキストから音声への変換(Text-to-Speech、TTS)および音声からテキストへの変換(Speech-to-Text、STT)技術をサポートしており、 -テキストメッセージを明瞭な音声出力に変換し、ユーザーが実際の人と話しているかのように対話エージェントと対話できるようにします。 -ユーザーは、エージェントに適した音声を選択することができます。 - -さらに、TTS は聴覚学習を好む人や忙しい中で情報を受け取りたい人にとって優れたソリューションを提供します。 -LobeChat では、異なる地域や文化的背景のユーザーのニーズに応えるために、さまざまな高品質の音声オプション(OpenAI Audio、Microsoft Edge Speech)を慎重に選択しました。 -ユーザーは、個人の好みや特定のシナリオに応じて適切な音声を選択し、パーソナライズされたコミュニケーション体験を得ることができます。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-t2i]][docs-feat-t2i] - -### `5` [テキストから画像生成][docs-feat-t2i] - -最新のテキストから画像生成技術をサポートし、LobeChat はユーザーがエージェントとの対話中に直接画像作成ツールを呼び出すことができるようになりました。 -[`DALL-E 3`](https://openai.com/dall-e-3)、[`MidJourney`](https://www.midjourney.com/)、[`Pollinations`](https://pollinations.ai/)などの AI ツールの能力を活用することで、 -エージェントはあなたのアイデアを画像に変えることができます。 - -これにより、プライベートで没入感のある創造プロセスが可能になり、個人的な対話に視覚的なストーリーテリングをシームレスに統合することができます。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-plugin]][docs-feat-plugin] - -### `6` [プラグインシステム (Function Calling)][docs-feat-plugin] - -LobeChat のプラグインエコシステムは、そのコア機能の重要な拡張であり、LobeChat アシスタントの実用性と柔軟性を大幅に向上させます。 - - - -プラグインを利用することで、LobeChat アシスタントはリアルタイムの情報を取得して処理することができ、ウェブ情報を検索し、ユーザーに即時かつ関連性の高いニュースを提供することができます。 - -さらに、これらのプラグインはニュースの集約に限定されず、他の実用的な機能にも拡張できます。たとえば、ドキュメントの迅速な検索、画像の生成、Bilibili、Steam などのさまざまなプラットフォームからのデータの取得、さまざまなサードパーティサービスとの連携などです。 - -> \[!TIP] -> -> [📘 プラグインの使用][docs-usage-plugin]について詳しくはこちらをご覧ください。 - - - -| 最近追加 | 説明 | -| ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)
By **mintbase** on **2024-12-31** | NEAR プロトコル上の任意の NFT データを見つける。
`暗号通貨` `nft` | -| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)
By **portfoliometa** on **2024-12-22** | 株を分析し、包括的なリアルタイムの投資データと分析を取得します。
`stock` | -| [Google CSE](https://lobechat.com/discover/plugin/google-cse)
By **vsnthdev** on **2024-12-02** | 公式の CSE API を通じて Google を検索します。
`ウェブ` `検索` | -| [話す](https://lobechat.com/discover/plugin/speak)
By **speak** on **2024-12-02** | Speak は、AI パワードの言語チューターで、他の言語で何でも言う方法を学ぶことができます。
`教育` `言語` | - -> 📊 Total plugins: [**48**](https://lobechat.com/discover/plugins) - - - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-agent]][docs-feat-agent] - -### `7` [エージェントマーケット (GPTs)][docs-feat-agent] - -LobeChat エージェントマーケットプレイスでは、クリエイターが多くの優れたエージェントを発見できる活気に満ちた革新的なコミュニティを提供しています。 -これらのエージェントは、仕事のシナリオで重要な役割を果たすだけでなく、学習プロセスでも大いに便利です。 -私たちのマーケットプレイスは、単なるショーケースプラットフォームではなく、協力の場でもあります。ここでは、誰もが自分の知恵を貢献し、開発したエージェントを共有できます。 - -> \[!TIP] -> -> [🤖/🏪 エージェントを提出][submit-agents-link]することで、簡単にエージェント作品をプラットフォームに提出できます。 -> 重要なのは、LobeChat が高度な自動化国際化(i18n)ワークフローを確立しており、 -> あなたのエージェントを複数の言語バージョンにシームレスに翻訳できることです。 -> これにより、ユーザーがどの言語を話していても、エージェントを障害なく体験できます。 - -> \[!IMPORTANT] -> -> すべてのユーザーがこの成長するエコシステムに参加し、エージェントの反復と最適化に参加することを歓迎します。 -> 一緒に、より面白く、実用的で革新的なエージェントを作成し、エージェントの多様性と実用性をさらに豊かにしましょう。 - - - -| 最近追加 | 説明 | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | -| [システム指示の専門家](https://lobechat.com/discover/assistant/instructer)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-12-04** | 効率的なシステム指示を精練し生成することに長けています
`システム指示` `執筆` `詳細最適化` `ユーザーのニーズ` | -| [日本語記憶支援者](https://lobechat.com/discover/assistant/japan-language-helper)
By **[sharkbear212](https://github.com/sharkbear212)** on **2024-12-04** | 日本語の五十音、ひらがな、カタカナ、単語やフレーズの説明と記憶のテクニックに特化しています
`説明` `記憶テクニック` `日本語教育` | -| [詩詞カードデザイナー](https://lobechat.com/discover/assistant/poetry-card-designer)
By **[lianxin255](https://github.com/lianxin255)** on **2024-12-03** | 詩詞カードのデザインに優れ、芸術感と魅力を高めます
`詩詞カードデザイン` `カード` `クリエイティブ` `アート表現` | -| [日常医師](https://lobechat.com/discover/assistant/yunchat-docter)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30** | 外科診療と個別化健康管理に優れています
`総合診療` `外科` `健康相談` `個別化治療` `医学教育` | - -> 📊 Total agents: [**453** ](https://lobechat.com/discover/assistants) - - - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-database]][docs-feat-database] - -### `8` [ローカル / リモートデータベースのサポート][docs-feat-database] - -LobeChat は、サーバーサイドデータベースとローカルデータベースの両方の使用をサポートしています。ニーズに応じて、適切なデプロイメントソリューションを選択できます: - -- **ローカルデータベース**:データとプライバシー保護に対するより多くの制御を希望するユーザーに適しています。LobeChat は CRDT(Conflict-Free Replicated Data Type)技術を使用してマルチデバイス同期を実現しています。これはシームレスなデータ同期体験を提供することを目的とした実験的な機能です。 -- **サーバーサイドデータベース**:より便利なユーザー体験を希望するユーザーに適しています。LobeChat は PostgreSQL をサーバーサイドデータベースとしてサポートしています。サーバーサイドデータベースの設定方法についての詳細なドキュメントは、[サーバーサイドデータベースの設定](https://lobehub.com/docs/self-hosting/advanced/server-database)をご覧ください。 - -どのデータベースを選択しても、LobeChat は優れたユーザー体験を提供します。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-auth]][docs-feat-auth] - -### `9` [マルチユーザ管理のサポート][docs-feat-auth] - -LobeChat はマルチユーザ管理をサポートし、異なるニーズに応じて 2 つの主要なユーザ認証および管理ソリューションを提供します: - -- **next-auth**:LobeChat は、複数の認証方法(OAuth、メールログイン、資格情報ログインなど)をサポートする柔軟で強力な認証ライブラリである`next-auth`を統合しています。`next-auth`を使用すると、ユーザの登録、ログイン、セッション管理、ソーシャルログインなどの機能を簡単に実装し、ユーザデータのセキュリティとプライバシーを確保できます。 - -- **Clerk**:より高度なユーザ管理機能が必要なユーザ向けに、LobeChat は`Clerk`もサポートしています。`Clerk`は、現代的なユーザ管理プラットフォームであり、多要素認証(MFA)、ユーザプロファイル管理、ログイン活動の監視など、より豊富な機能を提供します。`Clerk`を使用すると、より高いセキュリティと柔軟性を得ることができ、複雑なユーザ管理ニーズに簡単に対応できます。 - -どのユーザ管理ソリューションを選択しても、LobeChat は優れたユーザー体験と強力な機能サポートを提供します。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-pwa]][docs-feat-pwa] - -### `10` [プログレッシブウェブアプリ (PWA)][docs-feat-pwa] - -私たちは、今日のマルチデバイス環境でユーザーにシームレスな体験を提供することの重要性を深く理解しています。 -そのため、プログレッシブウェブアプリケーション([PWA](https://support.google.com/chrome/answer/9658361))技術を採用しました。 -これは、ウェブアプリケーションをネイティブアプリに近い体験に引き上げるモダンなウェブ技術です。 - -PWA を通じて、LobeChat はデスクトップとモバイルデバイスの両方で高度に最適化されたユーザー体験を提供しながら、その軽量で高性能な特性を維持します。 -視覚的および感覚的には、インターフェースを慎重に設計し、ネイティブアプリと区別がつかないようにし、 -スムーズなアニメーション、レスポンシブレイアウト、および異なるデバイスの画面解像度に適応するようにしています。 - -> \[!NOTE] -> -> PWA のインストールプロセスに慣れていない場合は、以下の手順に従って LobeChat をデスクトップアプリケーション(モバイルデバイスにも適用)として追加できます: -> -> - コンピュータで Chrome または Edge ブラウザを起動します。 -> - LobeChat のウェブページにアクセスします。 -> - アドレスバーの右上にあるインストールアイコンをクリックします。 -> - 画面の指示に従って PWA のインストールを完了します。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-mobile]][docs-feat-mobile] - -### `11` [モバイルデバイスの適応][docs-feat-mobile] - -モバイルデバイスのユーザー体験を向上させるために、一連の最適化設計を行いました。現在、モバイルユーザー体験のバージョンを繰り返し改善しています。ご意見やアイデアがある場合は、GitHub Issues や Pull Requests を通じてフィードバックをお寄せください。 - -
- -[![][back-to-top]](#readme-top) - -
- -[![][image-feat-theme]][docs-feat-theme] - -### `12` [カスタムテーマ][docs-feat-theme] - -デザインエンジニアリング指向のアプリケーションとして、LobeChat はユーザーの個別体験を重視しており、 -柔軟で多様なテーマモードを導入しています。日中のライトモードと夜間のダークモードを含みます。 -テーマモードの切り替えに加えて、さまざまな色のカスタマイズオプションを提供し、ユーザーが自分の好みに応じてアプリケーションのテーマカラーを調整できるようにしています。 -落ち着いたダークブルー、活気のあるピーチピンク、プロフェッショナルなグレーホワイトなど、LobeChat では自分のスタイルに合った色の選択肢を見つけることができます。 - -> \[!TIP] -> -> デフォルトの設定は、ユーザーのシステムのカラーモードをインテリジェントに認識し、テーマを自動的に切り替えて、オペレーティングシステムと一貫した視覚体験を提供します。 -> 詳細を手動で制御するのが好きなユーザーには、直感的な設定オプションと、会話シナリオに対してチャットバブルモードとドキュメントモードの選択肢を提供します。 - -
- -[![][back-to-top]](#readme-top) - -
- -### `*` その他の特徴 - -これらの特徴に加えて、LobeChat は基本的な技術基盤も優れています: - -- [x] 💨 **迅速なデプロイ**:Vercel プラットフォームまたは Docker イメージを使用して、ワンクリックでデプロイを行い、1 分以内にプロセスを完了できます。複雑な設定は不要です。 -- [x] 🌐 **カスタムドメイン**:ユーザーが独自のドメインを持っている場合、プラットフォームにバインドして、どこからでも対話エージェントに迅速にアクセスできます。 -- [x] 🔒 **プライバシー保護**:すべてのデータはユーザーのブラウザにローカルに保存され、ユーザーのプライバシーを保護します。 -- [x] 💎 **洗練された UI デザイン**:慎重に設計されたインターフェースで、エレガントな外観とスムーズなインタラクションを提供します。ライトモードとダークモードをサポートし、モバイルフレンドリーです。PWA サポートにより、よりネイティブに近い体験を提供します。 -- [x] 🗣️ **スムーズな会話体験**:流れるような応答により、スムーズな会話体験を提供します。Markdown レンダリングを完全にサポートし、コードのハイライト、LaTex の数式、Mermaid のフローチャートなどを含みます。 - -> ✨ LobeChat の進化に伴い、さらに多くの機能が追加されます。 - ---- - -> \[!NOTE] -> -> 今後の[ロードマップ][github-project-link]計画は、Projects セクションで確認できます。 - -
- -[![][back-to-top]](#readme-top) - -
- -## ⚡️ パフォーマンス - -> \[!NOTE] -> -> 完全なレポートのリストは[📘 Lighthouse レポート][docs-lighthouse]で確認できます。 - -| デスクトップ | モバイル | -| :-------------------------------------------: | :------------------------------------------: | -| ![][chat-desktop] | ![][chat-mobile] | -| [📑 Lighthouse レポート][chat-desktop-report] | [📑 Lighthouse レポート][chat-mobile-report] | - -
- -[![][back-to-top]](#readme-top) - -
- -## 🛳 自己ホスティング - -LobeChat は、Vercel と[Docker イメージ][docker-release-link]を使用した自己ホスティングバージョンを提供しています。これにより、事前の知識がなくても数分で独自のチャットボットをデプロイできます。 - -> \[!TIP] -> -> [📘 独自の LobeChat を構築する][docs-self-hosting]について詳しくはこちらをご覧ください。 - -### `A` Vercel、Zeabur、Sealos でのデプロイ - -このサービスを Vercel または Zeabur でデプロイしたい場合は、以下の手順に従ってください: - -- [OpenAI API Key](https://platform.openai.com/account/api-keys)を準備します。 -- 下のボタンをクリックしてデプロイを開始します:GitHub アカウントで直接ログインし、環境変数セクションに`OPENAI_API_KEY`(必須)と`ACCESS_CODE`(推奨)を入力します。 -- デプロイが完了したら、使用を開始できます。 -- カスタムドメインをバインド(オプション):Vercel が割り当てたドメインの DNS は一部の地域で汚染されているため、カスタムドメインをバインドすることで直接接続できます。 - -
- -| Vercel でデプロイ | Zeabur でデプロイ | Sealos でデプロイ | -| :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | -| [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | - -
- -#### フォーク後 - -フォーク後、リポジトリのアクションページで他のアクションを無効にし、アップストリーム同期アクションのみを保持します。 - -#### 更新を維持 - -README のワンクリックデプロイ手順に従って独自のプロジェクトをデプロイした場合、「更新が利用可能です」というプロンプトが常に表示されることがあります。これは、Vercel がデフォルトで新しいプロジェクトを作成し、フォークしないため、更新を正確に検出できないためです。 - -> \[!TIP] -> -> [📘 最新バージョンと自動同期][docs-upstream-sync]の手順に従って再デプロイすることをお勧めします。 - -
- -### `B` Docker でのデプロイ - -[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] -[![][docker-pulls-shield]][docker-pulls-link] - -LobeChat サービスを独自のプライベートデバイスにデプロイするための Docker イメージを提供しています。以下のコマンドを使用して LobeChat サービスを開始します: - -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` - -> \[!TIP] -> -> OpenAI サービスをプロキシ経由で使用する必要がある場合は、`OPENAI_PROXY_URL`環境変数を使用してプロキシアドレスを設定できます: - -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` - -> \[!NOTE] -> -> Docker を使用したデプロイの詳細な手順については、[📘 Docker デプロイガイド][docs-docker]を参照してください。 - -
- -### 環境変数 - -このプロジェクトは、環境変数で設定される追加の構成項目を提供します: - -| 環境変数 | 必須 | 説明 | 例 | -| ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `OPENAI_API_KEY` | はい | これは OpenAI アカウントページで申請した API キーです | `sk-xxxxxx...xxxxxx` | -| `OPENAI_PROXY_URL` | いいえ | OpenAI インターフェイスプロキシを手動で設定する場合、この設定項目を使って、デフォルトの OpenAI API リクエストベース URL を上書きすることができます。 | `https://api.chatanywhere.cn` または `https://aihubmix.com/v1`
デフォルトの値は
`https://api.openai.com/v1` | -| `ACCESS_CODE` | いいえ | このサービスにアクセスするためのパスワードを追加します。漏洩を避けるために長いパスワードを設定することができます。この値にカンマが含まれる場合は、パスワードの配列となります。 | `awCTe)re_r74` または `rtrt_ewee3@09!` または `code1,code2,code3` | -| `OPENAI_MODEL_LIST` | いいえ | モデルリストをコントロールするために使用します。モデルを追加するには `+` を、モデルを非表示にするには `-` を、モデルの表示名をカンマ区切りでカスタマイズするには `model_name=display_name` を使用します。 | `qwen-7b-chat,+glm-6b,-gpt-3.5-turbo` | - -> \[!NOTE] -> -> 環境変数の完全なリストは [📘環境変数][docs-env-var] にあります - -
- -[![][back-to-top]](#readme-top) - -
- -## 📦 エコシステム - -| NPM | リポジトリ | 説明 | バージョン | -| --------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------- | -| [@lobehub/ui][lobe-ui-link] | [lobehub/lobe-ui][lobe-ui-github] | AIGC ウェブアプリケーション構築専用のオープンソース UI コンポーネントライブラリ。 | [![][lobe-ui-shield]][lobe-ui-link] | -| [@lobehub/icons][lobe-icons-link] | [lobehub/lobe-icons][lobe-icons-github] | 人気の AI/LLM モデルブランドの SVG ロゴとアイコン集。 | [![][lobe-icons-shield]][lobe-icons-link] | -| [@lobehub/tts][lobe-tts-link] | [lobehub/lobe-tts][lobe-tts-github] | 高品質で信頼性の高い TTS/STT React Hooks ライブラリ | [![][lobe-tts-shield]][lobe-tts-link] | -| [@lobehub/lint][lobe-lint-link] | [lobehub/lobe-lint][lobe-lint-github] | LobeHub の ESlint、Stylelint、Commitlint、Prettier、Remark、Semantic Release の設定。 | [![][lobe-lint-shield]][lobe-lint-link] | - -
- -[![][back-to-top]](#readme-top) - -
- -## 🧩 プラグイン - -プラグインは、LobeChat の[関数呼び出し][docs-functionc-call]機能を拡張する手段を提供します。プラグインを使用して、新しい関数呼び出しやメッセージ結果の新しいレンダリング方法を導入することができます。プラグイン開発に興味がある方は、Wiki の[📘プラグイン開発ガイド][docs-plugin-dev]を参照してください。 - -- [lobe-chat-plugins][lobe-chat-plugins]: これは LobeChat のプラグインインデックスです。このリポジトリから index.json にアクセスし、LobeChat で利用可能なプラグインのリストをユーザに表示します。 -- [chat-plugin-template][chat-plugin-template]: これは LobeChat プラグイン開発用のプラグインテンプレートです。 -- [@lobehub/chat-plugin-sdk][chat-plugin-sdk]: LobeChat プラグイン SDK は、Lobe Chat 用の優れたチャットプラグインの作成を支援します。 -- [@lobehub/chat-plugins-gateway][chat-plugins-gateway]: LobeChat Plugins Gateway は、LobeChat プラグインのためのゲートウェイを提供するバックエンドサービスです。このサービスは Vercel を使用してデプロイされます。プライマリ API の POST /api/v1/runner は Edge Function としてデプロイされます。 - -> \[!NOTE] -> -> プラグインシステムは現在大規模な開発中です。詳しくは以下の issue をご覧ください: -> -> - [x] [**プラグインフェイズ 1**](https://github.com/lobehub/lobe-chat/issues/73): プラグインを本体から分離し、メンテナンスのためにプラグインを独立したリポジトリに分割し、プラグインの動的ロードを実現する。 -> - [x] [**プラグインフェイズ 2**](https://github.com/lobehub/lobe-chat/issues/97): プラグイン使用の安全性と安定性、より正確な異常状態の提示、プラグインアーキテクチャの保守性、開発者フレンドリー。 -> - [x] [**プラグインフェイズ 3**](https://github.com/lobehub/lobe-chat/issues/149): より高度で包括的なカスタマイズ機能、プラグイン認証のサポート、サンプル。 - -
- -[![][back-to-top]](#readme-top) - -
- -## ⌨️ ローカル開発 - -GitHub Codespaces を使ってオンライン開発ができます: - -[![][codespaces-shield]][codespaces-link] - -Or clone it for local development: - -```fish -$ git clone https://github.com/lobehub/lobe-chat.git -$ cd lobe-chat -$ pnpm install -$ pnpm dev -``` - -より詳しい情報をお知りになりたい方は、[📘開発ガイド][docs-dev-guide]をご覧ください。 - -
- -[![][back-to-top]](#readme-top) - -
- -## 🤝 コントリビュート - -どのようなタイプのコントリビュートも大歓迎です;コードを提供することに興味がある方は、GitHub の [Issues][github-issues-link] や [Projects][github-project-link] をチェックして、あなたの力をお貸しください。 - -> \[!TIP] -> -> 私たちは技術主導のフォーラムを創設し、知識の交流とアイデアの交換を促進することで、相互のインスピレーションと協力的なイノベーションを生み出すことを目指しています。 -> -> LobeChat の改善にご協力ください。製品設計のフィードバックやユーザー体験に関するディスカッションを直接お寄せください。 -> -> **プリンシパルメンテナー:** [@arvinxx](https://github.com/arvinxx) [@canisminor1990](https://github.com/canisminor1990) - -[![][pr-welcome-shield]][pr-welcome-link] -[![][submit-agents-shield]][submit-agents-link] -[![][submit-plugin-shield]][submit-plugin-link] - - - - - - - - - - - - - -
-


-
- - - - - - - - - -
- - - - -
-
- -
- -[![][back-to-top]](#readme-top) - -
- -## ❤️ スポンサー - -あなたの一度きりの寄付が、私たちの銀河系で輝きを放ちます!皆様は流れ星であり、私たちの旅路に迅速かつ明るい影響を与えます。私たちを信じてくださり、ありがとうございます。皆様の寛大なお気持ちが、私たちの使命に向かって、一度に輝かしい閃光を放つよう導いてくださるのです。 - - - - - - - - -
- -[![][back-to-top]](#readme-top) - -
- -## 🔗 その他の製品 - -- **[🅰️ Lobe SD Theme][lobe-theme]:** Stable Diffusion WebUI のためのモダンなテーマ、絶妙なインターフェースデザイン、高度にカスタマイズ可能な UI、効率を高める機能。 -- **[⛵️ Lobe Midjourney WebUI][lobe-midjourney-webui]:** Midjourney の WebUI は、AI を活用しテキストプロンプトから豊富で多様な画像を素早く生成し、創造性を刺激して会話を盛り上げます。 -- **[🌏 Lobe i18n][lobe-i18n] :** Lobe i18n は ChatGPT を利用した国際化翻訳プロセスの自動化ツールです。大きなファイルの自動分割、増分更新、OpenAI モデル、API プロキシ、温度のカスタマイズオプションなどの機能をサポートしています。 -- **[💌 Lobe Commit][lobe-commit]:** Lobe Commit は、Langchain/ChatGPT を活用して Gitmoji ベースのコミットメッセージを生成する CLI ツールです。 - -
- -[![][back-to-top]](#readme-top) - -
- ---- - -

📝 License

- -[![][fossa-license-shield]][fossa-license-link] - -
- -Copyright © 2024 [LobeHub][profile-link].
-This project is [Apache 2.0](./LICENSE) licensed. - - - -[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square -[blog]: https://lobehub.com/blog -[changelog]: https://lobehub.com/changelog -[chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg -[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html -[chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg -[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html -[chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk -[chat-plugin-template]: https://github.com/lobehub/chat-plugin-template -[chat-plugins-gateway]: https://github.com/lobehub/chat-plugins-gateway -[codecov-link]: https://codecov.io/gh/lobehub/lobe-chat -[codecov-shield]: https://img.shields.io/codecov/c/github/lobehub/lobe-chat?labelColor=black&style=flat-square&logo=codecov&logoColor=white -[codespaces-link]: https://codespaces.new/lobehub/lobe-chat -[codespaces-shield]: https://github.com/codespaces/badge.svg -[deploy-button-image]: https://vercel.com/button -[deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat -[deploy-on-sealos-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg -[deploy-on-sealos-link]: https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dlobe-chat -[deploy-on-zeabur-button-image]: https://zeabur.com/button.svg -[deploy-on-zeabur-link]: https://zeabur.com/templates/VZGGTI -[discord-link]: https://discord.gg/AYFPHvv2jT -[discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square -[discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge -[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat -[docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square -[docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat -[docker-release-shield]: https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square -[docker-size-link]: https://hub.docker.com/r/lobehub/lobe-chat -[docker-size-shield]: https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square -[docs]: https://lobehub.com/docs/usage/start -[docs-dev-guide]: https://github.com/lobehub/lobe-chat/wiki/index -[docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker -[docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables -[docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market -[docs-feat-auth]: https://lobehub.com/docs/usage/features/auth -[docs-feat-database]: https://lobehub.com/docs/usage/features/database -[docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm -[docs-feat-mobile]: https://lobehub.com/docs/usage/features/mobile -[docs-feat-plugin]: https://lobehub.com/docs/usage/features/plugin-system -[docs-feat-provider]: https://lobehub.com/docs/usage/features/multi-ai-providers -[docs-feat-pwa]: https://lobehub.com/docs/usage/features/pwa -[docs-feat-t2i]: https://lobehub.com/docs/usage/features/text-to-image -[docs-feat-theme]: https://lobehub.com/docs/usage/features/theme -[docs-feat-tts]: https://lobehub.com/docs/usage/features/tts -[docs-feat-vision]: https://lobehub.com/docs/usage/features/vision -[docs-functionc-call]: https://lobehub.com/blog/openai-function-call -[docs-lighthouse]: https://github.com/lobehub/lobe-chat/wiki/Lighthouse -[docs-plugin-dev]: https://lobehub.com/docs/usage/plugins/development -[docs-self-hosting]: https://lobehub.com/docs/self-hosting/start -[docs-upstream-sync]: https://lobehub.com/docs/self-hosting/advanced/upstream-sync -[docs-usage-ollama]: https://lobehub.com/docs/usage/providers/ollama -[docs-usage-plugin]: https://lobehub.com/docs/usage/plugins/basic -[fossa-license-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat -[fossa-license-shield]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat.svg?type=large -[github-action-release-link]: https://github.com/actions/workflows/lobehub/lobe-chat/release.yml -[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/release.yml?label=release&labelColor=black&logo=githubactions&logoColor=white&style=flat-square -[github-action-test-link]: https://github.com/actions/workflows/lobehub/lobe-chat/test.yml -[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square -[github-contributors-link]: https://github.com/lobehub/lobe-chat/graphs/contributors -[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/lobe-chat?color=c4f042&labelColor=black&style=flat-square -[github-forks-link]: https://github.com/lobehub/lobe-chat/network/members -[github-forks-shield]: https://img.shields.io/github/forks/lobehub/lobe-chat?color=8ae8ff&labelColor=black&style=flat-square -[github-issues-link]: https://github.com/lobehub/lobe-chat/issues -[github-issues-shield]: https://img.shields.io/github/issues/lobehub/lobe-chat?color=ff80eb&labelColor=black&style=flat-square -[github-license-link]: https://github.com/lobehub/lobe-chat/blob/main/LICENSE -[github-license-shield]: https://img.shields.io/badge/license-apache%202.0-white?labelColor=black&style=flat-square -[github-project-link]: https://github.com/lobehub/lobe-chat/projects -[github-release-link]: https://github.com/lobehub/lobe-chat/releases -[github-release-shield]: https://img.shields.io/github/v/release/lobehub/lobe-chat?color=369eff&labelColor=black&logo=github&style=flat-square -[github-releasedate-link]: https://github.com/lobehub/lobe-chat/releases -[github-releasedate-shield]: https://img.shields.io/github/release-date/lobehub/lobe-chat?labelColor=black&style=flat-square -[github-stars-link]: https://github.com/lobehub/lobe-chat/network/stargazers -[github-stars-shield]: https://img.shields.io/github/stars/lobehub/lobe-chat?color=ffcb47&labelColor=black&style=flat-square -[github-trending-shield]: https://trendshift.io/api/badge/repositories/2256 -[github-trending-url]: https://trendshift.io/repositories/2256 -[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f -[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png -[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2 -[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9 -[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c -[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp -[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png -[image-feat-privoder]: https://github.com/lobehub/lobe-chat/assets/28616219/b164bc54-8ba2-4c1e-b2f2-f4d7f7e7a551 -[image-feat-pwa]: https://gw.alipayobjects.com/zos/kitchen/69x6bllkX3/pwa.webp -[image-feat-t2i]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png -[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp -[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png -[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png -[image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf -[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855 -[issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat -[lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins -[lobe-commit]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-commit -[lobe-i18n]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-i18n -[lobe-icons-github]: https://github.com/lobehub/lobe-icons -[lobe-icons-link]: https://www.npmjs.com/package/@lobehub/icons -[lobe-icons-shield]: https://img.shields.io/npm/v/@lobehub/icons?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square -[lobe-lint-github]: https://github.com/lobehub/lobe-lint -[lobe-lint-link]: https://www.npmjs.com/package/@lobehub/lint -[lobe-lint-shield]: https://img.shields.io/npm/v/@lobehub/lint?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square -[lobe-midjourney-webui]: https://github.com/lobehub/lobe-midjourney-webui -[lobe-theme]: https://github.com/lobehub/sd-webui-lobe-theme -[lobe-tts-github]: https://github.com/lobehub/lobe-tts -[lobe-tts-link]: https://www.npmjs.com/package/@lobehub/tts -[lobe-tts-shield]: https://img.shields.io/npm/v/@lobehub/tts?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square -[lobe-ui-github]: https://github.com/lobehub/lobe-ui -[lobe-ui-link]: https://www.npmjs.com/package/@lobehub/ui -[lobe-ui-shield]: https://img.shields.io/npm/v/@lobehub/ui?color=369eff&labelColor=black&logo=npm&logoColor=white&style=flat-square -[official-site]: https://lobehub.com -[pr-welcome-link]: https://github.com/lobehub/lobe-chat/pulls -[pr-welcome-shield]: https://img.shields.io/badge/🤯_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge -[profile-link]: https://github.com/lobehub -[share-linkedin-link]: https://linkedin.com/feed -[share-linkedin-shield]: https://img.shields.io/badge/-share%20on%20linkedin-black?labelColor=black&logo=linkedin&logoColor=white&style=flat-square -[share-mastodon-link]: https://mastodon.social/share?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source,%20extensible%20(Function%20Calling),%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT/LLM%20web%20application.%20https://github.com/lobehub/lobe-chat%20#chatbot%20#chatGPT%20#openAI -[share-mastodon-shield]: https://img.shields.io/badge/-share%20on%20mastodon-black?labelColor=black&logo=mastodon&logoColor=white&style=flat-square -[share-reddit-link]: https://www.reddit.com/submit?title=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat -[share-reddit-shield]: https://img.shields.io/badge/-share%20on%20reddit-black?labelColor=black&logo=reddit&logoColor=white&style=flat-square -[share-telegram-link]: https://t.me/share/url"?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat -[share-telegram-shield]: https://img.shields.io/badge/-share%20on%20telegram-black?labelColor=black&logo=telegram&logoColor=white&style=flat-square -[share-weibo-link]: http://service.weibo.com/share/share.php?sharesource=weibo&title=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20%23chatbot%20%23chatGPT%20%23openAI&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat -[share-weibo-shield]: https://img.shields.io/badge/-share%20on%20weibo-black?labelColor=black&logo=sinaweibo&logoColor=white&style=flat-square -[share-whatsapp-link]: https://api.whatsapp.com/send?text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.%20https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat%20%23chatbot%20%23chatGPT%20%23openAI -[share-whatsapp-shield]: https://img.shields.io/badge/-share%20on%20whatsapp-black?labelColor=black&logo=whatsapp&logoColor=white&style=flat-square -[share-x-link]: https://x.com/intent/tweet?hashtags=chatbot%2CchatGPT%2CopenAI&text=Check%20this%20GitHub%20repository%20out%20%F0%9F%A4%AF%20LobeChat%20-%20An%20open-source%2C%20extensible%20%28Function%20Calling%29%2C%20high-performance%20chatbot%20framework.%20It%20supports%20one-click%20free%20deployment%20of%20your%20private%20ChatGPT%2FLLM%20web%20application.&url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat -[share-x-shield]: https://img.shields.io/badge/-share%20on%20x-black?labelColor=black&logo=x&logoColor=white&style=flat-square -[sponsor-link]: https://opencollective.com/lobehub 'Become ❤️ LobeHub Sponsor' -[sponsor-shield]: https://img.shields.io/badge/-Sponsor%20LobeHub-f04f88?logo=opencollective&logoColor=white&style=flat-square -[submit-agents-link]: https://github.com/lobehub/lobe-chat-agents -[submit-agents-shield]: https://img.shields.io/badge/🤖/🏪_submit_agent-%E2%86%92-c4f042?labelColor=black&style=for-the-badge -[submit-plugin-link]: https://github.com/lobehub/lobe-chat-plugins -[submit-plugin-shield]: https://img.shields.io/badge/🧩/🏪_submit_plugin-%E2%86%92-95f3d9?labelColor=black&style=for-the-badge -[vercel-link]: https://chat-preview.lobehub.com -[vercel-shield]: https://img.shields.io/badge/vercel-online-55b467?labelColor=black&logo=vercel&style=flat-square -[vercel-shield-badge]: https://img.shields.io/badge/TRY%20LOBECHAT-ONLINE-55b467?labelColor=black&logo=vercel&style=for-the-badge diff --git a/README.md b/README.md index de4fb22c3133b..605c0c8685ed8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An open-source, modern-design ChatGPT/LLMs UI/Framework.
Supports speech-synthesis, multi-modal, and extensible ([function call][docs-functionc-call]) plugin system.
One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/Ollama chat application. -**English** · [简体中文](./README.zh-CN.md) · [日本語](./README.ja-JP.md) · [Official Site][official-site] · [Changelog][changelog] · [Documents][docs] · [Blog][blog] · [Feedback][github-issues-link] +**English** · [简体中文](./README.zh-CN.md) · [Official Site][official-site] · [Changelog][changelog] · [Documents][docs] · [Blog][blog] · [Feedback][github-issues-link] @@ -52,19 +52,22 @@ One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/ - [👋🏻 Getting Started & Join Our Community](#-getting-started--join-our-community) - [✨ Features](#-features) - - [`1` File Upload/Knowledge Base](#1-file-uploadknowledge-base) - - [`2` Multi-Model Service Provider Support](#2-multi-model-service-provider-support) - - [`3` Local Large Language Model (LLM) Support](#3-local-large-language-model-llm-support) - - [`4` Model Visual Recognition](#4-model-visual-recognition) - - [`5` TTS & STT Voice Conversation](#5-tts--stt-voice-conversation) - - [`6` Text to Image Generation](#6-text-to-image-generation) - - [`7` Plugin System (Function Calling)](#7-plugin-system-function-calling) - - [`8` Agent Market (GPTs)](#8-agent-market-gpts) - - [`9` Support Local / Remote Database](#9-support-local--remote-database) - - [`10` Support Multi-User Management](#10-support-multi-user-management) - - [`11` Progressive Web App (PWA)](#11-progressive-web-app-pwa) - - [`12` Mobile Device Adaptation](#12-mobile-device-adaptation) - - [`13` Custom Themes](#13-custom-themes) + - [`1` Chain of Thought](#1-chain-of-thought) + - [`2` Branching Conversations](#2-branching-conversations) + - [`3` Artifacts Support](#3-artifacts-support) + - [`4` File Upload /Knowledge Base](#4-file-upload-knowledge-base) + - [`5` Multi-Model Service Provider Support](#5-multi-model-service-provider-support) + - [`6` Local Large Language Model (LLM) Support](#6-local-large-language-model-llm-support) + - [`7` Model Visual Recognition](#7-model-visual-recognition) + - [`8` TTS & STT Voice Conversation](#8-tts--stt-voice-conversation) + - [`9` Text to Image Generation](#9-text-to-image-generation) + - [`10` Plugin System (Function Calling)](#10-plugin-system-function-calling) + - [`11` Agent Market (GPTs)](#11-agent-market-gpts) + - [`12` Support Local / Remote Database](#12-support-local--remote-database) + - [`13` Support Multi-User Management](#13-support-multi-user-management) + - [`14` Progressive Web App (PWA)](#14-progressive-web-app-pwa) + - [`15` Mobile Device Adaptation](#15-mobile-device-adaptation) + - [`16` Custom Themes](#16-custom-themes) - [`*` What's more](#-whats-more) - [⚡️ Performance](#️-performance) - [🛳 Self Hosting](#-self-hosting) @@ -111,9 +114,48 @@ Whether for users or professional developers, LobeHub will be your AI Agent play ## ✨ Features +[![][image-feat-cot]][docs-feat-cot] + +### `1` [Chain of Thought][docs-feat-cot] + +Experience AI reasoning like never before. Watch as complex problems unfold step by step through our innovative Chain of Thought (CoT) visualization. This breakthrough feature provides unprecedented transparency into AI's decision-making process, allowing you to observe how conclusions are reached in real-time. + +By breaking down complex reasoning into clear, logical steps, you can better understand and validate the AI's problem-solving approach. Whether you're debugging, learning, or simply curious about AI reasoning, CoT visualization transforms abstract thinking into an engaging, interactive experience. + +[![][back-to-top]](#readme-top) + +[![][image-feat-branch]][docs-feat-branch] + +### `2` [Branching Conversations][docs-feat-branch] + +Introducing a more natural and flexible way to chat with AI. With Branch Conversations, your discussions can flow in multiple directions, just like human conversations do. Create new conversation branches from any message, giving you the freedom to explore different paths while preserving the original context. + +Choose between two powerful modes: + +- **Continuation Mode:** Seamlessly extend your current discussion while maintaining valuable context +- **Standalone Mode:** Start fresh with a new topic based on any previous message + +This groundbreaking feature transforms linear conversations into dynamic, tree-like structures, enabling deeper exploration of ideas and more productive interactions. + +[![][back-to-top]](#readme-top) + +[![][image-feat-artifacts]][docs-feat-artifacts] + +### `3` [Artifacts Support][docs-feat-artifacts] + +Experience the power of Claude Artifacts, now integrated into LobeChat. This revolutionary feature expands the boundaries of AI-human interaction, enabling real-time creation and visualization of diverse content formats. + +Create and visualize with unprecedented flexibility: + +- Generate and display dynamic SVG graphics +- Build and render interactive HTML pages in real-time +- Produce professional documents in multiple formats + +[![][back-to-top]](#readme-top) + [![][image-feat-knowledgebase]][docs-feat-knowledgebase] -### `1` [File Upload/Knowledge Base][docs-feat-knowledgebase] +### `4` [File Upload /Knowledge Base][docs-feat-knowledgebase] LobeChat supports file upload and knowledge base functionality. You can upload various types of files including documents, images, audio, and video, as well as create knowledge bases, making it convenient for users to manage and search for files. Additionally, you can utilize files and knowledge base features during conversations, enabling a richer dialogue experience. @@ -131,7 +173,7 @@ LobeChat supports file upload and knowledge base functionality. You can upload v [![][image-feat-privoder]][docs-feat-provider] -### `2` [Multi-Model Service Provider Support][docs-feat-provider] +### `5` [Multi-Model Service Provider Support][docs-feat-provider] In the continuous development of LobeChat, we deeply understand the importance of diversity in model service providers for meeting the needs of the community when providing AI conversation services. Therefore, we have expanded our support to multiple model service providers, rather than being limited to a single one, in order to offer users a more diverse and rich selection of conversations. @@ -168,20 +210,20 @@ We have implemented support for the following model service providers: - **[Qwen](https://lobechat.com/discover/provider/qwen)**: Tongyi Qianwen is a large-scale language model independently developed by Alibaba Cloud, featuring strong natural language understanding and generation capabilities. It can answer various questions, create written content, express opinions, and write code, playing a role in multiple fields. - **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: An enterprise-level one-stop platform for large model and AI-native application development and services, providing the most comprehensive and user-friendly toolchain for the entire process of generative artificial intelligence model development and application development. - **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: A large language model developed by Tencent, equipped with powerful Chinese creative capabilities, logical reasoning abilities in complex contexts, and reliable task execution skills. -- **[Spark](https://lobechat.com/discover/provider/spark)**: iFlytek's Spark model provides powerful AI capabilities across multiple domains and languages, utilizing advanced natural language processing technology to build innovative applications suitable for smart hardware, smart healthcare, smart finance, and other vertical scenarios. - **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: Zhipu AI offers an open platform for multimodal and language models, supporting a wide range of AI application scenarios, including text processing, image understanding, and programming assistance. +- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow is dedicated to accelerating AGI for the benefit of humanity, enhancing large-scale AI efficiency through an easy-to-use and cost-effective GenAI stack. - **[01.AI](https://lobechat.com/discover/provider/zeroone)**: 01.AI focuses on AI 2.0 era technologies, vigorously promoting the innovation and application of 'human + artificial intelligence', using powerful models and advanced AI technologies to enhance human productivity and achieve technological empowerment. +- **[Spark](https://lobechat.com/discover/provider/spark)**: iFlytek's Spark model provides powerful AI capabilities across multiple domains and languages, utilizing advanced natural language processing technology to build innovative applications suitable for smart hardware, smart healthcare, smart finance, and other vertical scenarios. - **[SenseNova](https://lobechat.com/discover/provider/sensenova)**: SenseNova, backed by SenseTime's robust infrastructure, offers efficient and user-friendly full-stack large model services. - **[Stepfun](https://lobechat.com/discover/provider/stepfun)**: StepFun's large model possesses industry-leading multimodal and complex reasoning capabilities, supporting ultra-long text understanding and powerful autonomous scheduling search engine functions. - **[Moonshot](https://lobechat.com/discover/provider/moonshot)**: Moonshot is an open-source platform launched by Beijing Dark Side Technology Co., Ltd., providing various natural language processing models with a wide range of applications, including but not limited to content creation, academic research, intelligent recommendations, and medical diagnosis, supporting long text processing and complex generation tasks. - **[Baichuan](https://lobechat.com/discover/provider/baichuan)**: Baichuan Intelligence is a company focused on the research and development of large AI models, with its models excelling in domestic knowledge encyclopedias, long text processing, and generative creation tasks in Chinese, surpassing mainstream foreign models. Baichuan Intelligence also possesses industry-leading multimodal capabilities, performing excellently in multiple authoritative evaluations. Its models include Baichuan 4, Baichuan 3 Turbo, and Baichuan 3 Turbo 128k, each optimized for different application scenarios, providing cost-effective solutions. - **[Minimax](https://lobechat.com/discover/provider/minimax)**: MiniMax is a general artificial intelligence technology company established in 2021, dedicated to co-creating intelligence with users. MiniMax has independently developed general large models of different modalities, including trillion-parameter MoE text models, voice models, and image models, and has launched applications such as Conch AI. -- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI is an AI model and service platform launched by 360 Company, offering various advanced natural language processing models, including 360GPT2 Pro, 360GPT Pro, 360GPT Turbo, and 360GPT Turbo Responsibility 8K. These models combine large-scale parameters and multimodal capabilities, widely applied in text generation, semantic understanding, dialogue systems, and code generation. With flexible pricing strategies, 360 AI meets diverse user needs, supports developer integration, and promotes the innovation and development of intelligent applications. -- **[Taichu](https://lobechat.com/discover/provider/taichu)**: The Institute of Automation, Chinese Academy of Sciences, and Wuhan Artificial Intelligence Research Institute have launched a new generation of multimodal large models, supporting comprehensive question-answering tasks such as multi-turn Q\&A, text creation, image generation, 3D understanding, and signal analysis, with stronger cognitive, understanding, and creative abilities, providing a new interactive experience. - **[InternLM](https://lobechat.com/discover/provider/internlm)**: An open-source organization dedicated to the research and development of large model toolchains. It provides an efficient and user-friendly open-source platform for all AI developers, making cutting-edge large models and algorithm technologies easily accessible. -- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconFlow is dedicated to accelerating AGI for the benefit of humanity, enhancing large-scale AI efficiency through an easy-to-use and cost-effective GenAI stack. - **[Higress](https://lobechat.com/discover/provider/higress)**: Higress is a cloud-native API gateway that was developed internally at Alibaba to address the issues of Tengine reload affecting long-lived connections and the insufficient load balancing capabilities for gRPC/Dubbo. - **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI's Serverless API provides AI developers with an out of the box large model inference API service. +- **[Taichu](https://lobechat.com/discover/provider/taichu)**: The Institute of Automation, Chinese Academy of Sciences, and Wuhan Artificial Intelligence Research Institute have launched a new generation of multimodal large models, supporting comprehensive question-answering tasks such as multi-turn Q\&A, text creation, image generation, 3D understanding, and signal analysis, with stronger cognitive, understanding, and creative abilities, providing a new interactive experience. +- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI is an AI model and service platform launched by 360 Company, offering various advanced natural language processing models, including 360GPT2 Pro, 360GPT Pro, 360GPT Turbo, and 360GPT Turbo Responsibility 8K. These models combine large-scale parameters and multimodal capabilities, widely applied in text generation, semantic understanding, dialogue systems, and code generation. With flexible pricing strategies, 360 AI meets diverse user needs, supports developer integration, and promotes the innovation and development of intelligent applications. @@ -199,7 +241,7 @@ At the same time, we are also planning to support more model service providers. [![][image-feat-local]][docs-feat-local] -### `3` [Local Large Language Model (LLM) Support][docs-feat-local] +### `6` [Local Large Language Model (LLM) Support][docs-feat-local] To meet the specific needs of users, LobeChat also supports the use of local models based on [Ollama](https://ollama.ai), allowing users to flexibly use their own or third-party models. @@ -215,7 +257,7 @@ To meet the specific needs of users, LobeChat also supports the use of local mod [![][image-feat-vision]][docs-feat-vision] -### `4` [Model Visual Recognition][docs-feat-vision] +### `7` [Model Visual Recognition][docs-feat-vision] LobeChat now supports OpenAI's latest [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision) model with visual recognition capabilities, a multimodal intelligence that can perceive visuals. Users can easily upload or drag and drop images into the dialogue box, @@ -233,7 +275,7 @@ Whether it's sharing images in daily use or interpreting images within specific [![][image-feat-tts]][docs-feat-tts] -### `5` [TTS & STT Voice Conversation][docs-feat-tts] +### `8` [TTS & STT Voice Conversation][docs-feat-tts] LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, enabling our application to convert text messages into clear voice outputs, allowing users to interact with our conversational agent as if they were talking to a real person. Users can choose from a variety of voices to pair with the agent. @@ -250,7 +292,7 @@ Users can choose the voice that suits their personal preferences or specific sce [![][image-feat-t2i]][docs-feat-t2i] -### `6` [Text to Image Generation][docs-feat-t2i] +### `9` [Text to Image Generation][docs-feat-t2i] With support for the latest text-to-image generation technology, LobeChat now allows users to invoke image creation tools directly within conversations with the agent. By leveraging the capabilities of AI tools such as [`DALL-E 3`](https://openai.com/dall-e-3), [`MidJourney`](https://www.midjourney.com/), and [`Pollinations`](https://pollinations.ai/), the agents are now equipped to transform your ideas into images. @@ -264,7 +306,7 @@ This enables a more private and immersive creative process, allowing for the sea [![][image-feat-plugin]][docs-feat-plugin] -### `7` [Plugin System (Function Calling)][docs-feat-plugin] +### `10` [Plugin System (Function Calling)][docs-feat-plugin] The plugin ecosystem of LobeChat is an important extension of its core functionality, greatly enhancing the practicality and flexibility of the LobeChat assistant. @@ -280,12 +322,12 @@ In addition, these plugins are not limited to news aggregation, but can also ext -| Recent Submits | Description | -| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)
By **mintbase** on **2024-12-31** | Find any NFT data on the NEAR Protocol.
`crypto` `nft` | -| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)
By **portfoliometa** on **2024-12-22** | Analyze stocks and get comprehensive real-time investment data and analytics.
`stock` | -| [Google CSE](https://lobechat.com/discover/plugin/google-cse)
By **vsnthdev** on **2024-12-02** | Searches Google through their official CSE API.
`web` `search` | -| [Speak](https://lobechat.com/discover/plugin/speak)
By **speak** on **2024-12-02** | Learn how to say anything in another language with Speak, your AI-powered language tutor.
`education` `language` | +| Recent Submits | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| [Web](https://lobechat.com/discover/plugin/web)
By **Proghit** on **2025-01-24** | Smart web search that reads and analyzes pages to deliver comprehensive answers from Google results.
`web` `search` | +| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)
By **mintbase** on **2024-12-31** | Find any NFT data on the NEAR Protocol.
`crypto` `nft` | +| [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)
By **FineHow** on **2024-12-22** | Search for information from the internet base BingApi
`bingsearch` | +| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)
By **portfoliometa** on **2024-12-22** | Analyze stocks and get comprehensive real-time investment data and analytics.
`stock` | > 📊 Total plugins: [**48**](https://lobechat.com/discover/plugins) @@ -299,7 +341,7 @@ In addition, these plugins are not limited to news aggregation, but can also ext [![][image-feat-agent]][docs-feat-agent] -### `8` [Agent Market (GPTs)][docs-feat-agent] +### `11` [Agent Market (GPTs)][docs-feat-agent] In LobeChat Agent Marketplace, creators can discover a vibrant and innovative community that brings together a multitude of well-designed agents, which not only play an important role in work scenarios but also offer great convenience in learning processes. @@ -319,14 +361,14 @@ Our marketplace is not just a showcase platform but also a collaborative space. -| Recent Submits | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [System Instruction Expert](https://lobechat.com/discover/assistant/instructer)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-12-04** | Skilled in refining and generating efficient system instructions
`system-instructions` `writing` `detail-optimization` `user-needs` | -| [Japanese Memory Helper](https://lobechat.com/discover/assistant/japan-language-helper)
By **[sharkbear212](https://github.com/sharkbear212)** on **2024-12-04** | Specializes in Japanese Hiragana, Katakana, vocabulary, and memory techniques for explanations and phrases
`explanation` `memory-techniques` `japanese-teaching` | -| [Poetry Card Designer](https://lobechat.com/discover/assistant/poetry-card-designer)
By **[lianxin255](https://github.com/lianxin255)** on **2024-12-03** | Skilled in designing poetry cards to enhance artistic sense and appeal
`poetry-card-design` `card` `creativity` `artistic-expression` | -| [Daily Doctor](https://lobechat.com/discover/assistant/yunchat-docter)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30** | Specializes in surgical diagnosis and personalized health management
`general-medicine` `surgery` `health-consultation` `personalized-treatment` `medical-education` | +| Recent Submits | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Xiao Zhi French Translation Assistant](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)
By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10** | A friendly, professional, and empathetic AI assistant for French translation
`ai-assistant` `french-translation` `cross-cultural-communication` `creativity` | +| [Astrology Researcher](https://lobechat.com/discover/assistant/fate-researcher)
By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06** | Expert in BaZi astrology
`astrology` `ba-zi` `traditional-culture` | +| [Language Charm Learning Mentor](https://lobechat.com/discover/assistant/bad-language-helper)
By **[Guducat](https://github.com/Guducat)** on **2025-02-06** | Specializes in teaching the charm of language and witty responses
`language-learning` `dialogue-examples` | +| [Allinone](https://lobechat.com/discover/assistant/allinone-v-1)
By **[AXuanCreator](https://github.com/AXuanCreator)** on **2025-02-06** | Innovation · Future · Excellence
`programming` `low-cost` `concise-answers` | -> 📊 Total agents: [**453** ](https://lobechat.com/discover/assistants) +> 📊 Total agents: [**486** ](https://lobechat.com/discover/assistants) @@ -338,7 +380,7 @@ Our marketplace is not just a showcase platform but also a collaborative space. [![][image-feat-database]][docs-feat-database] -### `9` [Support Local / Remote Database][docs-feat-database] +### `12` [Support Local / Remote Database][docs-feat-database] LobeChat supports the use of both server-side and local databases. Depending on your needs, you can choose the appropriate deployment solution: @@ -355,7 +397,7 @@ Regardless of which database you choose, LobeChat can provide you with an excell [![][image-feat-auth]][docs-feat-auth] -### `10` [Support Multi-User Management][docs-feat-auth] +### `13` [Support Multi-User Management][docs-feat-auth] LobeChat supports multi-user management and provides two main user authentication and management solutions to meet different needs: @@ -373,7 +415,7 @@ Regardless of which user management solution you choose, LobeChat can provide yo [![][image-feat-pwa]][docs-feat-pwa] -### `11` [Progressive Web App (PWA)][docs-feat-pwa] +### `14` [Progressive Web App (PWA)][docs-feat-pwa] We deeply understand the importance of providing a seamless experience for users in today's multi-device environment. Therefore, we have adopted Progressive Web Application ([PWA](https://support.google.com/chrome/answer/9658361)) technology, @@ -400,7 +442,7 @@ providing smooth animations, responsive layouts, and adapting to different devic [![][image-feat-mobile]][docs-feat-mobile] -### `12` [Mobile Device Adaptation][docs-feat-mobile] +### `15` [Mobile Device Adaptation][docs-feat-mobile] We have carried out a series of optimization designs for mobile devices to enhance the user's mobile experience. Currently, we are iterating on the mobile user experience to achieve smoother and more intuitive interactions. If you have any suggestions or ideas, we welcome you to provide feedback through GitHub Issues or Pull Requests. @@ -412,7 +454,7 @@ We have carried out a series of optimization designs for mobile devices to enhan [![][image-feat-theme]][docs-feat-theme] -### `13` [Custom Themes][docs-feat-theme] +### `16` [Custom Themes][docs-feat-theme] As a design-engineering-oriented application, LobeChat places great emphasis on users' personalized experiences, hence introducing flexible and diverse theme modes, including a light mode for daytime and a dark mode for nighttime. @@ -762,7 +804,10 @@ This project is [Apache 2.0](./LICENSE) licensed. [docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker [docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables [docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market +[docs-feat-artifacts]: https://lobehub.com/docs/usage/features/artifacts [docs-feat-auth]: https://lobehub.com/docs/usage/features/auth +[docs-feat-branch]: https://lobehub.com/docs/usage/features/branching-conversations +[docs-feat-cot]: https://lobehub.com/docs/usage/features/cot [docs-feat-database]: https://lobehub.com/docs/usage/features/database [docs-feat-knowledgebase]: https://lobehub.com/blog/knowledge-base [docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm @@ -804,22 +849,25 @@ This project is [Apache 2.0](./LICENSE) licensed. [github-stars-shield]: https://img.shields.io/github/stars/lobehub/lobe-chat?color=ffcb47&labelColor=black&style=flat-square [github-trending-shield]: https://trendshift.io/api/badge/repositories/2256 [github-trending-url]: https://trendshift.io/repositories/2256 -[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f -[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png -[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2 -[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9 -[image-feat-knowledgebase]: https://github.com/user-attachments/assets/77e58e1c-c82f-4341-b159-f4eeede9967f -[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c -[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp -[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png -[image-feat-privoder]: https://github.com/lobehub/lobe-chat/assets/28616219/b164bc54-8ba2-4c1e-b2f2-f4d7f7e7a551 -[image-feat-pwa]: https://gw.alipayobjects.com/zos/kitchen/69x6bllkX3/pwa.webp -[image-feat-t2i]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png -[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp -[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png -[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png +[image-banner]: https://github.com/user-attachments/assets/6f293c7f-47b4-47eb-9202-fe68a942d35b +[image-feat-agent]: https://github.com/user-attachments/assets/b3ab6e35-4fbc-468d-af10-e3e0c687350f +[image-feat-artifacts]: https://github.com/user-attachments/assets/7f95fad6-b210-4e6e-84a0-7f39e96f3a00 +[image-feat-auth]: https://github.com/user-attachments/assets/80bb232e-19d1-4f97-98d6-e291f3585e6d +[image-feat-branch]: https://github.com/user-attachments/assets/92f72082-02bd-4835-9c54-b089aad7fd41 +[image-feat-cot]: https://github.com/user-attachments/assets/f74f1139-d115-4e9c-8c43-040a53797a5e +[image-feat-database]: https://github.com/user-attachments/assets/f1697c8b-d1fb-4dac-ba05-153c6295d91d +[image-feat-knowledgebase]: https://github.com/user-attachments/assets/7da7a3b2-92fd-4630-9f4e-8560c74955ae +[image-feat-local]: https://github.com/user-attachments/assets/1239da50-d832-4632-a7ef-bd754c0f3850 +[image-feat-mobile]: https://github.com/user-attachments/assets/32cf43c4-96bd-4a4c-bfb6-59acde6fe380 +[image-feat-plugin]: https://github.com/user-attachments/assets/66a891ac-01b6-4e3f-b978-2eb07b489b1b +[image-feat-privoder]: https://github.com/user-attachments/assets/e553e407-42de-4919-977d-7dbfcf44a821 +[image-feat-pwa]: https://github.com/user-attachments/assets/9647f70f-b71b-43b6-9564-7cdd12d1c24d +[image-feat-t2i]: https://github.com/user-attachments/assets/708274a7-2458-494b-a6ec-b73dfa1fa7c2 +[image-feat-theme]: https://github.com/user-attachments/assets/b47c39f1-806f-492b-8fcb-b0fa973937c1 +[image-feat-tts]: https://github.com/user-attachments/assets/50189597-2cc3-4002-b4c8-756a52ad5c0a +[image-feat-vision]: https://github.com/user-attachments/assets/18574a1f-46c2-4cbc-af2c-35a86e128a07 [image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf -[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855 +[image-star]: https://github.com/user-attachments/assets/c3b482e7-cef5-4e94-bef9-226900ecfaab [issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat [lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins [lobe-commit]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-commit diff --git a/README.zh-CN.md b/README.zh-CN.md index 088d220077b32..4a56b26a81781 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -8,7 +8,7 @@ 支持语音合成、多模态、可扩展的([function call][docs-functionc-call])插件系统
一键**免费**拥有你自己的 ChatGPT/Gemini/Claude/Ollama 应用 -[English](./README.md) · **简体中文** · [日本語](./README.ja-JP.md) · [官网][official-site] · [更新日志][changelog] · [文档][docs] · [博客][blog] · [反馈问题][github-issues-link] +[English](./README.md) · **简体中文** · [官网][official-site] · [更新日志][changelog] · [文档][docs] · [博客][blog] · [反馈问题][github-issues-link] @@ -52,20 +52,23 @@ - [👋🏻 开始使用 & 交流](#-开始使用--交流) - [✨ 特性一览](#-特性一览) - - [`1` 文件上传 / 知识库](#1-文件上传--知识库) - - [`2` 多模型服务商支持](#2-多模型服务商支持) - - [`3` 支持本地大语言模型 (LLM)](#3-支持本地大语言模型-llm) - - [`4` 模型视觉识别 (Model Visual)](#4-模型视觉识别-model-visual) - - [`5` TTS & STT 语音会话](#5-tts--stt-语音会话) - - [`6` Text to Image 文生图](#6-text-to-image-文生图) - - [`7` 插件系统 (Tools Calling)](#7-插件系统-tools-calling) - - [`8` 助手市场 (GPTs)](#8-助手市场-gpts) - - [`9` 支持本地 / 远程数据库](#9-支持本地--远程数据库) - - [`10` 支持多用户管理](#10-支持多用户管理) - - [`11` 渐进式 Web 应用 (PWA)](#11-渐进式-web-应用-pwa) - - [`12` 移动设备适配](#12-移动设备适配) - - [`13` 自定义主题](#13-自定义主题) - - [更多特性](#更多特性) + - [`1` 思维链 (CoT)](#1-思维链-cot) + - [`2` 分支对话](#2-分支对话) + - [`3` 支持白板 (Artifacts)](#3-支持白板-artifacts) + - [`4` 文件上传 / 知识库](#4-文件上传--知识库) + - [`5` 多模型服务商支持](#5-多模型服务商支持) + - [`6` 支持本地大语言模型 (LLM)](#6-支持本地大语言模型-llm) + - [`7` 模型视觉识别 (Model Visual)](#7-模型视觉识别-model-visual) + - [`8` TTS & STT 语音会话](#8-tts--stt-语音会话) + - [`9` Text to Image 文生图](#9-text-to-image-文生图) + - [`10` 插件系统 (Tools Calling)](#10-插件系统-tools-calling) + - [`11` 助手市场 (GPTs)](#11-助手市场-gpts) + - [`12` 支持本地 / 远程数据库](#12-支持本地--远程数据库) + - [`13` 支持多用户管理](#13-支持多用户管理) + - [`14` 渐进式 Web 应用 (PWA)](#14-渐进式-web-应用-pwa) + - [`15` 移动设备适配](#15-移动设备适配) + - [`16` 自定义主题](#16-自定义主题) + - [`*` 更多特性](#-更多特性) - [⚡️ 性能测试](#️-性能测试) - [🛳 开箱即用](#-开箱即用) - [`A` 使用 Vercel、Zeabur 、Sealos 或 阿里云计算巢 部署](#a-使用-vercelzeabur-sealos-或-阿里云计算巢-部署) @@ -111,9 +114,48 @@ ## ✨ 特性一览 +[![][image-feat-cot]][docs-feat-cot] + +### `1` [思维链 (CoT)][docs-feat-cot] + +体验前所未有的 AI 推理过程。通过创新的思维链(CoT)可视化功能,您可以实时观察复杂问题是如何一步步被解析的。这项突破性的功能为 AI 的决策过程提供了前所未有的透明度,让您能够清晰地了解结论是如何得出的。 + +通过将复杂的推理过程分解为清晰的逻辑步骤,您可以更好地理解和验证 AI 的解题思路。无论您是在调试问题、学习知识,还是单纯对 AI 推理感兴趣,思维链可视化都能将抽象思维转化为一种引人入胜的互动体验。 + +[![][back-to-top]](#readme-top) + +[![][image-feat-branch]][docs-feat-branch] + +### `2` [分支对话][docs-feat-branch] + +为您带来更自然、更灵活的 AI 对话方式。通过分支对话功能,您的讨论可以像人类对话一样自然延伸。在任意消息处创建新的对话分支,让您在保留原有上下文的同时,自由探索不同的对话方向。 + +两种强大模式任您选择: + +- **延续模式**:无缝延展当前讨论,保持宝贵的对话上下文 +- **独立模式**:基于任意历史消息,开启全新话题探讨 + +这项突破性功能将线性对话转变为动态的树状结构,让您能够更深入地探索想法,实现更高效的互动体验。 + +[![][back-to-top]](#readme-top) + +[![][image-feat-artifacts]][docs-feat-artifacts] + +### `3` [支持白板 (Artifacts)][docs-feat-artifacts] + +体验集成于 LobeChat 的 Claude Artifacts 能力。这项革命性功能突破了 AI 人机交互的边界,让您能够实时创建和可视化各种格式的内容。 + +以前所未有的灵活度进行创作与可视化: + +- 生成并展示动态 SVG 图形 +- 实时构建与渲染交互式 HTML 页面 +- 输出多种格式的专业文档 + +[![][back-to-top]](#readme-top) + [![][image-feat-knowledgebase]][docs-feat-knowledgebase] -### `1` [文件上传 / 知识库][docs-feat-knowledgebase] +### `4` [文件上传 / 知识库][docs-feat-knowledgebase] LobeChat 支持文件上传与知识库功能,你可以上传文件、图片、音频、视频等多种类型的文件,以及创建知识库,方便用户管理和查找文件。同时在对话中使用文件和知识库功能,实现更加丰富的对话体验。 @@ -131,7 +173,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片 [![][image-feat-privoder]][docs-feat-provider] -### `2` [多模型服务商支持][docs-feat-provider] +### `5` [多模型服务商支持][docs-feat-provider] 在 LobeChat 的不断发展过程中,我们深刻理解到在提供 AI 会话服务时模型服务商的多样性对于满足社区需求的重要性。因此,我们不再局限于单一的模型服务商,而是拓展了对多种模型服务商的支持,以便为用户提供更为丰富和多样化的会话选择。 @@ -168,20 +210,20 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片 - **[Qwen](https://lobechat.com/discover/provider/qwen)**: 通义千问是阿里云自主研发的超大规模语言模型,具有强大的自然语言理解和生成能力。它可以回答各种问题、创作文字内容、表达观点看法、撰写代码等,在多个领域发挥作用。 - **[Wenxin](https://lobechat.com/discover/provider/wenxin)**: 企业级一站式大模型与 AI 原生应用开发及服务平台,提供最全面易用的生成式人工智能模型开发、应用开发全流程工具链 - **[Hunyuan](https://lobechat.com/discover/provider/hunyuan)**: 由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力 -- **[Spark](https://lobechat.com/discover/provider/spark)**: 科大讯飞星火大模型提供多领域、多语言的强大 AI 能力,利用先进的自然语言处理技术,构建适用于智能硬件、智慧医疗、智慧金融等多种垂直场景的创新应用。 - **[ZhiPu](https://lobechat.com/discover/provider/zhipu)**: 智谱 AI 提供多模态与语言模型的开放平台,支持广泛的 AI 应用场景,包括文本处理、图像理解与编程辅助等。 +- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconCloud,基于优秀开源基础模型的高性价比 GenAI 云服务 - **[01.AI](https://lobechat.com/discover/provider/zeroone)**: 零一万物致力于推动以人为本的 AI 2.0 技术革命,旨在通过大语言模型创造巨大的经济和社会价值,并开创新的 AI 生态与商业模式。 +- **[Spark](https://lobechat.com/discover/provider/spark)**: 科大讯飞星火大模型提供多领域、多语言的强大 AI 能力,利用先进的自然语言处理技术,构建适用于智能硬件、智慧医疗、智慧金融等多种垂直场景的创新应用。 - **[SenseNova](https://lobechat.com/discover/provider/sensenova)**: 商汤日日新,依托商汤大装置的强大的基础支撑,提供高效易用的全栈大模型服务。 - **[Stepfun](https://lobechat.com/discover/provider/stepfun)**: 阶级星辰大模型具备行业领先的多模态及复杂推理能力,支持超长文本理解和强大的自主调度搜索引擎功能。 - **[Moonshot](https://lobechat.com/discover/provider/moonshot)**: Moonshot 是由北京月之暗面科技有限公司推出的开源平台,提供多种自然语言处理模型,应用领域广泛,包括但不限于内容创作、学术研究、智能推荐、医疗诊断等,支持长文本处理和复杂生成任务。 - **[Baichuan](https://lobechat.com/discover/provider/baichuan)**: 百川智能是一家专注于人工智能大模型研发的公司,其模型在国内知识百科、长文本处理和生成创作等中文任务上表现卓越,超越了国外主流模型。百川智能还具备行业领先的多模态能力,在多项权威评测中表现优异。其模型包括 Baichuan 4、Baichuan 3 Turbo 和 Baichuan 3 Turbo 128k 等,分别针对不同应用场景进行优化,提供高性价比的解决方案。 - **[Minimax](https://lobechat.com/discover/provider/minimax)**: MiniMax 是 2021 年成立的通用人工智能科技公司,致力于与用户共创智能。MiniMax 自主研发了不同模态的通用大模型,其中包括万亿参数的 MoE 文本大模型、语音大模型以及图像大模型。并推出了海螺 AI 等应用。 -- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI 是 360 公司推出的 AI 模型和服务平台,提供多种先进的自然语言处理模型,包括 360GPT2 Pro、360GPT Pro、360GPT Turbo 和 360GPT Turbo Responsibility 8K。这些模型结合了大规模参数和多模态能力,广泛应用于文本生成、语义理解、对话系统与代码生成等领域。通过灵活的定价策略,360 AI 满足多样化用户需求,支持开发者集成,推动智能化应用的革新和发展。 -- **[Taichu](https://lobechat.com/discover/provider/taichu)**: 中科院自动化研究所和武汉人工智能研究院推出新一代多模态大模型,支持多轮问答、文本创作、图像生成、3D 理解、信号分析等全面问答任务,拥有更强的认知、理解、创作能力,带来全新互动体验。 - **[InternLM](https://lobechat.com/discover/provider/internlm)**: 致力于大模型研究与开发工具链的开源组织。为所有 AI 开发者提供高效、易用的开源平台,让最前沿的大模型与算法技术触手可及 -- **[SiliconCloud](https://lobechat.com/discover/provider/siliconcloud)**: SiliconCloud,基于优秀开源基础模型的高性价比 GenAI 云服务 - **[Higress](https://lobechat.com/discover/provider/higress)**: Higress 是一款云原生 API 网关,在阿里内部为解决 Tengine reload 对长连接业务有损,以及 gRPC/Dubbo 负载均衡能力不足而诞生。 - **[Gitee AI](https://lobechat.com/discover/provider/giteeai)**: Gitee AI 的 Serverless API 为 AI 开发者提供开箱即用的大模型推理 API 服务。 +- **[Taichu](https://lobechat.com/discover/provider/taichu)**: 中科院自动化研究所和武汉人工智能研究院推出新一代多模态大模型,支持多轮问答、文本创作、图像生成、3D 理解、信号分析等全面问答任务,拥有更强的认知、理解、创作能力,带来全新互动体验。 +- **[360 AI](https://lobechat.com/discover/provider/ai360)**: 360 AI 是 360 公司推出的 AI 模型和服务平台,提供多种先进的自然语言处理模型,包括 360GPT2 Pro、360GPT Pro、360GPT Turbo 和 360GPT Turbo Responsibility 8K。这些模型结合了大规模参数和多模态能力,广泛应用于文本生成、语义理解、对话系统与代码生成等领域。通过灵活的定价策略,360 AI 满足多样化用户需求,支持开发者集成,推动智能化应用的革新和发展。 @@ -189,7 +231,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片 -同时,我们也在计划支持更多的模型服务商,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的 [💬 社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。 +同时,我们也在计划支持更多的模型服务商,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的 [💬 社区讨论](https://github.com/lobehub/lobe-chat/discussions/6157)。
@@ -199,7 +241,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片 [![][image-feat-local]][docs-feat-local] -### `3` [支持本地大语言模型 (LLM)][docs-feat-local] +### `6` [支持本地大语言模型 (LLM)][docs-feat-local] 为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型。 @@ -215,7 +257,7 @@ LobeChat 支持文件上传与知识库功能,你可以上传文件、图片 [![][image-feat-vision]][docs-feat-vision] -### `4` [模型视觉识别 (Model Visual)][docs-feat-vision] +### `7` [模型视觉识别 (Model Visual)][docs-feat-vision] LobeChat 已经支持 OpenAI 最新的 [`gpt-4-vision`](https://platform.openai.com/docs/guides/vision) 支持视觉识别的模型,这是一个具备视觉识别能力的多模态应用。 用户可以轻松上传图片或者拖拽图片到对话框中,助手将能够识别图片内容,并在此基础上进行智能对话,构建更智能、更多元化的聊天场景。 @@ -230,7 +272,7 @@ LobeChat 已经支持 OpenAI 最新的 [`gpt-4-vision`](https://platform.openai. [![][image-feat-tts]][docs-feat-tts] -### `5` [TTS & STT 语音会话][docs-feat-tts] +### `8` [TTS & STT 语音会话][docs-feat-tts] LobeChat 支持文字转语音(Text-to-Speech,TTS)和语音转文字(Speech-to-Text,STT)技术,这使得我们的应用能够将文本信息转化为清晰的语音输出,用户可以像与真人交谈一样与我们的对话助手进行交流。 用户可以从多种声音中选择,给助手搭配合适的音源。 同时,对于那些倾向于听觉学习或者想要在忙碌中获取信息的用户来说,TTS 提供了一个极佳的解决方案。 @@ -245,7 +287,7 @@ LobeChat 支持文字转语音(Text-to-Speech,TTS)和语音转文字(Spe [![][image-feat-t2i]][docs-feat-t2i] -### `6` [Text to Image 文生图][docs-feat-t2i] +### `9` [Text to Image 文生图][docs-feat-t2i] 支持最新的文本到图片生成技术,LobeChat 现在能够让用户在与助手对话中直接调用文生图工具进行创作。 通过利用 [`DALL-E 3`](https://openai.com/dall-e-3)、[`MidJourney`](https://www.midjourney.com/) 和 [`Pollinations`](https://pollinations.ai/) 等 AI 工具的能力, 助手们现在可以将你的想法转化为图像。 @@ -259,7 +301,7 @@ LobeChat 支持文字转语音(Text-to-Speech,TTS)和语音转文字(Spe [![][image-feat-plugin]][docs-feat-plugin] -### `7` [插件系统 (Tools Calling)][docs-feat-plugin] +### `10` [插件系统 (Tools Calling)][docs-feat-plugin] LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地增强了 ChatGPT 的实用性和灵活性。 @@ -273,12 +315,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地 -| 最近新增 | 描述 | -| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)
By **mintbase** on **2024-12-31** | 在 NEAR 协议上查找任何 NFT 数据。
`加密货币` `nft` | -| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)
By **portfoliometa** on **2024-12-22** | 分析股票并获取全面的实时投资数据和分析。
`股票` | -| [谷歌自定义搜索引擎](https://lobechat.com/discover/plugin/google-cse)
By **vsnthdev** on **2024-12-02** | 通过他们的官方自定义搜索引擎 API 搜索谷歌。
`网络` `搜索` | -| [Speak](https://lobechat.com/discover/plugin/speak)
By **speak** on **2024-12-02** | 使用 Speak,您的 AI 语言导师,学习如何用另一种语言说任何事情。
`教育` `语言` | +| 最近新增 | 描述 | +| -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| [网页](https://lobechat.com/discover/plugin/web)
By **Proghit** on **2025-01-24** | 智能网页搜索,读取和分析页面,以提供来自 Google 结果的全面答案。
`网页` `搜索` | +| [MintbaseSearch](https://lobechat.com/discover/plugin/mintbasesearch)
By **mintbase** on **2024-12-31** | 在 NEAR 协议上查找任何 NFT 数据。
`加密货币` `nft` | +| [必应网页搜索](https://lobechat.com/discover/plugin/Bingsearch-identifier)
By **FineHow** on **2024-12-22** | 通过 BingApi 搜索互联网上的信息
`bingsearch` | +| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)
By **portfoliometa** on **2024-12-22** | 分析股票并获取全面的实时投资数据和分析。
`股票` | > 📊 Total plugins: [**48**](https://lobechat.com/discover/plugins) @@ -292,7 +334,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地 [![][image-feat-agent]][docs-feat-agent] -### `8` [助手市场 (GPTs)][docs-feat-agent] +### `11` [助手市场 (GPTs)][docs-feat-agent] 在 LobeChat 的助手市场中,创作者们可以发现一个充满活力和创新的社区,它汇聚了众多精心设计的助手,这些助手不仅在工作场景中发挥着重要作用,也在学习过程中提供了极大的便利。 我们的市场不仅是一个展示平台,更是一个协作的空间。在这里,每个人都可以贡献自己的智慧,分享个人开发的助手。 @@ -308,14 +350,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地 -| 最近新增 | 描述 | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| [系统指令专家](https://lobechat.com/discover/assistant/instructer)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-12-04** | 擅长精炼与生成高效系统指令
`系统指令` `写作` `细节优化` `用户需求` | -| [日语帮助记忆师](https://lobechat.com/discover/assistant/japan-language-helper)
By **[sharkbear212](https://github.com/sharkbear212)** on **2024-12-04** | 擅长日语五十音,平假名,片假名,单词和短语解释与记忆技巧
`解释` `记忆技巧` `日语教学` | -| [诗词卡片设计师](https://lobechat.com/discover/assistant/poetry-card-designer)
By **[lianxin255](https://github.com/lianxin255)** on **2024-12-03** | 擅长设计诗词卡片,提升艺术感与吸引力
`诗词卡片设计` `卡片` `创意` `艺术表现` | -| [日常医生](https://lobechat.com/discover/assistant/yunchat-docter)
By **[yuyun2000](https://github.com/yuyun2000)** on **2024-11-30** | 擅长外科诊疗与个性化健康管理
`全科医学` `外科` `健康咨询` `个性化治疗` `医学教育` | +| 最近新增 | 描述 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| [小智法语翻译助手](https://lobechat.com/discover/assistant/xiao-zhi-french-translation-asst-v-1)
By **[WeR-Best](https://github.com/WeR-Best)** on **2025-02-10** | 友好、专业、富有同理心的法语翻译 AI 助手
`ai助手` `法语翻译` `跨文化交流` `创造力` | +| [命理研究员](https://lobechat.com/discover/assistant/fate-researcher)
By **[Jack980506](https://github.com/Jack980506)** on **2025-02-06** | 精通八字命
`命理学` `八字` `传统文化` | +| [语言魅力学习导师](https://lobechat.com/discover/assistant/bad-language-helper)
By **[Guducat](https://github.com/Guducat)** on **2025-02-06** | 擅长教学语言的魅力与花样回复
`语言学习` `对话示例` | +| [Allinone](https://lobechat.com/discover/assistant/allinone-v-1)
By **[AXuanCreator](https://github.com/AXuanCreator)** on **2025-02-06** | 创新・未来・卓越
`编程` `低成本` `简洁回答` | -> 📊 Total agents: [**453** ](https://lobechat.com/discover/assistants) +> 📊 Total agents: [**486** ](https://lobechat.com/discover/assistants) @@ -327,7 +369,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地 [![][image-feat-database]][docs-feat-database] -### `9` [支持本地 / 远程数据库][docs-feat-database] +### `12` [支持本地 / 远程数据库][docs-feat-database] LobeChat 支持同时使用服务端数据库和本地数据库。根据您的需求,您可以选择合适的部署方案: @@ -344,7 +386,7 @@ LobeChat 支持同时使用服务端数据库和本地数据库。根据您的 [![][image-feat-auth]][docs-feat-auth] -### `10` [支持多用户管理][docs-feat-auth] +### `13` [支持多用户管理][docs-feat-auth] LobeChat 支持多用户管理,提供了两种主要的用户认证和管理方案,以满足不同需求: @@ -362,7 +404,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理 [![][image-feat-pwa]][docs-feat-pwa] -### `11` [渐进式 Web 应用 (PWA)][docs-feat-pwa] +### `14` [渐进式 Web 应用 (PWA)][docs-feat-pwa] 我们深知在当今多设备环境下为用户提供无缝体验的重要性。为此,我们采用了渐进式 Web 应用 [PWA](https://support.google.com/chrome/answer/9658361) 技术, 这是一种能够将网页应用提升至接近原生应用体验的现代 Web 技术。通过 PWA,LobeChat 能够在桌面和移动设备上提供高度优化的用户体验,同时保持轻量级和高性能的特点。 @@ -385,7 +427,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理 [![][image-feat-mobile]][docs-feat-mobile] -### `12` [移动设备适配][docs-feat-mobile] +### `15` [移动设备适配][docs-feat-mobile] 针对移动设备进行了一系列的优化设计,以提升用户的移动体验。目前,我们正在对移动端的用户体验进行版本迭代,以实现更加流畅和直观的交互。如果您有任何建议或想法,我们非常欢迎您通过 GitHub Issues 或者 Pull Requests 提供反馈。 @@ -397,7 +439,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理 [![][image-feat-theme]][docs-feat-theme] -### `13` [自定义主题][docs-feat-theme] +### `16` [自定义主题][docs-feat-theme] 作为设计工程师出身,LobeChat 在界面设计上充分考虑用户的个性化体验,因此引入了灵活多变的主题模式,其中包括日间的亮色模式和夜间的深色模式。 除了主题模式的切换,还提供了一系列的颜色定制选项,允许用户根据自己的喜好来调整应用的主题色彩。无论是想要沉稳的深蓝,还是希望活泼的桃粉,或者是专业的灰白,用户都能够在 LobeChat 中找到匹配自己风格的颜色选择。 @@ -412,7 +454,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理
-### 更多特性 +### `*` 更多特性 除了上述功能特性以外,LobeChat 所具有的设计和技术能力将为你带来更多使用保障: @@ -750,9 +792,9 @@ This project is [Apache 2.0](./LICENSE) licensed. [blog]: https://lobehub.com/zh/blog [changelog]: https://lobehub.com/changelog [chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg -[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html +[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/lobechat_com_chat.html [chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg -[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html +[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/lobechat_com_chat.html [chat-plugin-sdk]: https://github.com/lobehub/chat-plugin-sdk [chat-plugin-template]: https://github.com/lobehub/chat-plugin-template [chat-plugins-gateway]: https://github.com/lobehub/chat-plugins-gateway @@ -782,7 +824,10 @@ This project is [Apache 2.0](./LICENSE) licensed. [docs-docker]: https://lobehub.com/docs/self-hosting/platform/docker [docs-env-var]: https://lobehub.com/docs/self-hosting/environment-variables [docs-feat-agent]: https://lobehub.com/docs/usage/features/agent-market +[docs-feat-artifacts]: https://lobehub.com/docs/usage/features/artifacts [docs-feat-auth]: https://lobehub.com/docs/usage/features/auth +[docs-feat-branch]: https://lobehub.com/docs/usage/features/branching-conversations +[docs-feat-cot]: https://lobehub.com/docs/usage/features/cot [docs-feat-database]: https://lobehub.com/docs/usage/features/database [docs-feat-knowledgebase]: https://lobehub.com/blog/knowledge-base [docs-feat-local]: https://lobehub.com/docs/usage/features/local-llm @@ -826,22 +871,25 @@ This project is [Apache 2.0](./LICENSE) licensed. [github-stars-shield]: https://img.shields.io/github/stars/lobehub/lobe-chat?color=ffcb47&labelColor=black&style=flat-square [github-trending-shield]: https://trendshift.io/api/badge/repositories/2256 [github-trending-url]: https://trendshift.io/repositories/2256 -[image-banner]: https://github.com/lobehub/lobe-chat/assets/28616219/9f155dff-4737-429f-9cad-a70a1a860c5f -[image-feat-agent]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png -[image-feat-auth]: https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2 -[image-feat-database]: https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9 -[image-feat-knowledgebase]: https://github.com/user-attachments/assets/77e58e1c-c82f-4341-b159-f4eeede9967f -[image-feat-local]: https://github.com/lobehub/lobe-chat/assets/28616219/ca9a21bc-ea6c-4c90-bf4a-fa53b4fb2b5c -[image-feat-mobile]: https://gw.alipayobjects.com/zos/kitchen/R441AuFS4W/mobile.webp -[image-feat-plugin]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670883-33c43a5c-a512-467e-855c-fa299548cce5.png -[image-feat-privoder]: https://github.com/lobehub/lobe-chat/assets/28616219/b164bc54-8ba2-4c1e-b2f2-f4d7f7e7a551 -[image-feat-pwa]: https://gw.alipayobjects.com/zos/kitchen/69x6bllkX3/pwa.webp -[image-feat-t2i]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/297746445-0ff762b9-aa08-4337-afb7-12f932b6efbb.png -[image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp -[image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png -[image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png +[image-banner]: https://github.com/user-attachments/assets/6f293c7f-47b4-47eb-9202-fe68a942d35b +[image-feat-agent]: https://github.com/user-attachments/assets/b3ab6e35-4fbc-468d-af10-e3e0c687350f +[image-feat-artifacts]: https://github.com/user-attachments/assets/7f95fad6-b210-4e6e-84a0-7f39e96f3a00 +[image-feat-auth]: https://github.com/user-attachments/assets/80bb232e-19d1-4f97-98d6-e291f3585e6d +[image-feat-branch]: https://github.com/user-attachments/assets/92f72082-02bd-4835-9c54-b089aad7fd41 +[image-feat-cot]: https://github.com/user-attachments/assets/f74f1139-d115-4e9c-8c43-040a53797a5e +[image-feat-database]: https://github.com/user-attachments/assets/f1697c8b-d1fb-4dac-ba05-153c6295d91d +[image-feat-knowledgebase]: https://github.com/user-attachments/assets/7da7a3b2-92fd-4630-9f4e-8560c74955ae +[image-feat-local]: https://github.com/user-attachments/assets/1239da50-d832-4632-a7ef-bd754c0f3850 +[image-feat-mobile]: https://github.com/user-attachments/assets/32cf43c4-96bd-4a4c-bfb6-59acde6fe380 +[image-feat-plugin]: https://github.com/user-attachments/assets/66a891ac-01b6-4e3f-b978-2eb07b489b1b +[image-feat-privoder]: https://github.com/user-attachments/assets/e553e407-42de-4919-977d-7dbfcf44a821 +[image-feat-pwa]: https://github.com/user-attachments/assets/9647f70f-b71b-43b6-9564-7cdd12d1c24d +[image-feat-t2i]: https://github.com/user-attachments/assets/708274a7-2458-494b-a6ec-b73dfa1fa7c2 +[image-feat-theme]: https://github.com/user-attachments/assets/b47c39f1-806f-492b-8fcb-b0fa973937c1 +[image-feat-tts]: https://github.com/user-attachments/assets/50189597-2cc3-4002-b4c8-756a52ad5c0a +[image-feat-vision]: https://github.com/user-attachments/assets/18574a1f-46c2-4cbc-af2c-35a86e128a07 [image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf -[image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855 +[image-star]: https://github.com/user-attachments/assets/c3b482e7-cef5-4e94-bef9-226900ecfaab [issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat [lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins [lobe-commit]: https://github.com/lobehub/lobe-commit/tree/master/packages/lobe-commit diff --git a/changelog/v1.json b/changelog/v1.json index 19a918cb9c716..a9b691b088a8b 100644 --- a/changelog/v1.json +++ b/changelog/v1.json @@ -1,4 +1,1058 @@ [ + { + "children": { + "features": ["Add volcengine as a new provider."] + }, + "date": "2025-02-16", + "version": "1.59.0" + }, + { + "children": { + "features": ["Add Azure AI as new Provider."] + }, + "date": "2025-02-16", + "version": "1.58.0" + }, + { + "children": { + "improvements": ["Fix mobile agent settings not show correctly."] + }, + "date": "2025-02-16", + "version": "1.57.1" + }, + { + "children": { + "features": ["Add Jina AI model provider support."] + }, + "date": "2025-02-16", + "version": "1.57.0" + }, + { + "children": { + "fixes": [ + "Match o1 series models more robust in Azure OpenAI provider, set max_completion_tokens to null for Azure OpenAI." + ] + }, + "date": "2025-02-16", + "version": "1.56.5" + }, + { + "children": { + "fixes": ["Fix ai provider description not show correctly."] + }, + "date": "2025-02-16", + "version": "1.56.4" + }, + { + "children": { + "improvements": ["Improve inbox agent settings."] + }, + "date": "2025-02-16", + "version": "1.56.3" + }, + { + "children": { + "fixes": ["Fix inbox agent can not save config."] + }, + "date": "2025-02-16", + "version": "1.56.2" + }, + { + "children": { + "fixes": ["Fix inbox agent edit way in the new mode."] + }, + "date": "2025-02-16", + "version": "1.56.1" + }, + { + "children": { + "features": ["Add configurable PDF processing method with Unstructured."] + }, + "date": "2025-02-15", + "version": "1.56.0" + }, + { + "children": { + "improvements": ["Improve mobile params style."] + }, + "date": "2025-02-15", + "version": "1.55.4" + }, + { + "children": { + "improvements": ["Add deepseek r1 distill models for qwen series."] + }, + "date": "2025-02-15", + "version": "1.55.3" + }, + { + "children": { + "fixes": ["Avoid blank reasoning with OpenRouter."] + }, + "date": "2025-02-15", + "version": "1.55.2" + }, + { + "children": { + "fixes": ["Fix Azure OpenAI O1 models and refactor the Azure OpenAI implement."], + "improvements": ["Update openrouter model list and descriptions."] + }, + "date": "2025-02-15", + "version": "1.55.1" + }, + { + "children": { + "features": ["Add vLLM provider support."] + }, + "date": "2025-02-14", + "version": "1.55.0" + }, + { + "children": { + "features": ["Add Nvidia NIM provider support."], + "improvements": ["Improve advanced params settings."] + }, + "date": "2025-02-14", + "version": "1.54.0" + }, + { + "children": { + "improvements": ["Improve model fetch behavior."] + }, + "date": "2025-02-14", + "version": "1.53.12" + }, + { + "children": { + "fixes": ["Fix provider form api key."] + }, + "date": "2025-02-13", + "version": "1.53.11" + }, + { + "children": { + "fixes": ["Fix api key input issue."] + }, + "date": "2025-02-13", + "version": "1.53.10" + }, + { + "children": { + "improvements": ["Support select check models."] + }, + "date": "2025-02-13", + "version": "1.53.9" + }, + { + "children": { + "fixes": ["Fix model fetch for spark and fix the support of model reset."] + }, + "date": "2025-02-13", + "version": "1.53.8" + }, + { + "children": { + "improvements": ["Update model list."] + }, + "date": "2025-02-13", + "version": "1.53.7" + }, + { + "children": { + "fixes": ["Fix not enable models correctly."] + }, + "date": "2025-02-13", + "version": "1.53.6" + }, + { + "children": { + "fixes": ["Fix latex in thinking tag render."] + }, + "date": "2025-02-13", + "version": "1.53.5" + }, + { + "children": { + "fixes": ["Fix ai model abilities issue."] + }, + "date": "2025-02-12", + "version": "1.53.4" + }, + { + "children": { + "fixes": ["Fix tencent cloud api issue."] + }, + "date": "2025-02-12", + "version": "1.53.3" + }, + { + "children": { + "fixes": ["Disable openrouter client fetch."] + }, + "date": "2025-02-12", + "version": "1.53.2" + }, + { + "children": { + "fixes": ["Fix reasoning output for OpenRouter reasoning models like deepseek-r1."] + }, + "date": "2025-02-12", + "version": "1.53.1" + }, + { + "children": { + "features": ["Support tencent cloud provider."], + "improvements": ["Update i18n, update provider i18n."] + }, + "date": "2025-02-11", + "version": "1.53.0" + }, + { + "children": { + "improvements": ["Refactor the agent runtime test case."] + }, + "date": "2025-02-11", + "version": "1.52.19" + }, + { + "children": {}, + "date": "2025-02-11", + "version": "1.52.18" + }, + { + "children": {}, + "date": "2025-02-11", + "version": "1.52.17" + }, + { + "children": { + "improvements": ["Support mistral proxy url."] + }, + "date": "2025-02-11", + "version": "1.52.16" + }, + { + "children": { + "fixes": ["Fix lmstudio baseURL."], + "improvements": ["Optimized MaxToken Slider."] + }, + "date": "2025-02-10", + "version": "1.52.15" + }, + { + "children": { + "improvements": ["Refactor agent settings modal."] + }, + "date": "2025-02-10", + "version": "1.52.14" + }, + { + "children": { + "fixes": [ + "Fix Aliyun deepseek-r1 reasoning parsing with oneapi, Support Aliyun deepseek-r1 reasoning." + ] + }, + "date": "2025-02-10", + "version": "1.52.13" + }, + { + "children": { + "fixes": ["Fix language incorrect on page hydration."] + }, + "date": "2025-02-10", + "version": "1.52.12" + }, + { + "children": { + "improvements": ["Support Mermaid in Artifacts."] + }, + "date": "2025-02-10", + "version": "1.52.11" + }, + { + "children": {}, + "date": "2025-02-09", + "version": "1.52.10" + }, + { + "children": { + "fixes": ["Fix changelog issue."] + }, + "date": "2025-02-09", + "version": "1.52.9" + }, + { + "children": { + "improvements": ["Update github model list, Update openrouter model list."] + }, + "date": "2025-02-09", + "version": "1.52.8" + }, + { + "children": { + "fixes": ["Rewrite to local container in docker deployment mode."], + "improvements": ["Update Cloudflare models."] + }, + "date": "2025-02-09", + "version": "1.52.7" + }, + { + "children": { + "improvements": ["Update ZeroOne models."] + }, + "date": "2025-02-08", + "version": "1.52.6" + }, + { + "children": { + "fixes": ["Fix changelog modal."] + }, + "date": "2025-02-08", + "version": "1.52.5" + }, + { + "children": { + "fixes": ["Fix changelog modal."] + }, + "date": "2025-02-08", + "version": "1.52.4" + }, + { + "children": { + "fixes": ["Add Zhipu param limit, Fix translation in variants mode."], + "improvements": ["Update Gemini 2.0 models."] + }, + "date": "2025-02-08", + "version": "1.52.3" + }, + { + "children": { + "improvements": ["Add siliconcloud pro models."] + }, + "date": "2025-02-08", + "version": "1.52.2" + }, + { + "children": { + "fixes": ["Fix static relative issues."] + }, + "date": "2025-02-08", + "version": "1.52.1" + }, + { + "children": { + "features": ["Refactor the auth condition in Next Auth."] + }, + "date": "2025-02-08", + "version": "1.52.0" + }, + { + "children": {}, + "date": "2025-02-07", + "version": "1.51.16" + }, + { + "children": { + "fixes": ["Fix home next auth error and update pnpm."] + }, + "date": "2025-02-07", + "version": "1.51.15" + }, + { + "children": { + "improvements": ["Update changelog cache and upgrade anthropic sdk."] + }, + "date": "2025-02-07", + "version": "1.51.14" + }, + { + "children": { + "fixes": ["Fix next auth error."] + }, + "date": "2025-02-07", + "version": "1.51.13" + }, + { + "children": { + "fixes": ["Try to fix next-auth issue."] + }, + "date": "2025-02-07", + "version": "1.51.12" + }, + { + "children": { + "fixes": ["Fix /file/[id] 500 issue."] + }, + "date": "2025-02-06", + "version": "1.51.11" + }, + { + "children": { + "fixes": ["Fix provider 500 issue."] + }, + "date": "2025-02-06", + "version": "1.51.10" + }, + { + "children": { + "improvements": ["Update edtion tag display and improve prerender."] + }, + "date": "2025-02-06", + "version": "1.51.9" + }, + { + "children": { + "improvements": ["Refactor model fetch method."] + }, + "date": "2025-02-06", + "version": "1.51.8" + }, + { + "children": { + "improvements": ["Add Aliyun deepseek-r1 distill models."] + }, + "date": "2025-02-06", + "version": "1.51.7" + }, + { + "children": { + "fixes": ["Try to fix discover error."] + }, + "date": "2025-02-06", + "version": "1.51.6" + }, + { + "children": { + "improvements": ["Add siliconcloud models."] + }, + "date": "2025-02-06", + "version": "1.51.5" + }, + { + "children": {}, + "date": "2025-02-06", + "version": "1.51.4" + }, + { + "children": { + "improvements": ["Add Cache, Metadata, FeatureFlag Viewer to DevPanel."], + "fixes": ["Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash."] + }, + "date": "2025-02-05", + "version": "1.51.3" + }, + { + "children": { + "improvements": ["Update model list, add reasoning tag."] + }, + "date": "2025-02-05", + "version": "1.51.2" + }, + { + "children": {}, + "date": "2025-02-05", + "version": "1.51.1" + }, + { + "children": { + "features": ["Add reasoning tag support for custom models via UI or ENV."], + "fixes": [ + "Fix deepseek-v3 & qvq model tag fetch error from SiliconCloud, fix model ability missing." + ] + }, + "date": "2025-02-05", + "version": "1.51.0" + }, + { + "children": { + "improvements": ["Add/Update Aliyun Cloud Models, update GitHub Models."] + }, + "date": "2025-02-04", + "version": "1.50.5" + }, + { + "children": { + "fixes": ["Fix invalid utf8 character."] + }, + "date": "2025-02-04", + "version": "1.50.4" + }, + { + "children": { + "improvements": ["Update model locale."] + }, + "date": "2025-02-04", + "version": "1.50.3" + }, + { + "children": { + "fixes": ["Fix o1 series calling issue."] + }, + "date": "2025-02-04", + "version": "1.50.2" + }, + { + "children": { + "fixes": ["Bind the selected group name in the rename modal.."] + }, + "date": "2025-02-03", + "version": "1.50.1" + }, + { + "children": { + "features": ["Add o3-mini support for OpenAI & GitHub Models."], + "fixes": ["Fix parse of deepseek r1 in siliconflow provider."] + }, + "date": "2025-02-03", + "version": "1.50.0" + }, + { + "children": { + "improvements": ["Update perplexity models."] + }, + "date": "2025-02-03", + "version": "1.49.16" + }, + { + "children": { + "improvements": ["Update Fireworks check model and fix check error."] + }, + "date": "2025-02-03", + "version": "1.49.15" + }, + { + "children": { + "fixes": ["Fix provider update issue."] + }, + "date": "2025-02-03", + "version": "1.49.14" + }, + { + "children": { + "fixes": ["Optimize requests without historical messages."] + }, + "date": "2025-02-03", + "version": "1.49.13" + }, + { + "children": { + "fixes": ["Fix can not stop generating."] + }, + "date": "2025-02-02", + "version": "1.49.12" + }, + { + "children": { + "fixes": ["Fix ollama intergration checker and client fetch issue."] + }, + "date": "2025-02-02", + "version": "1.49.11" + }, + { + "children": { + "fixes": ["Fix tag crash with special markdown content."] + }, + "date": "2025-02-02", + "version": "1.49.10" + }, + { + "children": { + "improvements": ["Update siliconcloud models."] + }, + "date": "2025-02-01", + "version": "1.49.9" + }, + { + "children": { + "improvements": ["Support thinking for all non DeepSeek official api R1 models."] + }, + "date": "2025-02-01", + "version": "1.49.8" + }, + { + "children": { + "fixes": ["Multiple deepseek-reasoner request errors."] + }, + "date": "2025-02-01", + "version": "1.49.7" + }, + { + "children": { + "fixes": ["Support litellm reasoning streaming."] + }, + "date": "2025-01-30", + "version": "1.49.6" + }, + { + "children": { + "fixes": ["Pin @clerk/nextjs@6.10.2 to avoid build error."] + }, + "date": "2025-01-28", + "version": "1.49.5" + }, + { + "children": { + "fixes": ["Fix changelog locale not showing English."] + }, + "date": "2025-01-28", + "version": "1.49.4" + }, + { + "children": { + "fixes": ["Fix discover ssr hydration error."] + }, + "date": "2025-01-27", + "version": "1.49.3" + }, + { + "children": { + "improvements": ["Remove use query."] + }, + "date": "2025-01-27", + "version": "1.49.2" + }, + { + "children": { + "improvements": ["UseMobileWorkspace use nqus to replace useQuery."] + }, + "date": "2025-01-27", + "version": "1.49.1" + }, + { + "children": { + "features": ["Support Doubao Models."] + }, + "date": "2025-01-27", + "version": "1.49.0" + }, + { + "children": { + "improvements": ["Improve thinking style."] + }, + "date": "2025-01-27", + "version": "1.48.4" + }, + { + "children": { + "improvements": ["Improve model pricing with CNY."] + }, + "date": "2025-01-26", + "version": "1.48.3" + }, + { + "children": { + "improvements": [ + "Add parallel_tool_calls support for Qwen, fix tag version and add provider changelog." + ] + }, + "date": "2025-01-25", + "version": "1.48.2" + }, + { + "children": { + "fixes": ["Fix ollama Browser Request failed in PG mode."] + }, + "date": "2025-01-25", + "version": "1.48.1" + }, + { + "children": { + "features": ["Support display thinking for DeepSeek R1."] + }, + "date": "2025-01-24", + "version": "1.48.0" + }, + { + "children": { + "improvements": ["Fix model fetch match tag error & add Hunyuan model fetch support."] + }, + "date": "2025-01-24", + "version": "1.47.23" + }, + { + "children": { + "fixes": ["Fix form input in provider."] + }, + "date": "2025-01-24", + "version": "1.47.22" + }, + { + "children": { + "improvements": ["Add HuggingFace Model: DeepSeek R1."] + }, + "date": "2025-01-23", + "version": "1.47.21" + }, + { + "children": { + "fixes": ["Fix tts in new provider model."] + }, + "date": "2025-01-23", + "version": "1.47.20" + }, + { + "children": { + "improvements": ["Add new stepfun model."] + }, + "date": "2025-01-23", + "version": "1.47.19" + }, + { + "children": { + "fixes": ["Fix debounce issue of provider config."] + }, + "date": "2025-01-23", + "version": "1.47.18" + }, + { + "children": { + "fixes": ["Upgrade react-i18next to ^15."] + }, + "date": "2025-01-22", + "version": "1.47.17" + }, + { + "children": { + "improvements": ["Add gemini new model."] + }, + "date": "2025-01-22", + "version": "1.47.16" + }, + { + "children": { + "improvements": ["Improve discover model page."] + }, + "date": "2025-01-22", + "version": "1.47.15" + }, + { + "children": { + "improvements": ["Support model list with model fetcher settings."] + }, + "date": "2025-01-22", + "version": "1.47.14" + }, + { + "children": { + "improvements": ["Add ModelFetcher for supported providers."] + }, + "date": "2025-01-21", + "version": "1.47.13" + }, + { + "children": { + "improvements": ["Refactor [@nav](https://github.com/nav) layout and improve pin list style."] + }, + "date": "2025-01-21", + "version": "1.47.12" + }, + { + "children": { + "improvements": ["Improve code for ai provider."] + }, + "date": "2025-01-21", + "version": "1.47.11" + }, + { + "children": { + "improvements": ["Support assistant blacklist."] + }, + "date": "2025-01-21", + "version": "1.47.10" + }, + { + "children": { + "improvements": ["Improve error code."] + }, + "date": "2025-01-20", + "version": "1.47.9" + }, + { + "children": { + "improvements": ["Add deepseek r1 model."] + }, + "date": "2025-01-20", + "version": "1.47.8" + }, + { + "children": { + "improvements": ["Remove redundant payload remapping in client-fetch."] + }, + "date": "2025-01-20", + "version": "1.47.7" + }, + { + "children": { + "improvements": ["Refactor provider code."] + }, + "date": "2025-01-20", + "version": "1.47.6" + }, + { + "children": { + "improvements": ["Improve ai provider code."] + }, + "date": "2025-01-20", + "version": "1.47.5" + }, + { + "children": {}, + "date": "2025-01-18", + "version": "1.47.4" + }, + { + "children": { + "fixes": ["Fix hydration error."] + }, + "date": "2025-01-18", + "version": "1.47.3" + }, + { + "children": { + "fixes": ["Fix api key in api key form."] + }, + "date": "2025-01-17", + "version": "1.47.2" + }, + { + "children": {}, + "date": "2025-01-17", + "version": "1.47.1" + }, + { + "children": { + "features": ["Support new ai provider in client pglite."] + }, + "date": "2025-01-17", + "version": "1.47.0" + }, + { + "children": { + "fixes": [ + "Improve validation for provider and model in parseFilesConfig, temporarily disable S3 client integrity check for Cloudflare R2." + ] + }, + "date": "2025-01-17", + "version": "1.46.7" + }, + { + "children": { + "fixes": ["Gemini models HarmBlockThreshold."] + }, + "date": "2025-01-16", + "version": "1.46.6" + }, + { + "children": {}, + "date": "2025-01-16", + "version": "1.46.5" + }, + { + "children": { + "improvements": ["Refactor some implement for the next performance improvement."] + }, + "date": "2025-01-16", + "version": "1.46.4" + }, + { + "children": { + "fixes": ["Fix azure in new ai provider."] + }, + "date": "2025-01-15", + "version": "1.46.3" + }, + { + "children": {}, + "date": "2025-01-15", + "version": "1.46.2" + }, + { + "children": { + "improvements": ["Add auth support for PROXY_URL."] + }, + "date": "2025-01-15", + "version": "1.46.1" + }, + { + "children": { + "features": ["Add lm studio provider, support to customize Embedding model with env."] + }, + "date": "2025-01-15", + "version": "1.46.0" + }, + { + "children": { + "improvements": ["Refactor Minimax with LobeOpenAICompatibleFactory."] + }, + "date": "2025-01-15", + "version": "1.45.17" + }, + { + "children": { + "improvements": ["Improve ai provider code."] + }, + "date": "2025-01-14", + "version": "1.45.16" + }, + { + "children": { + "fixes": ["Fix pull models error in new ai provider."] + }, + "date": "2025-01-14", + "version": "1.45.15" + }, + { + "children": {}, + "date": "2025-01-14", + "version": "1.45.14" + }, + { + "children": { + "improvements": ["Improve model config form modal."] + }, + "date": "2025-01-14", + "version": "1.45.13" + }, + { + "children": { + "fixes": ["Fix enable_search parameter intro condition in Qwen."] + }, + "date": "2025-01-14", + "version": "1.45.12" + }, + { + "children": { + "fixes": ["Support Gemini 2.0 HarmBlockThreshold."] + }, + "date": "2025-01-14", + "version": "1.45.11" + }, + { + "children": { + "fixes": ["Fix some providers issues."] + }, + "date": "2025-01-14", + "version": "1.45.10" + }, + { + "children": { + "fixes": ["Fix pin package manager to pnpm@9 for docker."] + }, + "date": "2025-01-14", + "version": "1.45.9" + }, + { + "children": { + "fixes": ["Refactor dynamic import in RSC."] + }, + "date": "2025-01-14", + "version": "1.45.8" + }, + { + "children": { + "fixes": ["Fix released at for undefined condition."] + }, + "date": "2025-01-13", + "version": "1.45.7" + }, + { + "children": { + "fixes": ["Fix *_MODEL_LIST env in new provider."] + }, + "date": "2025-01-10", + "version": "1.45.6" + }, + { + "children": { + "fixes": ["Revert officeparser."] + }, + "date": "2025-01-09", + "version": "1.45.5" + }, + { + "children": { + "fixes": ["Fix GitHub and huggingface provider config unusable."] + }, + "date": "2025-01-09", + "version": "1.45.4" + }, + { + "children": { + "fixes": ["Fix some ai provider known issues."] + }, + "date": "2025-01-09", + "version": "1.45.3" + }, + { + "children": { + "improvements": ["Update siliconcloud model list."] + }, + "date": "2025-01-09", + "version": "1.45.2" + }, + { + "children": { + "fixes": ["Fix remark gfm regex breaks in Safari versions < 16.4."] + }, + "date": "2025-01-09", + "version": "1.45.1" + }, + { + "children": { + "features": ["Update Remark."] + }, + "date": "2025-01-08", + "version": "1.45.0" + }, + { + "children": { + "fixes": ["Fix provider enabled issue."] + }, + "date": "2025-01-08", + "version": "1.44.3" + }, + { + "children": { + "fixes": ["Add provider id validate."] + }, + "date": "2025-01-08", + "version": "1.44.2" + }, + { + "children": { + "fixes": ["Fix model select not auto update and sort issue."] + }, + "date": "2025-01-08", + "version": "1.44.1" + }, + { + "children": { + "features": ["Brand new AI provider."] + }, + "date": "2025-01-07", + "version": "1.44.0" + }, + { + "children": { + "fixes": ["Fix portal suspense error when first open."] + }, + "date": "2025-01-07", + "version": "1.43.6" + }, + { + "children": { + "improvements": ["Fix style warning in antd 5.23.0 and some error logs."] + }, + "date": "2025-01-07", + "version": "1.43.5" + }, + { + "children": { + "fixes": ["Fix format short number."] + }, + "date": "2025-01-06", + "version": "1.43.4" + }, { "children": { "improvements": ["Upgrade @clerk/nextjs to v6."] diff --git a/contributing/Others/Lighthouse.md b/contributing/Others/Lighthouse.md index 8cd92f74a213e..c890ef6b988f7 100644 --- a/contributing/Others/Lighthouse.md +++ b/contributing/Others/Lighthouse.md @@ -2,64 +2,34 @@ #### TOC -- [Welcome Page](#welcome-page) - [Chat Page](#chat-page) -- [Market Page](#market-page) -- [Settings Page](#settings-page) - -## Welcome Page - -> **Info**\ -> - -| Desktop | Mobile | -| :---------------------------------------------: | :--------------------------------------------: | -| ![][welcome-desktop] | ![][welcome-mobile] | -| [⚡️ Lighthouse Report][welcome-desktop-report] | [⚡️ Lighthouse Report][welcome-mobile-report] | +- [Discover Page](#discover-page) ## Chat Page > **Info**\ -> +> | Desktop | Mobile | | :------------------------------------------: | :-----------------------------------------: | | ![][chat-desktop] | ![][chat-mobile] | | [⚡️ Lighthouse Report][chat-desktop-report] | [⚡️ Lighthouse Report][chat-mobile-report] | -## Market Page - -> **Info**\ -> - -| Desktop | Mobile | -| :--------------------------------------------: | :-------------------------------------------: | -| ![][market-desktop] | ![][market-mobile] | -| [⚡️ Lighthouse Report][market-desktop-report] | [⚡️ Lighthouse Report][market-mobile-report] | - -## Settings Page +## Discover Page > **Info**\ -> +> | Desktop | Mobile | | :----------------------------------------------: | :---------------------------------------------: | -| ![][settings-desktop] | ![][settings-mobile] | -| [⚡️ Lighthouse Report][settings-desktop-report] | [⚡️ Lighthouse Report][settings-mobile-report] | +| ![][discover-desktop] | ![][discover-mobile] | +| [⚡️ Lighthouse Report][discover-desktop-report] | [⚡️ Lighthouse Report][discover-mobile-report] | [chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg -[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html +[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/lobechat_com_chat.html [chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg -[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html -[market-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/market/desktop/pagespeed.svg -[market-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/market/desktop/chat_preview_lobehub_com_market.html -[market-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/market/mobile/pagespeed.svg -[market-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/market/mobile/chat_preview_lobehub_com_market.html -[settings-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/settings/desktop/pagespeed.svg -[settings-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/settings/desktop/chat_preview_lobehub_com_settings.html -[settings-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/settings/mobile/pagespeed.svg -[settings-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/settings/mobile/chat_preview_lobehub_com_settings.html -[welcome-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/welcome/desktop/pagespeed.svg -[welcome-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/welcome/desktop/chat_preview_lobehub_com_welcome.html -[welcome-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/welcome/mobile/pagespeed.svg -[welcome-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/welcome/mobile/chat_preview_lobehub_com_welcome.html +[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/lobechat_com_chat.html +[discover-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/discover/desktop/pagespeed.svg +[discover-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/discover/desktop/lobechat_com_discover.html +[discover-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/discover/mobile/pagespeed.svg +[discover-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/discover/mobile/lobechat_com_discover.html diff --git a/contributing/Others/Lighthouse.zh-CN.md b/contributing/Others/Lighthouse.zh-CN.md index 95d67416a1019..6cd10f4172e3f 100644 --- a/contributing/Others/Lighthouse.zh-CN.md +++ b/contributing/Others/Lighthouse.zh-CN.md @@ -2,64 +2,34 @@ #### TOC -- [Welcome 欢迎页面](#welcome-欢迎页面) - [Chat 聊天页面](#chat-聊天页面) -- [Market 市场页面](#market-市场页面) -- [Settings 设置页面](#settings-设置页面) - -## Welcome 欢迎页面 - -> **Info**\ -> - -| Desktop | Mobile | -| :---------------------------------------------: | :--------------------------------------------: | -| ![][welcome-desktop] | ![][welcome-mobile] | -| [⚡️ Lighthouse Report][welcome-desktop-report] | [⚡️ Lighthouse Report][welcome-mobile-report] | +- [Discover 发现页面](#discover-发现页面) ## Chat 聊天页面 > **Info**\ -> +> | Desktop | Mobile | | :------------------------------------------: | :-----------------------------------------: | | ![][chat-desktop] | ![][chat-mobile] | | [⚡️ Lighthouse Report][chat-desktop-report] | [⚡️ Lighthouse Report][chat-mobile-report] | -## Market 市场页面 - -> **Info**\ -> - -| Desktop | Mobile | -| :--------------------------------------------: | :-------------------------------------------: | -| ![][market-desktop] | ![][market-mobile] | -| [⚡️ Lighthouse Report][market-desktop-report] | [⚡️ Lighthouse Report][market-mobile-report] | - -## Settings 设置页面 +## Discover 发现页面 > **Info**\ -> +> | Desktop | Mobile | | :----------------------------------------------: | :---------------------------------------------: | -| ![][settings-desktop] | ![][settings-mobile] | -| [⚡️ Lighthouse Report][settings-desktop-report] | [⚡️ Lighthouse Report][settings-mobile-report] | +| ![][discover-desktop] | ![][discover-mobile] | +| [⚡️ Lighthouse Report][discover-desktop-report] | [⚡️ Lighthouse Report][discover-mobile-report] | [chat-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/desktop/pagespeed.svg -[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/chat_preview_lobehub_com_chat.html +[chat-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/desktop/lobechat_com_chat.html [chat-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/chat/mobile/pagespeed.svg -[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/chat_preview_lobehub_com_chat.html -[market-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/market/desktop/pagespeed.svg -[market-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/market/desktop/chat_preview_lobehub_com_market.html -[market-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/market/mobile/pagespeed.svg -[market-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/market/mobile/chat_preview_lobehub_com_market.html -[settings-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/settings/desktop/pagespeed.svg -[settings-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/settings/desktop/chat_preview_lobehub_com_settings.html -[settings-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/settings/mobile/pagespeed.svg -[settings-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/settings/mobile/chat_preview_lobehub_com_settings.html -[welcome-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/welcome/desktop/pagespeed.svg -[welcome-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/welcome/desktop/chat_preview_lobehub_com_welcome.html -[welcome-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/welcome/mobile/pagespeed.svg -[welcome-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/welcome/mobile/chat_preview_lobehub_com_welcome.html +[chat-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/chat/mobile/lobechat_com_chat.html +[discover-desktop]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/discover/desktop/pagespeed.svg +[discover-desktop-report]: https://lobehub.github.io/lobe-chat/lighthouse/discover/desktop/lobechat_com_discover.html +[discover-mobile]: https://raw.githubusercontent.com/lobehub/lobe-chat/lighthouse/lighthouse/discover/mobile/pagespeed.svg +[discover-mobile-report]: https://lobehub.github.io/lobe-chat/lighthouse/discover/mobile/lobechat_com_discover.html diff --git a/docker-compose/local/.env.example b/docker-compose/local/.env.example index 40ccc8e622a2b..5038943fa6ba7 100644 --- a/docker-compose/local/.env.example +++ b/docker-compose/local/.env.example @@ -16,20 +16,26 @@ LOBE_PORT=3210 CASDOOR_PORT=8000 MINIO_PORT=9000 +APP_URL=http://localhost:3210 +AUTH_URL=http://localhost:3210/api/auth # Postgres related, which are the necessary environment variables for DB LOBE_DB_NAME=lobechat POSTGRES_PASSWORD=uWNZugjBqixf8dxC +AUTH_CASDOOR_ISSUER=http://localhost:8000 # Casdoor secret AUTH_CASDOOR_ID=a387a4892ee19b1a2249 AUTH_CASDOOR_SECRET=dbf205949d704de81b0b5b3603174e23fbecc354 # MinIO S3 configuration -MINIO_ROOT_USER=YOUR_MINIO_USER +MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD # Configure the bucket information of MinIO +S3_PUBLIC_DOMAIN=http://localhost:9000 +S3_ENDPOINT=http://localhost:9000 MINIO_LOBE_BUCKET=lobe -S3_ACCESS_KEY_ID=soaucnP8Bip0TDdUjxng -S3_SECRET_ACCESS_KEY=ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO \ No newline at end of file + +# Configure for casdoor +origin=http://localhost:8000 \ No newline at end of file diff --git a/docker-compose/local/.env.zh-CN.example b/docker-compose/local/.env.zh-CN.example index f2e174e584991..326fef6141dd3 100644 --- a/docker-compose/local/.env.zh-CN.example +++ b/docker-compose/local/.env.zh-CN.example @@ -16,21 +16,26 @@ LOBE_PORT=3210 CASDOOR_PORT=8000 MINIO_PORT=9000 +APP_URL=http://localhost:3210 +AUTH_URL=http://localhost:3210/api/auth # Postgres 相关,也即 DB 必须的环境变量 LOBE_DB_NAME=lobechat POSTGRES_PASSWORD=uWNZugjBqixf8dxC +AUTH_CASDOOR_ISSUER=http://localhost:8000 # Casdoor secret AUTH_CASDOOR_ID=a387a4892ee19b1a2249 AUTH_CASDOOR_SECRET=dbf205949d704de81b0b5b3603174e23fbecc354 # MinIO S3 配置 -MINIO_ROOT_USER=YOUR_MINIO_USER +MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD # 在下方配置 minio 中添加的桶 +S3_PUBLIC_DOMAIN=http://localhost:9000 +S3_ENDPOINT=http://localhost:9000 MINIO_LOBE_BUCKET=lobe -S3_ACCESS_KEY_ID=soaucnP8Bip0TDdUjxng -S3_SECRET_ACCESS_KEY=ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO +# 为 casdoor 配置 +origin=http://localhost:8000 \ No newline at end of file diff --git a/docker-compose/local/docker-compose.yml b/docker-compose/local/docker-compose.yml index 60688983c1d03..78ebffc23905b 100644 --- a/docker-compose/local/docker-compose.yml +++ b/docker-compose/local/docker-compose.yml @@ -13,7 +13,7 @@ services: - lobe-network postgresql: - image: pgvector/pgvector:pg16 + image: pgvector/pgvector:pg17 container_name: lobe-postgres ports: - '5432:5432' @@ -38,13 +38,24 @@ services: volumes: - './s3_data:/etc/minio/data' environment: - - 'MINIO_ROOT_USER=${MINIO_ROOT_USER}' - - 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}' - - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:${LOBE_PORT}' + - 'MINIO_API_CORS_ALLOW_ORIGIN=*' + env_file: + - .env restart: always - command: > - server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001" - + entrypoint: > + /bin/sh -c " + minio server /etc/minio/data --address ':${MINIO_PORT}' --console-address ':9001' & + MINIO_PID=\$! + while ! curl -s http://localhost:${MINIO_PORT}/minio/health/live; do + echo 'Waiting for MinIO to start...' + sleep 1 + done + sleep 5 + mc alias set myminio http://localhost:${MINIO_PORT} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} + echo 'Creating bucket ${MINIO_LOBE_BUCKET}' + mc mb myminio/${MINIO_LOBE_BUCKET} + wait \$MINIO_PID + " casdoor: image: casbin/casdoor @@ -58,10 +69,11 @@ services: RUNNING_IN_DOCKER: 'true' driverName: 'postgres' dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor' - origin: 'http://localhost:${CASDOOR_PORT}' runmode: 'dev' volumes: - ./init_data.json:/init_data.json + env_file: + - .env lobe: image: lobehub/lobe-chat-database @@ -78,21 +90,60 @@ services: condition: service_started environment: - - 'APP_URL=http://localhost:3210' - 'NEXT_AUTH_SSO_PROVIDERS=casdoor' - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=' - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg' - - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth' - - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}' - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' - - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}' - 'S3_BUCKET=${MINIO_LOBE_BUCKET}' - - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}' - 'S3_ENABLE_PATH_STYLE=1' + - 'S3_ACCESS_KEY=${MINIO_ROOT_USER}' + - 'S3_ACCESS_KEY_ID=${MINIO_ROOT_USER}' + - 'S3_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}' - 'LLM_VISION_IMAGE_USE_BASE64=1' + - 'S3_SET_ACL=0' env_file: - .env restart: always + entrypoint: > + /bin/sh -c " + /bin/node /app/startServer.js & + LOBE_PID=\$! + sleep 3 + if [ $(wget --timeout=5 --spider --server-response ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then + echo '⚠️Warining: Unable to fetch OIDC configuration from Casdoor' + echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration' + echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + echo '⚠️注意:无法从 Casdoor 获取 OIDC 配置' + echo '请求 URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration' + echo '了解更多:https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + else + if ! wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep 'issuer' | grep ${AUTH_CASDOOR_ISSUER}; then + printf '❌Error: The Auth issuer is conflict, Issuer in OIDC configuration is: %s' \$(wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -E 'issuer.*' | awk -F '\"' '{print \$4}') + echo ' , but the issuer in .env file is: ${AUTH_CASDOOR_ISSUER} ' + echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration' + echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + printf '❌错误:Auth 的 issuer 冲突,OIDC 配置中的 issuer 是:%s' \$(wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -E 'issuer.*' | awk -F '\"' '{print \$4}') + echo ' , 但 .env 文件中的 issuer 是:${AUTH_CASDOOR_ISSUER} ' + echo '请求 URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration' + echo '了解更多:https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + fi + fi + if [ $(wget --timeout=5 --spider --server-response ${S3_ENDPOINT}/minio/health/live 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then + echo '⚠️Warining: Unable to fetch MinIO health status' + echo 'Request URL: ${S3_ENDPOINT}/minio/health/live' + echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + echo '⚠️注意:无法获取 MinIO 健康状态' + echo '请求 URL: ${S3_ENDPOINT}/minio/health/live' + echo '了解更多:https://lobehub.com/zh/docs/self-hosting/server-database/docker-compose#necessary-configuration' + echo '' + fi + wait \$LOBE_PID + " volumes: data: diff --git a/docker-compose/local/init_data.json b/docker-compose/local/init_data.json index c87d9c58baed4..be3c998bb59d3 100644 --- a/docker-compose/local/init_data.json +++ b/docker-compose/local/init_data.json @@ -32,13 +32,13 @@ "applications": [ { "owner": "admin", - "name": "app-built-in", + "name": "lobechat", "createdTime": "2024-09-09T09:26:06Z", "displayName": "LobeChat", "logo": "https://lobehub.com/icon-192x192.png", "homepageUrl": "https://lobehub.com", "description": "LobeChat", - "organization": "built-in", + "organization": "lobechat", "cert": "cert-built-in", "headerHtml": "", "enablePassword": true, @@ -230,7 +230,9 @@ "isCustom": false } ], - "grantTypes": ["authorization_code"], + "grantTypes": [ + "authorization_code" + ], "organizationObj": null, "certPublicKey": "", "tags": [], @@ -238,7 +240,12 @@ "isShared": false, "clientId": "a387a4892ee19b1a2249", "clientSecret": "dbf205949d704de81b0b5b3603174e23fbecc354", - "redirectUris": ["http://localhost:3210/api/auth/callback/casdoor"], + "redirectUris": [ + "http://localhost:3210/api/auth/callback/casdoor", + "https://localhost:3210/api/auth/callback/casdoor", + "http://example.com/api/auth/callback/casdoor", + "https://example.com/api/auth/callback/casdoor" + ], "tokenFormat": "JWT", "tokenSigningMethod": "", "tokenFields": [], @@ -352,12 +359,306 @@ "favicon": "https://cdn.casbin.org/img/casbin/favicon.ico", "passwordType": "plain", "passwordSalt": "", - "passwordOptions": ["AtLeast6"], - "countryCodes": ["US", "ES", "FR", "DE", "GB", "CN", "JP", "KR", "VN", "ID", "SG", "IN"], + "passwordOptions": [ + "AtLeast6" + ], + "countryCodes": [ + "US", + "ES", + "FR", + "DE", + "GB", + "CN", + "JP", + "KR", + "VN", + "ID", + "SG", + "IN" + ], + "defaultAvatar": "https://cdn.casbin.org/img/casbin.svg", + "defaultApplication": "", + "tags": [], + "languages": [ + "en", + "zh", + "es", + "fr", + "de", + "id", + "ja", + "ko", + "ru", + "vi", + "pt" + ], + "themeData": null, + "masterPassword": "", + "defaultPassword": "", + "masterVerificationCode": "", + "initScore": 2000, + "enableSoftDeletion": false, + "isProfilePublic": false, + "useEmailAsUsername": false, + "enableTour": true, + "mfaItems": null, + "accountItems": [ + { + "name": "Organization", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "ID", + "visible": true, + "viewRule": "Public", + "modifyRule": "Immutable", + "regex": "" + }, + { + "name": "Name", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Display name", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Avatar", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "User type", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Password", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Email", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Phone", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Country code", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Country/Region", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Location", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Affiliation", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Title", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Homepage", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Bio", + "visible": true, + "viewRule": "Public", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Tag", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Signup application", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Roles", + "visible": true, + "viewRule": "Public", + "modifyRule": "Immutable", + "regex": "" + }, + { + "name": "Permissions", + "visible": true, + "viewRule": "Public", + "modifyRule": "Immutable", + "regex": "" + }, + { + "name": "Groups", + "visible": true, + "viewRule": "Public", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "3rd-party logins", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Properties", + "visible": true, + "viewRule": "Admin", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Is admin", + "visible": true, + "viewRule": "Admin", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Is forbidden", + "visible": true, + "viewRule": "Admin", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Is deleted", + "visible": true, + "viewRule": "Admin", + "modifyRule": "Admin", + "regex": "" + }, + { + "name": "Multi-factor authentication", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "WebAuthn credentials", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "Managed accounts", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + }, + { + "name": "MFA accounts", + "visible": true, + "viewRule": "Self", + "modifyRule": "Self", + "regex": "" + } + ] + }, + { + "owner": "admin", + "name": "lobechat", + "createdTime": "2024-09-09T09:26:04Z", + "displayName": "LobeChat Organization", + "websiteUrl": "https://lobehub.com", + "logo": "https://lobehub.com/icon-192x192.png", + "logoDark": "", + "favicon": "https://lobehub.com/favicon.ico", + "passwordType": "plain", + "passwordSalt": "", + "passwordOptions": [ + "AtLeast6" + ], + "countryCodes": [ + "US", + "ES", + "FR", + "DE", + "GB", + "CN", + "JP", + "KR", + "VN", + "ID", + "SG", + "IN" + ], "defaultAvatar": "https://cdn.casbin.org/img/casbin.svg", "defaultApplication": "", "tags": [], - "languages": ["en", "zh", "es", "fr", "de", "id", "ja", "ko", "ru", "vi", "pt"], + "languages": [ + "en", + "zh", + "es", + "fr", + "de", + "id", + "ja", + "ko", + "ru", + "vi", + "pt" + ], "themeData": null, "masterPassword": "", "defaultPassword": "", @@ -590,15 +891,23 @@ "createdTime": "2024-09-09T09:26:04Z", "displayName": "Built-in Permission", "description": "Built-in Permission", - "users": ["built-in/*"], + "users": [ + "built-in/*" + ], "groups": [], "roles": [], "domains": [], "model": "user-model-built-in", "adapter": "", "resourceType": "Application", - "resources": ["app-built-in"], - "actions": ["Read", "Write", "Admin"], + "resources": [ + "app-built-in" + ], + "actions": [ + "Read", + "Write", + "Admin" + ], "effect": "Allow", "isEnabled": true, "submitter": "admin", @@ -640,7 +949,7 @@ "permanentAvatar": "", "email": "admin@example.com", "emailVerified": false, - "phone": "12345678910", + "phone": "13245678910", "countryCode": "US", "region": "", "location": "", @@ -771,7 +1080,159 @@ "managedAccounts": null, "mfaAccounts": null, "needUpdatePassword": false + }, + { + "owner": "lobechat", + "name": "user", + "createdTime": "2024-09-09T09:26:05Z", + "updatedTime": "", + "deletedTime": "", + "id": "b5a7c5b5-3e79-47ff-85a8-537b07fee2f9", + "externalId": "", + "type": "normal-user", + "password": "123", + "passwordSalt": "", + "passwordType": "plain", + "displayName": "User", + "firstName": "", + "lastName": "", + "avatar": "https://cdn.casbin.org/img/casbin.svg", + "avatarType": "", + "permanentAvatar": "", + "email": "user@example.com", + "emailVerified": false, + "phone": "13245678910", + "countryCode": "US", + "region": "", + "location": "", + "address": [], + "affiliation": "Example Inc.", + "title": "", + "idCardType": "", + "idCard": "", + "homepage": "", + "bio": "", + "tag": "staff", + "language": "", + "gender": "", + "birthday": "", + "education": "", + "score": 2000, + "karma": 0, + "ranking": 1, + "balance": 0, + "currency": "", + "isDefaultAvatar": false, + "isOnline": false, + "isAdmin": false, + "isForbidden": false, + "isDeleted": false, + "signupApplication": "lobechat", + "hash": "", + "preHash": "", + "accessKey": "", + "accessSecret": "", + "accessToken": "", + "createdIp": "127.0.0.1", + "lastSigninTime": "", + "lastSigninIp": "", + "github": "", + "google": "", + "qq": "", + "wechat": "", + "facebook": "", + "dingtalk": "", + "weibo": "", + "gitee": "", + "linkedin": "", + "wecom": "", + "lark": "", + "gitlab": "", + "adfs": "", + "baidu": "", + "alipay": "", + "casdoor": "", + "infoflow": "", + "apple": "", + "azuread": "", + "azureadb2c": "", + "slack": "", + "steam": "", + "bilibili": "", + "okta": "", + "douyin": "", + "line": "", + "amazon": "", + "auth0": "", + "battlenet": "", + "bitbucket": "", + "box": "", + "cloudfoundry": "", + "dailymotion": "", + "deezer": "", + "digitalocean": "", + "discord": "", + "dropbox": "", + "eveonline": "", + "fitbit": "", + "gitea": "", + "heroku": "", + "influxcloud": "", + "instagram": "", + "intercom": "", + "kakao": "", + "lastfm": "", + "mailru": "", + "meetup": "", + "microsoftonline": "", + "naver": "", + "nextcloud": "", + "onedrive": "", + "oura": "", + "patreon": "", + "paypal": "", + "salesforce": "", + "shopify": "", + "soundcloud": "", + "spotify": "", + "strava": "", + "stripe": "", + "tiktok": "", + "tumblr": "", + "twitch": "", + "twitter": "", + "typetalk": "", + "uber": "", + "vk": "", + "wepay": "", + "xero": "", + "yahoo": "", + "yammer": "", + "yandex": "", + "zoom": "", + "metamask": "", + "web3onboard": "", + "custom": "", + "webauthnCredentials": null, + "preferredMfaType": "", + "recoveryCodes": null, + "totpSecret": "", + "mfaPhoneEnabled": false, + "mfaEmailEnabled": false, + "invitation": "", + "invitationCode": "", + "faceIds": null, + "ldap": "", + "properties": {}, + "roles": null, + "permissions": null, + "groups": null, + "lastSigninWrongTime": "", + "signinWrongTimes": 0, + "managedAccounts": null, + "mfaAccounts": null, + "needUpdatePassword": false } ], "webhooks": [] -} +} \ No newline at end of file diff --git a/docker-compose/local/s3_data.tar.gz b/docker-compose/local/s3_data.tar.gz deleted file mode 100644 index 7174fb563f406..0000000000000 Binary files a/docker-compose/local/s3_data.tar.gz and /dev/null differ diff --git a/docker-compose/local/setup.sh b/docker-compose/local/setup.sh deleted file mode 100644 index 903eb209b8b8e..0000000000000 --- a/docker-compose/local/setup.sh +++ /dev/null @@ -1,365 +0,0 @@ -#!/bin/bash - -# ================== -# == Env settings == -# ================== - -# ====================== -# == Process the args == -# ====================== - -# 1. Default values of arguments -# Arg: -f -# Determine force download asserts, default is not -FORCE_DOWNLOAD=false - -# Arg: -l or --lang -# Determine the language to show, default is en -LANGUAGE="en_US" - -# Arg: --url -# Determine the source URL to download files -SOURCE_URL="https://raw.githubusercontent.com/lobehub/lobe-chat/main" - -# Arg: --host -# Determine the server host -HOST="" - -# 2. Parse script arguments -while getopts "fl:-:" opt; do - case $opt in - f) - FORCE_DOWNLOAD=true - ;; - l) - LANGUAGE=$OPTARG - ;; - -) - case "${OPTARG}" in - lang) - LANGUAGE="${!OPTIND}" - OPTIND=$(($OPTIND + 1)) - ;; - url) - SOURCE_URL="${!OPTIND}" - OPTIND=$(($OPTIND + 1)) - ;; - host) - HOST="${!OPTIND}" - OPTIND=$(($OPTIND + 1)) - ;; - *) - echo "Usage: $0 [-f] [-l language|--lang language] [--url source] [--host serverhost]" >&2 - exit 1 - ;; - esac - ;; - *) - echo "Usage: $0 [-f] [-l language|--lang language] [--url source]" >&2 - exit 1 - ;; - esac -done - -# =============== -# == Variables == -# =============== -# File list -SUB_DIR="docker-compose/local" -FILES=( - "$SUB_DIR/docker-compose.yml" - "$SUB_DIR/.env.example" - "$SUB_DIR/init_data.json" - "$SUB_DIR/s3_data.tar.gz" -) - -# Supported languages and messages -# Arg: -l --lang -# If the language is not supported, default to English -# Function to show messages -show_message() { - local key="$1" - case $key in - downloading) - case $LANGUAGE in - zh_CN) - echo "正在下载文件..." - ;; - *) - echo "Downloading files..." - ;; - esac - ;; - downloaded) - case $LANGUAGE in - zh_CN) - echo " 已经存在,跳过下载。" - ;; - *) - echo " already exists, skipping download." - ;; - esac - ;; - extracted_success) - case $LANGUAGE in - zh_CN) - echo " 解压成功到目录:" - ;; - *) - echo " extracted successfully to directory: " - ;; - esac - ;; - extracted_failed) - case $LANGUAGE in - zh_CN) - echo " 解压失败。" - ;; - *) - echo " extraction failed." - ;; - esac - ;; - file_not_exists) - case $LANGUAGE in - zh_CN) - echo " 不存在。" - ;; - *) - echo " does not exist." - ;; - esac - ;; - security_secrect_regenerate) - case $LANGUAGE in - zh_CN) - echo "重新生成安全密钥..." - ;; - *) - echo "Regenerate security secrets..." - ;; - esac - ;; - security_secrect_regenerate_failed) - case $LANGUAGE in - zh_CN) - echo "无法重新生成安全密钥:" - ;; - *) - echo "Failed to regenerate security secrets: " - ;; - esac - ;; - security_secrect_regenerate_report) - case $LANGUAGE in - zh_CN) - echo "安全密钥生成结果如下:" - ;; - *) - echo "Security secret generation results are as follows:" - ;; - esac - ;; - tips_run_command) - case $LANGUAGE in - zh_CN) - echo "您已经完成了所有配置。请运行以下命令启动LobeChat:" - ;; - *) - echo "You have completed all configurations. Please run this command to start LobeChat:" - ;; - esac - ;; - tips_show_documentation) - case $LANGUAGE in - zh_CN) - echo "完整的环境变量在'.env'中可以在文档中找到:" - ;; - *) - echo "Full environment variables in the '.env' can be found at the documentation on " - ;; - esac - ;; - tips_show_documentation_url) - case $LANGUAGE in - zh_CN) - echo "https://lobehub.com/zh/docs/self-hosting/environment-variables" - ;; - *) - echo "https://lobehub.com/docs/self-hosting/environment-variables" - ;; - esac - ;; - tips_warning) - case $LANGUAGE in - zh_CN) - echo "警告:如果你正在生产环境中使用,请在日志中检查密钥是否已经生成!!!" - ;; - *) - echo "Warning: If you are using it in a production environment, please check if the keys have been generated in the logs!!!" - ;; - esac - ;; - esac -} - -# Function to download files -download_file() { - local file_url="$1" - local local_file="$2" - - if [ "$FORCE_DOWNLOAD" = false ] && [ -e "$local_file" ]; then - echo "$local_file" $(show_message "downloaded") - return 0 - fi - - wget -q --show-progress "$file_url" -O "$local_file" -} - -extract_file() { - local file_name=$1 - local target_dir=$2 - - if [ -e "$file_name" ]; then - tar -zxvf "$file_name" -C "$target_dir" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "$file_name" $(show_message "extracted_success") "$target_dir" - else - echo "$file_name" $(show_message "extracted_failed") - exit 1 - fi - else - echo "$file_name" $(show_message "file_not_exists") - exit 1 - fi -} - -# Define colors -declare -A colors -colors=( - [black]="\e[30m" - [red]="\e[31m" - [green]="\e[32m" - [yellow]="\e[33m" - [blue]="\e[34m" - [magenta]="\e[35m" - [cyan]="\e[36m" - [white]="\e[37m" - [reset]="\e[0m" -) - -print_centered() { - local text="$1" # Get input texts - local color="${2:-reset}" # Get color, default to reset - local term_width=$(tput cols) # Get terminal width - local text_length=${#text} # Get text length - local padding=$(((term_width - text_length) / 2)) # Get padding - # Check if the color is valid - if [[ -z "${colors[$color]}" ]]; then - echo "Invalid color specified. Available colors: ${!colors[@]}" - return 1 - fi - # Print the text with padding - printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text" -} - -# Download files asynchronously -download_file "$SOURCE_URL/${FILES[0]}" "docker-compose.yml" -download_file "$SOURCE_URL/${FILES[1]}" ".env" -download_file "$SOURCE_URL/${FILES[2]}" "init_data.json" -download_file "$SOURCE_URL/${FILES[3]}" "s3_data.tar.gz" - -# Extract .tar.gz file without output -extract_file "s3_data.tar.gz" "." -rm s3_data.tar.gz - -# ========================== -# === Regenerate Secrets === -# ========================== - -generate_key() { - if [[ -z "$1" ]]; then - echo "Usage: generate_key " - return 1 - fi - echo $(openssl rand -hex $1 | tr -d '\n' | fold -w $1 | head -n 1) -} - -echo $(show_message "security_secrect_regenerate") - -# Generate CASDOOR_SECRET -CASDOOR_SECRET=$(generate_key 32) -if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_SECRET" -else - # Search and replace the value of CASDOOR_SECRET in .env - sed -i "s#^AUTH_CASDOOR_SECRET=.*#AUTH_CASDOOR_SECRET=${CASDOOR_SECRET}#" .env - if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`.env\`" - fi - # replace `clientSecrect` in init_data.json - sed -i "s#dbf205949d704de81b0b5b3603174e23fbecc354#${CASDOOR_SECRET}#" init_data.json - if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`init_data.json\`" - fi -fi - -# Generate Casdoor User -CASDOOR_USER="admin" -CASDOOR_PASSWORD=$(generate_key 6) -if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD" -else - # replace `password` in init_data.json - sed -i "s/"123"/${CASDOOR_PASSWORD}/" init_data.json - if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD in \`init_data.json\`" - fi -fi - -# Generate Minio S3 access key -# Temporarily disable key gen for minio because -# minio can not start with a access key in envs -#S3_SECRET_ACCESS_KEY=$(generate_key 32) -#if [ $? -ne 0 ]; then -# echo $(show_message "security_secrect_regenerate_failed") "S3_SECRET_ACCESS_KEY" -#else -# # Search and replace the value of S3_SECRET_ACCESS_KEY in .env -# sed -i "s#^S3_SECRET_ACCESS_KEY=.*#S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}#" .env -# if [ $? -ne 0 ]; then -# echo $(show_message "security_secrect_regenerate_failed") "S3_SECRET_ACCESS_KEY in \`.env\`" -# fi -#fi - -# Modify the .env file if the host is specified -if [ -n "$HOST" ]; then - # Modify env - sed -i "s/localhost/$HOST/g" .env - if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "HOST in \`.env\`" - fi - # Modify casdoor init data - sed -i "s/localhost/$HOST/g" init_data.json - if [ $? -ne 0 ]; then - echo $(show_message "security_secrect_regenerate_failed") "HOST in \`init_data.json\`" - fi -fi - -# Display configuration reports - -echo $(show_message "security_secrect_regenerate_report") - -if [ -n "$HOST" ]; then - echo -e "Server Host: $HOST" -fi -echo -e "Casdoor: \n - Username: admin\n - Password: ${CASDOOR_PASSWORD}\n - Client Secret: ${CASDOOR_SECRET}" - -# =========================== -# == Display final message == -# =========================== - -printf "\n%s\n\n" "$(show_message "tips_run_command")" -print_centered "docker compose up -d" "green" -printf "\n%s" "$(show_message "tips_show_documentation")" -printf "%s\n" $(show_message "tips_show_documentation_url") -printf "\n\e[33m%s\e[0m\n" "$(show_message "tips_warning")" diff --git a/docker-compose/setup.sh b/docker-compose/setup.sh new file mode 100644 index 0000000000000..c52770aac8ab4 --- /dev/null +++ b/docker-compose/setup.sh @@ -0,0 +1,660 @@ +#!/bin/bash + +# ================== +# == Env settings == +# ================== + +# check operating system +# ref: https://github.com/lobehub/lobe-chat/pull/5247 +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS + SED_COMMAND="sed -i ''" +else + # not macOS + SED_COMMAND="sed -i" +fi + +# ====================== +# == Process the args == +# ====================== + +# 1. Default values of arguments + +# Arg: -l or --lang +# Determine the language to show, default is en + +# Arg: --url +# Determine the source URL to download files +SOURCE_URL="https://raw.githubusercontent.com/lobehub/lobe-chat/main" + +# Arg: --host +# Determine the server host +HOST="" + +# 2. Parse script arguments +while getopts "l:-:" opt; do + case $opt in + l) + LANGUAGE=$OPTARG + ;; + -) + case "${OPTARG}" in + lang) + LANGUAGE="${!OPTIND}" + OPTIND=$(($OPTIND + 1)) + ;; + url) + SOURCE_URL="${!OPTIND}" + OPTIND=$(($OPTIND + 1)) + ;; + host) + HOST="${!OPTIND}" + OPTIND=$(($OPTIND + 1)) + ;; + *) + echo "Usage: $0 [-l language|--lang language] [--url source] [--host serverhost]" >&2 + exit 1 + ;; + esac + ;; + *) + echo "Usage: $0 [-l language|--lang language] [--url source]" >&2 + exit 1 + ;; + esac +done + +####################### +## Helper Functions ## +####################### + +# Supported languages and messages +# Arg: -l --lang +# If the language is not supported, default to English +# Function to show messages +show_message() { + local key="$1" + case $key in + choose_language) + echo "Please choose a language / 请选择语言:" + echo "(0) English" + echo "(1) 简体中文" + ;; + downloading) + case $LANGUAGE in + zh_CN) + echo "正在下载文件..." + ;; + *) + echo "Downloading files..." + ;; + esac + ;; + extracted_success) + case $LANGUAGE in + zh_CN) + echo " 解压成功到目录:" + ;; + *) + echo " extracted successfully to directory: " + ;; + esac + ;; + extracted_failed) + case $LANGUAGE in + zh_CN) + echo " 解压失败。" + ;; + *) + echo " extraction failed." + ;; + esac + ;; + file_not_exists) + case $LANGUAGE in + zh_CN) + echo " 不存在。" + ;; + *) + echo " does not exist." + ;; + esac + ;; + security_secrect_regenerate) + case $LANGUAGE in + zh_CN) + echo "重新生成安全密钥..." + ;; + *) + echo "Regenerate security secrets..." + ;; + esac + ;; + security_secrect_regenerate_failed) + case $LANGUAGE in + zh_CN) + echo "无法重新生成安全密钥:" + ;; + *) + echo "Failed to regenerate security secrets: " + ;; + esac + ;; + host_regenerate) + case $LANGUAGE in + zh_CN) + echo "✔️ 已更新部署模式配置" + ;; + *) + echo "✔️ Updated deployment mode configuration" + ;; + esac + ;; + host_regenerate_failed) + case $LANGUAGE in + zh_CN) + echo "无法重新生成服务器域名:" + ;; + *) + echo "Failed to regenerate server host: " + ;; + esac + ;; + security_secrect_regenerate_report) + case $LANGUAGE in + zh_CN) + echo "安全密钥生成结果如下:" + ;; + *) + echo "Security secret generation results are as follows:" + ;; + esac + ;; + tips_already_installed) + case $LANGUAGE in + zh_CN) + echo "检测到您已经运行过 LobeChat Database,本安装程序只能完成初始化配置,并不能重复安装。如果你需要重新安装,请删除 data 和 s3_data 文件夹。" + ;; + *) + echo "It is detected that you have run LobeChat Database. This installation program can only complete the initialization configuration and cannot be reinstalled. If you need to reinstall, please delete the data and s3_data folders." + ;; + esac + ;; + tips_run_command) + case $LANGUAGE in + zh_CN) + echo "您已经完成了所有配置。请运行以下命令启动LobeChat:" + ;; + *) + echo "You have completed all configurations. Please run this command to start LobeChat:" + ;; + esac + ;; + tips_show_documentation) + case $LANGUAGE in + zh_CN) + echo "完整的环境变量在'.env'中可以在文档中找到:" + ;; + *) + echo "Full environment variables in the '.env' can be found at the documentation on " + ;; + esac + ;; + tips_show_documentation_url) + case $LANGUAGE in + zh_CN) + echo "https://lobehub.com/zh/docs/self-hosting/environment-variables" + ;; + *) + echo "https://lobehub.com/docs/self-hosting/environment-variables" + ;; + esac + ;; + tips_no_executable) + case $LANGUAGE in + zh_CN) + echo "没有找到,请先安装。" + ;; + *) + echo "not found, please install it first." + ;; + esac + ;; + tips_allow_ports) + case $LANGUAGE in + zh_CN) + echo "请确保服务器以下端口未被占用且能被访问:3210, 9000, 9001, 8000" + ;; + *) + echo "Please make sure the following ports on the server are not occupied and can be accessed: 3210, 9000, 9001, 8000" + ;; + esac + ;; + tips_auto_detected) + case $LANGUAGE in + zh_CN) + echo "已自动识别" + ;; + *) + echo "Auto-detected" + ;; + esac + ;; + tips_private_ip_detected) + case $LANGUAGE in + zh_CN) + echo "注意,当前识别到内网 IP,如果需要外部访问,请替换为公网 IP 地址" + ;; + *) + echo "Note that the current internal IP is detected. If you need external access, please replace it with the public IP address." + ;; + esac + ;; + tips_add_reverse_proxy) + case $LANGUAGE in + zh_CN) + echo "请在你的反向代理中完成域名到端口的映射:" + ;; + *) + echo "Please complete the mapping of domain to port in your reverse proxy:" + ;; + esac + ;; + ask_regenerate_secrets) + case $LANGUAGE in + zh_CN) + echo "是否要重新生成安全密钥?" + ;; + *) + echo "Do you want to regenerate security secrets?" + ;; + esac + ;; + ask_deploy_mode) + case $LANGUAGE in + zh_CN) + echo "请选择部署模式:" + echo "(0) 域名模式(访问时无需指明端口),需要使用反向代理服务 LobeChat, MinIO, Casdoor ,并分别分配一个域名;" + echo "(1) 端口模式(访问时需要指明端口,如使用IP访问,或域名+端口访问),需要放开指定端口;" + echo "(2) 本地模式(仅供本地测试使用)" + echo "如果你对这些内容疑惑,可以先选择使用本地模式进行部署,稍后根据文档指引再进行修改。" + echo "https://lobehub.com/docs/self-hosting/server-database/docker-compose" + ;; + *) + echo "Please select the deployment mode:" + echo "(0) Domain mode (no need to specify the port when accessing), you need to use the reverse proxy service LobeChat, MinIO, Casdoor, and assign a domain name respectively;" + echo "(1) Port mode (need to specify the port when accessing, such as using IP access, or domain name + port access), you need to open the specified port;" + echo "(2) Local mode (for local testing only)" + echo "If you are confused about these contents, you can choose to deploy in local mode first, and then modify according to the document guide later." + echo "https://lobehub.com/docs/self-hosting/server-database/docker-compose" + ;; + esac + ;; + ask_host) + case $LANGUAGE in + zh_CN) + echo " 部署IP/域名" + ;; + *) + echo " Deploy IP/Domain" + ;; + esac + ;; + ask_domain) + case $LANGUAGE in + zh_CN) + echo "服务的域名(例如 $2 ,不要包含协议前缀):" + ;; + *) + echo "The domain of the service (e.g. $2, do not include the protocol prefix):" + ;; + esac + ;; + ask_protocol) + case $LANGUAGE in + zh_CN) + echo "域名是否使用 https 协议? (所有服务需要使用同一协议)" + ;; + *) + echo "Does the domain use the https protocol? (All services need to use the same protocol)" + ;; + esac + ;; + esac +} + +# Function to download files +download_file() { + wget -q --show-progress "$1" -O "$2" +} + +print_centered() { + # Define colors + declare -A colors + colors=( + [black]="\e[30m" + [red]="\e[31m" + [green]="\e[32m" + [yellow]="\e[33m" + [blue]="\e[34m" + [magenta]="\e[35m" + [cyan]="\e[36m" + [white]="\e[37m" + [reset]="\e[0m" + ) + local text="$1" # Get input texts + local color="${2:-reset}" # Get color, default to reset + local term_width=$(tput cols) # Get terminal width + local text_length=${#text} # Get text length + local padding=$(((term_width - text_length) / 2)) # Get padding + # Check if the color is valid + if [[ -z "${colors[$color]}" ]]; then + echo "Invalid color specified. Available colors: ${!colors[@]}" + return 1 + fi + # Print the text with padding + printf "%*s${colors[$color]}%s${colors[reset]}\n" $padding "" "$text" +} + +# Usage: +# ```sh +# ask "prompt" "default" "description" +# echo $ask_result +# ``` +# "prompt" ["description" "default"]: +ask() { + local prompt="$1" + local default="$2" + local description="$3" + # Add a space after the description if it is not empty + if [ -n "$description" ]; then + description="$description " + fi + local result + + if [ -n "$default" ]; then + read -p "$prompt [${description}${default}]: " result + result=${result:-$default} + else + read -p "$prompt: " result + fi + # trim and assign to global variable + ask_result=$(echo "$result" | xargs) +} + +#################### +## Main Process ## +#################### + +# =============== +# == Variables == +# =============== +# File list +SUB_DIR="docker-compose/local" +FILES=( + "$SUB_DIR/docker-compose.yml" + "$SUB_DIR/init_data.json" +) +ENV_EXAMPLES=( + "$SUB_DIR/.env.zh-CN.example" + "$SUB_DIR/.env.example" +) +# Default values +CASDOOR_PASSWORD="123" +CASDOOR_SECRET="CASDOOR_SECRET" +MINIO_ROOT_PASSWORD="YOUR_MINIO_PASSWORD" +CASDOOR_HOST="localhost:8000" +MINIO_HOST="localhost:9000" +PROTOCOL="http" + +# If no language is specified, ask the user to choose +if [ -z "$LANGUAGE" ]; then + show_message "choose_language" + ask "(0,1)" "0" + case $ask_result in + 0) + LANGUAGE="en_US" + ;; + 1) + LANGUAGE="zh_CN" + ;; + *) + echo "Invalid language: $ask_result" + exit 1 + ;; + esac +fi + +section_download_files(){ + # Download files asynchronously + if ! command -v wget &> /dev/null ; then + echo "wget" $(show_message "tips_no_executable") + exit 1 + fi + + download_file "$SOURCE_URL/${FILES[0]}" "docker-compose.yml" + download_file "$SOURCE_URL/${FILES[1]}" "init_data.json" + + # Download .env.example with the specified language + if [ "$LANGUAGE" = "zh_CN" ]; then + download_file "$SOURCE_URL/${ENV_EXAMPLES[0]}" ".env" + else + download_file "$SOURCE_URL/${ENV_EXAMPLES[1]}" ".env" + fi +} +# If the folder `data` or `s3_data` exists, warn the user +if [ -d "data" ] || [ -d "s3_data" ]; then + show_message "tips_already_installed" + exit 0 +else + section_download_files +fi + +section_configurate_host() { + DEPLOY_MODE=$ask_result + show_message "host_regenerate" + # If run in local mode, skip this step + if [[ "$DEPLOY_MODE" == "2" ]]; then + HOST="localhost:3210" + LOBE_HOST="$HOST" + return 0 + fi + + # Configurate protocol for domain + if [[ "$DEPLOY_MODE" == "0" ]]; then + # Ask if enable https + echo $(show_message "ask_protocol") + ask "(y/n)" "y" + if [[ "$ask_result" == "y" ]]; then + PROTOCOL="https" + # Replace all http with https + $SED_COMMAND "s#http://#https://#" .env + fi + fi + + # Check if sed is installed + if ! command -v $SED_COMMAND &> /dev/null ; then + echo "sed" $(show_message "tips_no_executable") + exit 1 + fi + + # If user not specify host, try to get the server ip + if [ -z "$HOST" ]; then + HOST=$(hostname -I | awk '{print $1}') + # If the host is a private ip and the deploy mode is port mode + if [[ "$DEPLOY_MODE" == "1" ]] && ([[ "$HOST" == "192.168."* ]] || [[ "$HOST" == "172."* ]] || [[ "$HOST" == "10."* ]]); then + echo $(show_message "tips_private_ip_detected") + fi + fi + + + case $DEPLOY_MODE in + 0) + DEPLOY_MODE="domain" + echo "LobeChat" $(show_message "ask_domain" "example.com") + ask "(example.com)" + LOBE_HOST="$ask_result" + # If user use domain mode, ask for the domain of Minio and Casdoor + echo "Minio S3 API" $(show_message "ask_domain" "minio.example.com") + ask "(minio.example.com)" + MINIO_HOST="$ask_result" + echo "Casdoor API" $(show_message "ask_domain" "auth.example.com") + ask "(auth.example.com)" + CASDOOR_HOST="$ask_result" + # Setup callback url for Casdoor + $SED_COMMAND "s/"example.com"/${LOBE_HOST}/" init_data.json + ;; + 1) + DEPLOY_MODE="ip" + ask $(printf "%s%s" "LobeChat" $(show_message "ask_host")) "$HOST" $(printf "%s" $(show_message "tips_auto_detected")) + LOBE_HOST="$ask_result" + # If user use ip mode, use ask_result as the host + HOST="$ask_result" + # If user use ip mode, append the port to the host + LOBE_HOST="${HOST}:3210" + MINIO_HOST="${HOST}:9000" + CASDOOR_HOST="${HOST}:8000" + # Setup callback url for Casdoor + $SED_COMMAND "s/"localhost:3210"/${LOBE_HOST}/" init_data.json + ;; + *) + echo "Invalid deploy mode: $ask_result" + exit 1 + ;; + esac + + # lobe host + $SED_COMMAND "s#^APP_URL=.*#APP_URL=$PROTOCOL://$LOBE_HOST#" .env + # auth related + $SED_COMMAND "s#^AUTH_URL=.*#AUTH_URL=$PROTOCOL://$LOBE_HOST/api/auth#" .env + $SED_COMMAND "s#^AUTH_CASDOOR_ISSUER=.*#AUTH_CASDOOR_ISSUER=$PROTOCOL://$CASDOOR_HOST#" .env + $SED_COMMAND "s#^origin=.*#origin=$PROTOCOL://$CASDOOR_HOST#" .env + # s3 related + $SED_COMMAND "s#^S3_PUBLIC_DOMAIN=.*#S3_PUBLIC_DOMAIN=$PROTOCOL://$MINIO_HOST#" .env + $SED_COMMAND "s#^S3_ENDPOINT=.*#S3_ENDPOINT=$PROTOCOL://$MINIO_HOST#" .env + + + # Check if env modified success + if [ $? -ne 0 ]; then + echo $(show_message "host_regenerate_failed") "$HOST in \`.env\`" + fi +} +show_message "ask_deploy_mode" +ask "(0,1,2)" "2" +if [[ "$ask_result" == "0" ]] || [[ "$ask_result" == "1" ]] || [[ "$ask_result" == "2" ]]; then + section_configurate_host +else + echo "Invalid deploy mode: $ask_result, please select 0, 1 or 2." + exit 1 +fi + +# ========================== +# === Regenerate Secrets === +# ========================== +section_regenerate_secrets() { + # Check if openssl is installed + if ! command -v openssl &> /dev/null ; then + echo "openssl" $(show_message "tips_no_executable") + exit 1 + fi + if ! command -v tr &> /dev/null ; then + echo "tr" $(show_message "tips_no_executable") + exit 1 + fi + if ! command -v fold &> /dev/null ; then + echo "fold" $(show_message "tips_no_executable") + exit 1 + fi + if ! command -v head &> /dev/null ; then + echo "head" $(show_message "tips_no_executable") + exit 1 + fi + + generate_key() { + if [[ -z "$1" ]]; then + echo "Usage: generate_key " + return 1 + fi + echo $(openssl rand -hex $1 | tr -d '\n' | fold -w $1 | head -n 1) + } + + if ! command -v sed &> /dev/null ; then + echo "sed" $(show_message "tips_no_executable") + exit 1 + fi + echo $(show_message "security_secrect_regenerate") + + # Generate CASDOOR_SECRET + CASDOOR_SECRET=$(generate_key 32) + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_SECRET" + else + # Search and replace the value of CASDOOR_SECRET in .env + $SED_COMMAND "s#^AUTH_CASDOOR_SECRET=.*#AUTH_CASDOOR_SECRET=${CASDOOR_SECRET}#" .env + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`.env\`" + fi + # replace `clientSecrect` in init_data.json + $SED_COMMAND "s#dbf205949d704de81b0b5b3603174e23fbecc354#${CASDOOR_SECRET}#" init_data.json + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`init_data.json\`" + fi + fi + + # Generate Casdoor User + CASDOOR_USER="admin" + CASDOOR_PASSWORD=$(generate_key 10) + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD" + CASDOOR_PASSWORD="123" + else + # replace `password` in init_data.json + $SED_COMMAND "s/"123"/${CASDOOR_PASSWORD}/" init_data.json + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD in \`init_data.json\`" + fi + fi + # Generate Minio S3 User Password + MINIO_ROOT_PASSWORD=$(generate_key 8) + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "MINIO_ROOT_PASSWORD" + MINIO_ROOT_PASSWORD="YOUR_MINIO_PASSWORD" + else + # Search and replace the value of S3_SECRET_ACCESS_KEY in .env + $SED_COMMAND "s#^MINIO_ROOT_PASSWORD=.*#MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}#" .env + if [ $? -ne 0 ]; then + echo $(show_message "security_secrect_regenerate_failed") "MINIO_ROOT_PASSWORD in \`.env\`" + fi + fi +} +show_message "ask_regenerate_secrets" +ask "(y/n)" "y" +if [[ "$ask_result" == "y" ]]; then + section_regenerate_secrets +fi + +section_display_configurated_report() { + # Display configuration reports + echo $(show_message "security_secrect_regenerate_report") + + echo -e "LobeChat: \n - URL: $PROTOCOL://$LOBE_HOST \n - Username: user \n - Password: ${CASDOOR_PASSWORD} " + echo -e "Casdoor: \n - URL: $PROTOCOL://$CASDOOR_HOST \n - Username: admin \n - Password: ${CASDOOR_PASSWORD}\n" + echo -e "Minio: \n - URL: $PROTOCOL://$MINIO_HOST \n - Username: admin\n - Password: ${MINIO_ROOT_PASSWORD}\n" + + # if user run in domain mode, diplay reverse proxy configuration + if [[ "$DEPLOY_MODE" == "domain" ]]; then + echo $(show_message "tips_add_reverse_proxy") + printf "\n%s\t->\t%s\n" "$LOBE_HOST" "127.0.0.1:3210" + printf "%s\t->\t%s\n" "$CASDOOR_HOST" "127.0.0.1:8000" + printf "%s\t->\t%s\n" "$MINIO_HOST" "127.0.0.1:9000" + fi + + # Display final message + + printf "\n%s\n\n" "$(show_message "tips_run_command")" + print_centered "docker compose up -d" "green" + printf "\n%s\n" "$(show_message "tips_allow_ports")" + printf "\n%s" "$(show_message "tips_show_documentation")" + printf "%s\n" $(show_message "tips_show_documentation_url") +} +section_display_configurated_report \ No newline at end of file diff --git a/docs/changelog/2023-09-09-plugin-system.mdx b/docs/changelog/2023-09-09-plugin-system.mdx index b1ad1e858f9e7..9ef28b4b006f9 100644 --- a/docs/changelog/2023-09-09-plugin-system.mdx +++ b/docs/changelog/2023-09-09-plugin-system.mdx @@ -4,6 +4,11 @@ description: >- Discover how the LobeChat plugin ecosystem enhances the utility and flexibility of the LobeChat assistant, along with the development resources and plugin development guidelines provided. +tags: + - LobeChat + - Plugins + - Real-time Information + - Voice Options --- # Supported Plugin System diff --git a/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx b/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx index a9cb9ce79f205..2e43186c8acb3 100644 --- a/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx +++ b/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 插件生态系统 - 功能扩展与开发资源 description: 了解 LobeChat 插件生态系统如何增强 LobeChat 助手的实用性和灵活性,以及提供的开发资源和插件开发指南。 +tags: + - LobeChat + - 插件系统 + - 实时信息 + - 第三方服务 --- # 支持插件系统 diff --git a/docs/changelog/2023-11-14-gpt4-vision.mdx b/docs/changelog/2023-11-14-gpt4-vision.mdx index bc92396e5f895..e62c5941a597f 100644 --- a/docs/changelog/2023-11-14-gpt4-vision.mdx +++ b/docs/changelog/2023-11-14-gpt4-vision.mdx @@ -7,6 +7,12 @@ description: >- capabilities, allowing users to upload or drag and drop images. The assistant will recognize the content and engage in intelligent dialogue, creating a more intelligent and diverse chat environment. +tags: + - Visual Recognition + - LobeChat + - GPT-4 Vision + - Google Gemini Pro + - Multimodal Interaction --- # Supported Models for Visual Recognition diff --git a/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx b/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx index 3b9400b461b87..8aeca20562d81 100644 --- a/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx +++ b/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 支持多模态交互:视觉识别助力智能对话 description: LobeChat 支持多种具有视觉识别能力的大语言模型,用户可上传或拖拽图片,助手将识别内容并展开智能对话,打造更智能、多元化的聊天场景。 +tags: + - 视觉识别 + - 多模态交互 + - LobeChat + - GPT-4 + - Google Gemini Pro --- # 支持模型视觉识别 diff --git a/docs/changelog/2023-11-19-tts-stt.mdx b/docs/changelog/2023-11-19-tts-stt.mdx index eb622b94c6368..8d3124f55943d 100644 --- a/docs/changelog/2023-11-19-tts-stt.mdx +++ b/docs/changelog/2023-11-19-tts-stt.mdx @@ -4,6 +4,12 @@ description: >- LobeChat supports Text-to-Speech (TTS) and Speech-to-Text (STT) technologies, offering high-quality voice options for a personalized communication experience. Learn more about Lobe TTS Toolkit. +tags: + - TTS + - STT + - Voice Conversations + - LobeChat + - Audio Technology --- # Supporting TTS & STT Voice Conversations diff --git a/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx b/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx index 5a400a3ad07b6..9a7c789c24316 100644 --- a/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx +++ b/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx @@ -1,6 +1,13 @@ --- title: LobeChat 文生图:文本转图片生成技术 description: LobeChat 支持文字转语音(TTS)和语音转文字(STT)技术,提供高品质声音选项,个性化交流体验。了解更多关于 Lobe TTS 工具包。 +tags: + - TTS + - STT + - 语音会话 + - LobeChat + - 文字转语音 + - 语音转文字 --- # 支持 TTS & STT 语音会话 diff --git a/docs/changelog/2023-12-22-dalle-3.mdx b/docs/changelog/2023-12-22-dalle-3.mdx index 0c672ab6a6b59..fc1d742b5cffc 100644 --- a/docs/changelog/2023-12-22-dalle-3.mdx +++ b/docs/changelog/2023-12-22-dalle-3.mdx @@ -6,6 +6,12 @@ description: >- assistant for creative purposes. By utilizing AI tools such as DALL-E 3, MidJourney, and Pollinations, assistants can turn your ideas into images, making the creative process more intimate and immersive. +tags: + - Text-to-Image + - LobeChat + - AI Tools + - DALL-E 3 + - MidJourney --- # Support for Text-to-Image Generation diff --git a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx index 714f699dc1864..c14d1d988762f 100644 --- a/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +++ b/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 文生图:文本转图片生成技术 description: >- LobeChat 现在支持最新的文本到图片生成技术,让用户可以在与助手对话中直接调用文生图工具进行创作。利用 DALL-E 3、MidJourney 和 Pollinations 等 AI 工具,助手们可以将你的想法转化为图像,让创作过程更私密和沉浸式。 +tags: + - Text to Image + - 文生图 + - AI 创作 --- # 支持 Text to Image 文生图 diff --git a/docs/changelog/2024-02-08-sso-oauth.mdx b/docs/changelog/2024-02-08-sso-oauth.mdx index ce5c6da217880..1b4768efa428c 100644 --- a/docs/changelog/2024-02-08-sso-oauth.mdx +++ b/docs/changelog/2024-02-08-sso-oauth.mdx @@ -3,6 +3,12 @@ title: LobeChat Supports Multi-User Management with Clerk and Next-Auth description: >- LobeChat offers various user authentication and management solutions, including Clerk and Next-Auth, to meet the diverse needs of different users. +tags: + - User Management + - Next-Auth + - Clerk + - Authentication + - Multi-Factor Authentication --- # Support for Multi-User Management with Clerk and Next-Auth diff --git a/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx b/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx index c350532af46fd..55e74a791231e 100644 --- a/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx +++ b/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 支持 Clerk 与 Next-Auth 多用户管理支持 description: LobeChat 提供 Clerk 和 Next-Auth 等多种用户认证和管理方案,以满足不同用户的需求。 +tags: + - 用户管理 + - 身份验证 + - next-auth + - Clerk + - 多因素认证 --- # 支持 Clerk 与 Next-Auth 多用户管理支持 diff --git a/docs/changelog/2024-02-14-ollama.mdx b/docs/changelog/2024-02-14-ollama.mdx index e8dd6a3a0345a..906cc8efddaa4 100644 --- a/docs/changelog/2024-02-14-ollama.mdx +++ b/docs/changelog/2024-02-14-ollama.mdx @@ -1,6 +1,12 @@ --- title: LobeChat Supports Ollama for Local Large Language Model (LLM) Calls description: LobeChat v0.127.0 supports using Ollama to call local large language models. +tags: + - Ollama AI + - LobeChat + - Local LLMs + - AI Conversations + - GPT-4 --- # Support for Ollama Calls to Local Large Language Models 🦙 diff --git a/docs/changelog/2024-02-14-ollama.zh-CN.mdx b/docs/changelog/2024-02-14-ollama.zh-CN.mdx index 2ef53e3eaea29..565c2a7e92f31 100644 --- a/docs/changelog/2024-02-14-ollama.zh-CN.mdx +++ b/docs/changelog/2024-02-14-ollama.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 支持 Ollama 调用本地大语言模型(LLM) description: LobeChat vLobeChat v0.127.0 支持 Ollama 调用本地大语言模型。 +tags: + - Ollama AI + - LobeChat + - 大语言模型 + - AI 对话 --- # 支持 Ollama 调用本地大语言模型 🦙 diff --git a/docs/changelog/2024-06-19-lobe-chat-v1.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.mdx index ae476363b0b64..ac59cfdb757db 100644 --- a/docs/changelog/2024-06-19-lobe-chat-v1.mdx +++ b/docs/changelog/2024-06-19-lobe-chat-v1.mdx @@ -4,6 +4,12 @@ description: >- LobeChat 1.0 brings a brand-new architecture and features for server-side databases and user authentication management, opening up new possibilities. On this basis, LobeChat Cloud has entered beta testing. +tags: + - LobeChat + - Version 1.0 + - Server-Side Database + - User Authentication + - Cloud Beta Testing --- # LobeChat 1.0: New Architecture and New Possibilities diff --git a/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx b/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx index 1fc936e07710e..af6097695448f 100644 --- a/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +++ b/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx @@ -3,6 +3,11 @@ title: LobeChat 1.0:新的架构与新的可能 description: >- LobeChat 1.0 带来了服务端数据库、用户鉴权管理的全新架构与特性,开启了新的可能 。在此基础上, LobeChat Cloud 开启 Beta 版测试。 +tags: + - LobeChat + - 服务端数据库 + - 用户鉴权 + - Beta 测试 --- # LobeChat 1.0:新的架构与新的可能 diff --git a/docs/changelog/2024-07-19-gpt-4o-mini.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.mdx index b35fcc007dac7..1a2b6e62fb8e9 100644 --- a/docs/changelog/2024-07-19-gpt-4o-mini.mdx +++ b/docs/changelog/2024-07-19-gpt-4o-mini.mdx @@ -4,6 +4,11 @@ description: >- LobeChat v1.6 has been released with support for GPT-4o mini, while LobeChat Cloud services have been fully upgraded to provide users with a more powerful AI conversation experience. +tags: + - LobeChat + - GPT-4o Mini + - AI Conversation + - Cloud Service --- # GPT-4o Mini Makes a Stunning Debut, Ushering in a New GPT-4 Era 🚀 diff --git a/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx b/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx index b813eac1e364d..fde0f598f2673 100644 --- a/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +++ b/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 全面进入 GPT-4 时代:GPT-4o mini 正式上线 description: >- LobeChat v1.6 重磅发布 GPT-4o mini 支持,同时 LobeChat Cloud 服务全面升级默认模型,为用户带来更强大的 AI 对话体验。 +tags: + - LobeChat + - GPT-4o mini + - AI 对话服务 --- # GPT-4o mini 震撼登场,开启全新 GPT-4 时代 🚀 diff --git a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx index 2dcf984993e46..baae9f8d393bc 100644 --- a/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +++ b/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx @@ -4,6 +4,12 @@ description: >- LobeChat v1.8.0 launches the official database Docker image, supporting cloud data synchronization and user management, along with comprehensive self-deployment documentation. +tags: + - LobeChat + - Docker Image + - Cloud Deployment + - Database + - Postgres --- # LobeChat Database Docker Image: The Final Piece of the Cloud Deployment Puzzle diff --git a/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx b/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx index b49a42b6e2806..3148b25084cad 100644 --- a/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx +++ b/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat Database Docker 镜像正式发布 description: LobeChat v1.8.0 推出官方数据库 Docker 镜像,支持云端数据同步与用户管理,并提供完整的自部署文档指南。 +tags: + - LobeChat + - Docker 镜像 + - 云端部署 + - 数据库 --- # LobeChat Database Docker 镜像:云端部署的最后一块拼图 diff --git a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx index 12c998a05d498..7535a10c3ee70 100644 --- a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +++ b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx @@ -6,6 +6,12 @@ description: >- LobeChat introduces a brand new knowledge base feature that supports all types of file management, intelligent vectorization, and file dialogue, making knowledge management and information retrieval easier and smarter. +tags: + - LobeChat + - Knowledge Base + - File Management + - Open Source + - Cloud Version --- # Major Release of Knowledge Base Feature: A Revolution in Intelligent File Management and Dialogue diff --git a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx index 81ac80e4d45c5..cdb3f23564dc2 100644 --- a/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx +++ b/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 重磅发布知识库功能:打造智能文件管理与对话新体验 description: LobeChat 推出全新知识库功能,支持全类型文件管理、智能向量化和文件对话,让知识管理和信息检索更轻松、更智能。 +tags: + - LobeChat + - 知识库 + - 文件管理 + - 智能处理 --- # 知识库功能重磅发布:智能文件管理与对话的革新 diff --git a/docs/changelog/2024-09-13-openai-o1-models.mdx b/docs/changelog/2024-09-13-openai-o1-models.mdx index 2b82cf0247566..6cb27260e9913 100644 --- a/docs/changelog/2024-09-13-openai-o1-models.mdx +++ b/docs/changelog/2024-09-13-openai-o1-models.mdx @@ -3,6 +3,12 @@ title: LobeChat Perfectly Adapts to OpenAI O1 Series Models description: >- LobeChat v1.17.0 now supports OpenAI's latest o1-preview and o1-mini models, bringing users enhanced coding and mathematical capabilities. +tags: + - OpenAI O1 + - LobeChat + - AI Models + - Code Writing + - Mathematical Problem Solving --- # OpenAI O1 Series Models Now Available on LobeChat diff --git a/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx b/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx index b7571d712fbf9..9b1e5e565479b 100644 --- a/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx +++ b/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx @@ -1,6 +1,12 @@ --- title: LobeChat 完美适配 OpenAI O1 系列模型 description: LobeChat v1.17.0 现已支持 OpenAI 最新发布的 o1-preview 和 o1-mini 模型,为用户带来更强大的代码和数学能力。 +tags: + - OpenAI O1 + - LobeChat + - AI 模型 + - 代码编写 + - 数学问题 --- # OpenAI O1 系列模型现已登陆 LobeChat diff --git a/docs/changelog/2024-09-20-artifacts.mdx b/docs/changelog/2024-09-20-artifacts.mdx index 5b8d601cc9ac4..3e571c4b269cd 100644 --- a/docs/changelog/2024-09-20-artifacts.mdx +++ b/docs/changelog/2024-09-20-artifacts.mdx @@ -4,6 +4,12 @@ description: >- LobeChat v1.19 brings significant updates, including full feature support for Claude Artifacts, a brand new discovery page design, and support for GitHub Models providers, greatly enhancing the capabilities of the AI assistant. +tags: + - LobeChat + - AI Assistant + - Artifacts + - GitHub Models + - Interactive Experience --- # Major Update: LobeChat Enters the Era of Artifacts diff --git a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx b/docs/changelog/2024-09-20-artifacts.zh-CN.mdx index 6b70dd4e020f2..801466498ad17 100644 --- a/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +++ b/docs/changelog/2024-09-20-artifacts.zh-CN.mdx @@ -3,6 +3,12 @@ title: 重磅更新:LobeChat 迎来 Artifacts 时代 description: >- LobeChat v1.19 带来了重大更新,包括 Claude Artifacts 完整特性支持、全新的发现页面设计,以及 GitHub Models 服务商支持,让 AI 助手的能力得到显著提升。 +tags: + - LobeChat + - Artifacts + - AI 助手 + - 更新 + - GitHub Models --- # 重磅更新:LobeChat 迎来 Artifacts 时代 diff --git a/docs/changelog/2024-10-27-pin-assistant.mdx b/docs/changelog/2024-10-27-pin-assistant.mdx index 9b13bba51427b..d65f66dff36a4 100644 --- a/docs/changelog/2024-10-27-pin-assistant.mdx +++ b/docs/changelog/2024-10-27-pin-assistant.mdx @@ -4,6 +4,11 @@ description: >- LobeChat v1.26.0 launches the persistent assistant sidebar feature, supporting quick key switching for easy access to frequently used assistants, significantly enhancing efficiency. +tags: + - Persistent Assistant + - Sidebar Feature + - User Experience + - Workflow Optimization --- # Persistent Assistant Sidebar: Creating a More Convenient Conversation Experience diff --git a/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx b/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx index 1b7f84ddd1b48..2971ad514bdc4 100644 --- a/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx +++ b/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx @@ -1,6 +1,10 @@ --- title: LobeChat 新增助手常驻侧边栏功能 description: LobeChat v1.26.0 推出助手常驻侧边栏功能,支持快捷键切换,让高频使用的助手触手可及,大幅提升使用效率。 +tags: + - 助手常驻侧边栏 + - 对话体验 + - 工作效率 --- # 助手常驻侧边栏:打造更便捷的对话体验 diff --git a/docs/changelog/2024-11-06-share-text-json.mdx b/docs/changelog/2024-11-06-share-text-json.mdx index 8fed3949d87b8..e8f1948d268c0 100644 --- a/docs/changelog/2024-11-06-share-text-json.mdx +++ b/docs/changelog/2024-11-06-share-text-json.mdx @@ -5,6 +5,10 @@ description: >- and OpenAI format JSON, making it easy to convert conversation content into note materials, development debugging data, and training corpora, significantly enhancing the reusability of conversation content. +tags: + - Text Format Export + - Markdown Export + - OpenAI JSON --- # Upgraded Conversation Sharing: Support for Text Format Export diff --git a/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx b/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx index dfc222da5d0fd..90f78831a64d0 100644 --- a/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +++ b/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx @@ -3,6 +3,10 @@ title: LobeChat 支持分享对话为文本格式(Markdown/JSON) description: >- LobeChat v1.28.0 新增 Markdown 和 OpenAI 格式 JSON 导出支持,让对话内容能轻松转化为笔记素材、开发调试数据和训练语料,显著提升对话内容的复用价值。 +tags: + - 对话内容 + - Markdown导出 + - OpenAI JSON --- # 对话内容分享升级:支持文本格式导出 diff --git a/docs/changelog/2024-11-25-november-providers.mdx b/docs/changelog/2024-11-25-november-providers.mdx index ce4b4182a871b..013272dc4f72c 100644 --- a/docs/changelog/2024-11-25-november-providers.mdx +++ b/docs/changelog/2024-11-25-november-providers.mdx @@ -3,6 +3,13 @@ title: New Model Providers Added to LobeChat in November description: >- LobeChat model providers now support Gitee AI, InternLM (ShuSheng PuYu), xAI, and Cloudflare WorkersAI +tags: + - LobeChat + - AI Model Providers + - Gitee AI + - InternLM + - xAI + - Cloudflare Workers AI --- # New Model Providers Added to LobeChat in November 🎉 @@ -16,4 +23,4 @@ We're excited to announce that LobeChat has expanded its AI model support with t ## Need More Model Providers? -Feel free to submit your requests at [More Model Provider Support](https://github.com/lobehub/lobe-chat/discussions/1284). +Feel free to submit your requests at [More Model Provider Support](https://github.com/lobehub/lobe-chat/discussions/6157). diff --git a/docs/changelog/2024-11-25-november-providers.zh-CN.mdx b/docs/changelog/2024-11-25-november-providers.zh-CN.mdx index 0b2d77ab51f60..04b311ddea86c 100644 --- a/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +++ b/docs/changelog/2024-11-25-november-providers.zh-CN.mdx @@ -1,6 +1,13 @@ --- title: LobeChat 11 月新增模型服务 description: 'LobeChat 模型服务新增支持 Gitee AI, InternLM (书生浦语), xAI, Cloudflare WorkersAI' +tags: + - LobeChat + - AI模型服务 + - Gitee AI + - InternLM + - xAI + - Cloudflare Workers AI --- # LobeChat 11 月新增模型服务支持 🎉 @@ -14,4 +21,4 @@ description: 'LobeChat 模型服务新增支持 Gitee AI, InternLM (书生浦语 ## 需要更多模型服务? -欢迎在 [更多模型服务商支持](https://github.com/lobehub/lobe-chat/discussions/1284) 提交您的需求。 +欢迎在 [更多模型服务商支持](https://github.com/lobehub/lobe-chat/discussions/6157) 提交您的需求。 diff --git a/docs/changelog/2024-11-27-forkable-chat.mdx b/docs/changelog/2024-11-27-forkable-chat.mdx index d50d493972729..2fe7a4658afa6 100644 --- a/docs/changelog/2024-11-27-forkable-chat.mdx +++ b/docs/changelog/2024-11-27-forkable-chat.mdx @@ -3,6 +3,10 @@ title: LobeChat Supports Branching Conversations description: >- LobeChat now allows you to create new conversation branches from any message, freeing your thoughts. +tags: + - Branching Conversations + - LobeChat + - Chat Features --- # Exciting Launch of Branching Conversations Feature 🎉 diff --git a/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx b/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx index 07581558181b5..7033bd4a91714 100644 --- a/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx +++ b/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx @@ -1,6 +1,11 @@ --- title: LobeChat 支持分支对话 description: LobeChat 现已支持从任意消息创建新的对话分支,让您的思维不再受限 +tags: + - LobeChat + - 分支对话 + - 对话功能 + - 用户体验 --- # 重磅推出分支对话功能 🎉 diff --git a/docs/changelog/2025-01-03-user-profile.mdx b/docs/changelog/2025-01-03-user-profile.mdx index e22ac1b490105..38d23643863f2 100644 --- a/docs/changelog/2025-01-03-user-profile.mdx +++ b/docs/changelog/2025-01-03-user-profile.mdx @@ -3,6 +3,11 @@ title: LobeChat Supports User Data Statistics and Activity Sharing description: >- LobeChat now supports multi-dimensional user data statistics and activity sharing +tags: + - LobeChat + - User Statistics + - Activity Sharing + - AI Data --- # User Data Statistics and Activity Sharing 💯 diff --git a/docs/changelog/2025-01-03-user-profile.zh-CN.mdx b/docs/changelog/2025-01-03-user-profile.zh-CN.mdx index 171edb99bab58..65df51b3f56ae 100644 --- a/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +++ b/docs/changelog/2025-01-03-user-profile.zh-CN.mdx @@ -1,6 +1,10 @@ --- title: LobeChat 支持用户数据统计与活跃度分享 description: LobeChat 现已支持多维度用户数据统计与活跃度分享 +tags: + - 用户数据统计 + - 活跃度分享 + - LobeChat --- # 用户数据统计与活跃度分享 💯 @@ -23,4 +27,3 @@ description: LobeChat 现已支持多维度用户数据统计与活跃度分享 1. 需要使用 `PgLite` 或 `数据库` 模式 2. 点击个人头像进入「账户管理」-「数据统计」页面 - diff --git a/docs/changelog/2025-01-22-new-ai-provider.mdx b/docs/changelog/2025-01-22-new-ai-provider.mdx new file mode 100644 index 0000000000000..8caa6e5f74d0c --- /dev/null +++ b/docs/changelog/2025-01-22-new-ai-provider.mdx @@ -0,0 +1,25 @@ +--- +title: LobeChat Launches New AI Provider Management System +description: >- + LobeChat has revamped its AI Provider Management System, now supporting custom + AI providers and models. +tags: + - LobeChat + - AI Provider + - Provider Management + - Multimodal +--- + +# New AI Provider Management System 🎉 + +We are excited to announce that LobeChat has launched a brand new AI Provider Management System, now available in both the open-source version and the Cloud version ([lobechat.com](https://lobechat.com)): + +## 🚀 Key Updates + +- 🔮 **Custom AI Providers**: You can now add, remove, or edit AI providers as needed. +- ⚡️ **Custom Model and Capability Configuration**: Easily add your own models to meet personalized requirements. +- 🌈 **Multimodal Support**: The new AI Provider Management System fully supports various modalities, including language, images, voice, and more. Stay tuned for video and music generation features! + +## 📢 Feedback and Support + +If you have any suggestions or thoughts about the new AI Provider Management System, feel free to engage with us in GitHub Discussions. diff --git a/docs/changelog/2025-01-22-new-ai-provider.zh-CN.mdx b/docs/changelog/2025-01-22-new-ai-provider.zh-CN.mdx new file mode 100644 index 0000000000000..154b5ef7b2e47 --- /dev/null +++ b/docs/changelog/2025-01-22-new-ai-provider.zh-CN.mdx @@ -0,0 +1,23 @@ +--- +title: LobeChat 推出全新 AI Provider 管理系统 +description: LobeChat 焕新全新 AI Provider 管理系统,已支持自定义 AI 服务商与自定义模型 +tags: + - LobeChat + - AI Provider + - 服务商管理 + - 多模态 +--- + +# 全新 AI Provider 管理系统 🎉 + +我们很高兴地宣布,LobeChat 推出了全新的 AI Provider 管理系统,已经在开源版与 Cloud 版([lobechat.com](https://lobechat.com))中可用: + +## 🚀 主要更新 + +- 🔮 **自定义 AI 服务商**: 现在,您可以根据需要添加、删除或编辑 AI 服务商。 +- ⚡️ **自定义模型与能力配置**: 轻松添加您自己的模型,满足个性化需求。 +- 🌈 **多模态支持**: 新的 AI Provider 管理系统全面支持多种模态,包括语言、图像、语音等,视频和音乐生成功能,敬请期待! + +## 📢 反馈与支持 + +如果您对新的 AI Provider 管理系统有任何建议或想法,欢迎在 GitHub Discussions 中与我们交流。 diff --git a/docs/changelog/2025-02-02-deepseek-r1.mdx b/docs/changelog/2025-02-02-deepseek-r1.mdx new file mode 100644 index 0000000000000..28f1853ca3754 --- /dev/null +++ b/docs/changelog/2025-02-02-deepseek-r1.mdx @@ -0,0 +1,33 @@ +--- +title: >- + LobeChat Integrates DeepSeek R1, Bringing a Revolutionary Chain of Thought + Experience +description: >- + LobeChat v1.49.12 fully supports the DeepSeek R1 model, providing users with + an unprecedented interactive experience in the chain of thought. +tags: + - LobeChat + - DeepSeek + - Chain of Thought +--- + +# Perfect Integration of DeepSeek R1 and it's Deep Thinking Experience 🎉 + +After nearly 10 days of meticulous refinement, LobeChat has fully integrated the DeepSeek R1 model in version v1.49.12, offering users a revolutionary interactive experience in the chain of thought! + +## 🚀 Major Updates + +- 🤯 **Comprehensive Support for DeepSeek R1**: Now fully integrated in both the Community and Cloud versions ([lobechat.com](https://lobechat.com)). +- 🧠 **Real-Time Chain of Thought Display**: Transparently presents the AI's reasoning process, making the resolution of complex issues clear and visible. +- ⚡️ **Deep Thinking Experience**: Utilizing Chain of Thought technology, it provides more insightful AI conversations. +- 💫 **Intuitive Problem Analysis**: Makes the analysis of complex issues clear and easy to understand. + +## 🌟 How to Use + +1. Upgrade to LobeChat v1.49.12 or visit [lobechat.com](https://lobechat.com). +2. Select the DeepSeek R1 model in the settings. +3. Experience a whole new level of intelligent conversation! + +## 📢 Feedback and Support + +If you encounter any issues while using the application or have suggestions for new features, feel free to engage with us through GitHub Discussions. Let's work together to create a better LobeChat! diff --git a/docs/changelog/2025-02-02-deepseek-r1.zh-CN.mdx b/docs/changelog/2025-02-02-deepseek-r1.zh-CN.mdx new file mode 100644 index 0000000000000..c6ca15e1870a9 --- /dev/null +++ b/docs/changelog/2025-02-02-deepseek-r1.zh-CN.mdx @@ -0,0 +1,29 @@ +--- +title: LobeChat 重磅集成 DeepSeek R1,带来革命性思维链体验 +description: LobeChat v1.49.12 已完整支持 DeepSeek R1 模型,为用户带来前所未有的思维链交互体验 +tags: + - DeepSeek R1 + - CoT + - 思维链 +--- + +# 完美集成 DeepSeek R1 ,开启思维链新体验 + +经过近 10 天的精心打磨,LobeChat 已在 v1.49.12 版本中完整集成了 DeepSeek R1 模型,为用户带来革命性的思维链交互体验! + +## 🚀 重大更新 + +- 🤯 **DeepSeek R1 全面支持**: 现已在社区版与 Cloud 版([lobechat.com](https://lobechat.com))中完整接入 +- 🧠 **实时思维链展示**: 透明呈现 AI 的推理过程,让复杂问题的解决过程清晰可见 +- ⚡️ **深度思考体验**: 通过 Chain of Thought 技术,带来更具洞察力的 AI 对话 +- 💫 **直观的问题解析**: 让复杂问题的分析过程变得清晰易懂 + +## 🌟 使用方式 + +1. 升级到 LobeChat v1.49.12 或访问 [lobechat.com](https://lobechat.com) +2. 在设置中选择 DeepSeek R1 模型 +3. 开启全新的智能对话体验! + +## 📢 反馈与支持 + +如果您在使用过程中遇到任何问题,或对新功能有任何建议,欢迎通过 GitHub Discussions 与我们交流。让我们一起打造更好的 LobeChat! diff --git a/docs/changelog/index.json b/docs/changelog/index.json index 34affde1590c3..6a5f5236e71ec 100644 --- a/docs/changelog/index.json +++ b/docs/changelog/index.json @@ -2,107 +2,119 @@ "$schema": "https://github.com/lobehub/lobe-chat/blob/main/docs/changelog/schema.json", "cloud": [], "community": [ + { + "image": "https://github.com/user-attachments/assets/5fe4c373-ebd0-42a9-bdca-0ab7e0a2e747", + "id": "2025-02-02-deepseek-r1", + "date": "2025-02-02", + "versionRange": ["1.47.8", "1.49.12"] + }, + { + "image": "https://github.com/user-attachments/assets/7350f211-61ce-488e-b0e2-f0fcac25caeb", + "id": "2025-01-22-new-ai-provider", + "date": "2025-01-22", + "versionRange": ["1.43.1", "1.47.7"] + }, { "image": "https://github.com/user-attachments/assets/3d80e0f5-d32a-4412-85b2-e709731460a0", "id": "2025-01-03-user-profile", "date": "2025-01-03", - "versionRange": ["1.43.0", "1.43.1"] + "versionRange": ["1.34.1", "1.43.0"] }, { "image": "https://github.com/user-attachments/assets/2048b4c2-4a56-4029-acf9-71e35ff08652", "id": "2024-11-27-forkable-chat", "date": "2024-11-27", - "versionRange": ["1.34.0", "1.33.1"] + "versionRange": ["1.33.1", "1.34.0"] }, { "image": "https://github.com/user-attachments/assets/fa8fab19-ace2-4f85-8428-a3a0e28845bb", "id": "2024-11-25-november-providers", "date": "2024-11-25", - "versionRange": ["1.33.0", "1.30.1"] + "versionRange": ["1.30.1", "1.33.0"] }, { "image": "https://github.com/user-attachments/assets/eb3f3d8a-79ce-40aa-a206-2c846206c0c0", "id": "2024-11-06-share-text-json", "date": "2024-11-06", - "versionRange": ["1.28.0", "1.26.1"] + "versionRange": ["1.26.1", "1.28.0"] }, { "image": "https://github.com/user-attachments/assets/e70c2db6-05c9-43ea-b111-6f6f99e0ae88", "id": "2024-10-27-pin-assistant", "date": "2024-10-27", - "versionRange": ["1.26.0", "1.19.1"] + "versionRange": ["1.19.1", "1.26.0"] }, { "image": "https://github.com/user-attachments/assets/635f1c74-6327-48a8-a8d9-68d7376c7749", "id": "2024-09-20-artifacts", "date": "2024-09-20", - "versionRange": ["1.19.0", "1.17.1"] + "versionRange": ["1.17.1", "1.19.0"] }, { "image": "https://github.com/user-attachments/assets/bd6d0c82-8f14-4167-ad09-2a841f1e34e4", "id": "2024-09-13-openai-o1-models", "date": "2024-09-13", - "versionRange": ["1.17.0", "1.12.1"] + "versionRange": ["1.12.1", "1.17.0"] }, { "image": "https://github.com/user-attachments/assets/385eaca6-daea-484a-9bea-ba7270b4753d", "id": "2024-08-21-file-upload-and-knowledge-base", "date": "2024-08-21", - "versionRange": ["1.12.0", "1.8.1"] + "versionRange": ["1.8.1", "1.12.0"] }, { "image": "https://github.com/user-attachments/assets/2a4116a7-15ad-43e5-b801-cc62d8da2012", "id": "2024-08-02-lobe-chat-database-docker", "date": "2024-08-02", - "versionRange": ["1.8.0", "1.6.1"] + "versionRange": ["1.6.1", "1.8.0"] }, { "image": "https://github.com/user-attachments/assets/0e3a7174-6b66-4432-a319-dff60b033c24", "id": "2024-07-19-gpt-4o-mini", "date": "2024-07-19", - "versionRange": ["1.6.0", "1.0.1"] + "versionRange": ["1.0.1", "1.6.0"] }, { "image": "https://github.com/user-attachments/assets/82bfc467-e0c6-4d99-9b1f-18e4aea24285", "id": "2024-06-19-lobe-chat-v1", "date": "2024-06-19", - "versionRange": ["1.0.0", "0.147.0"] + "versionRange": ["0.147.0", "1.0.0"] }, { "image": "https://github.com/user-attachments/assets/aee846d5-b5ee-46cb-9dd0-d952ea708b67", "id": "2024-02-14-ollama", "date": "2024-02-14", - "versionRange": ["0.127.0", "0.125.1"] + "versionRange": ["0.125.1", "0.127.0"] }, { "image": "https://github.com/user-attachments/assets/533f7a5e-8a93-4a57-a62f-8233897d72b5", "id": "2024-02-08-sso-oauth", "date": "2024-02-08", - "versionRange": ["0.125.0", "0.118.1"] + "versionRange": ["0.118.1", "0.125.0"] }, { "image": "https://github.com/user-attachments/assets/6069332b-8e15-4d3c-8a77-479e8bc09c23", "id": "2023-12-22-dalle-3", "date": "2023-12-22", - "versionRange": ["0.118.0", "0.102.1"] + "versionRange": ["0.102.1", "0.118.0"] }, { "image": "https://github.com/user-attachments/assets/03433283-08a5-481a-8f6c-069b2fc6bace", "id": "2023-11-19-tts-stt", "date": "2023-11-19", - "versionRange": ["0.102.0", "0.101.1"] + "versionRange": ["0.101.1", "0.102.0"] }, { "image": "https://github.com/user-attachments/assets/dde2c9c5-cdda-4a65-8f32-b6f4da907df2", "id": "2023-11-14-gpt4-vision", "date": "2023-11-14", - "versionRange": ["0.101.0", "0.90.0"] + "versionRange": ["0.90.0", "0.101.0"] }, { "image": "https://github.com/user-attachments/assets/eaed3762-136f-4297-b161-ca92a27c4982", "id": "2023-09-09-plugin-system", "date": "2023-09-09", - "versionRange": ["0.72.0", "0.67.0"] + "versionRange": ["0.67.0", "0.72.0"] } ] } diff --git a/docs/self-hosting/advanced/auth.mdx b/docs/self-hosting/advanced/auth.mdx index 7d4d8614981ca..5dd539eef62e1 100644 --- a/docs/self-hosting/advanced/auth.mdx +++ b/docs/self-hosting/advanced/auth.mdx @@ -27,28 +27,29 @@ By setting the environment variables `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CL Before using NextAuth, please set the following variables in LobeChat's environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` | -| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. | +| Environment Variable | Type | Description | +| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. | +| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` | +| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. | Currently supported identity verification services include: - + + + + + - + + + + diff --git a/docs/self-hosting/advanced/auth.zh-CN.mdx b/docs/self-hosting/advanced/auth.zh-CN.mdx index a5599a2cf5390..008b401fddf58 100644 --- a/docs/self-hosting/advanced/auth.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth.zh-CN.mdx @@ -24,28 +24,29 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全 在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | -| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 | +| 环境变量 | 类型 | 描述 | +| ------------------------- | -- | ------------------------------------------------------------------------------------------------------------ | +| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 | +| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | +| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 | 目前支持的身份验证服务有: - + + + + + - + + + + @@ -57,7 +58,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全 顺序为 SSO 提供商的显示顺序。 -| SSO 提供商 | 值 | +| SSO 提供商 | 值 | | --------------------- | ----------------------- | | Auth0 | `auth0` | | Authenlia | `authenlia` | diff --git a/docs/self-hosting/advanced/auth/clerk.mdx b/docs/self-hosting/advanced/auth/clerk.mdx index b8a658d9f6b5e..0e98c8c4a47d6 100644 --- a/docs/self-hosting/advanced/auth/clerk.mdx +++ b/docs/self-hosting/advanced/auth/clerk.mdx @@ -11,67 +11,51 @@ tags: # Configure Clerk Authentication Service -Go to [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key. +Go to [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key. ## Get Environment Variables + ### Add Public and Private Key Environment Variables -### Add Public and Private Key Environment Variables + Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these environment variables. -Add `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on the "API Keys" in the menu and copy the corresponding values to get these environment variables. + {'Find -{'Find + The environment variables required for this step are as follows: -The environment variables required for this step are as follows: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ### Create and Configure Webhook in Clerk -### Create and Configure Webhook in Clerk + Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by using the Webhook provided by Clerk. -Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store the changes in the user lifecycle (create, update, delete). We achieve this by using the Webhook provided by Clerk. + We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes. -We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes. + {'Add -{'Add + Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. -Fill in your project URL in the endpoint, such as `https://your-project.com/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. + + The `https://` in the URL is essential to maintain the integrity of the URL. + - + {'Configure -The `https://` in the URL is essential to maintain the integrity of the URL. + ### Add Webhook Secret to Environment Variables - + After creating, you can find the secret of this Webhook in the bottom right corner: -{'Configure + {'View -### Add Webhook Secret to Environment Variables - -After creating, you can find the secret of this Webhook in the bottom right corner: - -{'View - -The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: - -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` By following these steps, you have successfully configured the Clerk authentication service. diff --git a/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx b/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx index 27e06d5749fd8..a31bb6e322dd9 100644 --- a/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx @@ -10,63 +10,49 @@ tags: # 配置 Clerk 身份验证服务 -前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 +前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 ## 获取环境变量 + ### 添加公、私钥环境变量 -### 添加公、私钥环境变量 + 添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值获取该环境变量。 -添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值获取该环境变量。 + {'在 -{'在 + 此步骤所需的环境变量如下: -此步骤所需的环境变量如下: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ### 在 Clerk 中创建并配置 Webhook -### 在 Clerk 中创建并配置 Webhook + 由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 -由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 + 我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 -我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 + {'Clerk -{'Clerk + 在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 -在 endppint 中填写你的项目 URL,如 `https://your-project.com/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 + URL 的`https://`不可缺失,须保持 URL 的完整性 -URL的`https://`不可缺失,须保持URL的完整性 + {'添加 -{'添加 + ### 将 Webhook 秘钥添加到环境变量 -### 将 Webhook 秘钥添加到环境变量 + 创建完毕后,可以在右下角找到该 Webhook 的秘钥: -创建完毕后,可以在右下角找到该 Webhook 的秘钥: + {'查看 -{'查看 - -这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: - -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + 这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` 这样,你已经成功配置了 Clerk 身份验证服务。 diff --git a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx b/docs/self-hosting/advanced/auth/next-auth/auth0.mdx index c35ef562849c3..f61418cc3b855 100644 --- a/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/auth0.mdx @@ -19,74 +19,53 @@ tags: ### Create Auth0 Application -Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application. + Register and log in to [Auth0][auth0-client-page], click on the "Applications" in the left navigation bar to switch to the application management interface, and click "Create Application" in the upper right corner to create an application. -Create Auth0 Application S1 + Create Auth0 Application S1 -Fill in the application name you want to display to the organization users, choose any application type, and click "Create". + Fill in the application name you want to display to the organization users, choose any application type, and click "Create". -Create Auth0 Application S2 + Create Auth0 Application S2 -After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information. + After successful creation, click on the corresponding application to enter the application details page, switch to the "Settings" tab, and you can see the corresponding configuration information. -Create Auth0 Application S3 + Create Auth0 Application S3 -In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in: + In the application configuration page, you also need to configure Allowed Callback URLs, where you should fill in: -```bash -http(s)://your-domain/api/auth/callback/auth0 -``` + ```bash + http(s)://your-domain/api/auth/callback/auth0 + ``` -Create Auth0 Application S4 + Create Auth0 Application S4 - - You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is - consistent with the deployed URL. - + + You can fill in or modify Allowed Callback URLs after deployment, but make sure the filled URL is + consistent with the deployed URL. + -### Add Users + ### Add Users -Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat. + Click on the "Users Management" in the left navigation bar to enter the user management interface, where you can create users for your organization to log in to LobeChat. -Add Users + Add Users -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. | -| `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application | -| `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application | -| `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` | -| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. | + | `AUTH_AUTH0_ID` | Required | Client ID of the Auth0 application | + | `AUTH_AUTH0_SECRET` | Required | Client Secret of the Auth0 application | + | `AUTH_AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` | + | `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable#auth0). - - + @@ -102,19 +81,13 @@ If your enterprise or organization already has a unified identity authentication Auth0 supports single sign-on services such as Azure Active Directory, Slack, Google Workspace, Office 365, Zoom, and more. For a detailed list of supported services, please refer to [this link][auth0-sso-integrations]. -Connecting to an Existing Single Sign-On Service +Connecting to an Existing Single Sign-On Service ### Configuring Social Login If your enterprise or organization needs to support external user logins, you can configure social login services in Authentication -> Social. -Configuring Social Login +Configuring Social Login Configuring social login services by default allows anyone to authenticate, which may lead to diff --git a/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx index a8305a1a179c9..36296fa317550 100644 --- a/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx @@ -15,73 +15,52 @@ tags: ### 创建 Auth0 应用 -注册并登录 [Auth0](https://manage.auth0.com/dashboard),点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。 + 注册并登录 [Auth0](https://manage.auth0.com/dashboard),点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。 -创建 Auth0 应用 S1 + 创建 Auth0 应用 S1 -填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。 + 填写你想向组织用户显示的应用名称,可选择任意应用类型,点击「Create」。 -创建 Auth0 应用 S2 + 创建 Auth0 应用 S2 -创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息 + 创建成功后,点击相应的应用,进入应用详情页,切换到「Settings」标签页,就可以看到相应的配置信息 -创建 Auth0 应用 S3 + 创建 Auth0 应用 S3 -在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写: + 在应用配置页面中,还需要配置 Allowed Callback URLs,在此处填写: -```bash -http(s)://your-domain/api/auth/callback/auth0 -``` + ```bash + http(s)://your-domain/api/auth/callback/auth0 + ``` -创建 Auth0 应用 S4 + 创建 Auth0 应用 S4 - - 可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致 - + + 可以在部署后再填写或修改 Allowed Callback URLs,但是务必保证填写的 URL 与部署的 URL 一致 + -### 新增用户 + ### 新增用户 -点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat + 点击左侧导航栏的「Users Management」,进入用户管理界面,可以为你的组织新建用户,用以登录 LobeChat -新增用户 + 新增用户 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 | -| `AUTH_AUTH0_ID` | 必选 | Auth0 应用程序的 Client ID | -| `AUTH_AUTH0_SECRET` | 必选 | Auth0 应用程序的 Client Secret | -| `AUTH_AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 | + | `AUTH_AUTH0_ID` | 必选 | Auth0 应用程序的 Client ID | + | `AUTH_AUTH0_SECRET` | 必选 | Auth0 应用程序的 Client Secret | + | `AUTH_AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth-0) 可查阅相关变量详情。 - - + @@ -96,19 +75,13 @@ http(s)://your-domain/api/auth/callback/auth0 Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里](https://marketplace.auth0.com/features/sso-integrations) -Connecting to an Existing Single Sign-On Service +Connecting to an Existing Single Sign-On Service ### 配置社交登录 如果你的企业或组织需要支持外部人员登录,可以在 Authentication -> Social 中,配置社交登录服务。 -Configuring Social Login +Configuring Social Login 配置社交登录服务默认会允许所有人通过认证,这可能会导致 LobeChat 被外部人员滥用。 diff --git a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx b/docs/self-hosting/advanced/auth/next-auth/authelia.mdx index a666405d0b996..f599ba08a36b5 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authelia.mdx @@ -17,54 +17,54 @@ tags: ## Authelia Configuration Flow -### Create an Authelia Identity Provider + ### Create an Authelia Identity Provider -We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at https://lobe.example.com/. Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default. + We assume you are already familiar with using Authelia. Let's say your LobeChat instance is deployed at [https://lobe.example.com/](https://lobe.example.com/). Note that currently only localhost supports HTTP access; other domains need to enable TLS, otherwise Authelia will actively interrupt authentication by default. -Now, let's open and edit the configuration file of your Authelia instance: + Now, let's open and edit the configuration file of your Authelia instance: -Add a new lobe-chat item under identity_providers -> oidc: + Add a new lobe-chat item under `identity_providers` -> `oidc`: -```yaml -identity_providers: - oidc: - ... - ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. - ## See: https://www.authelia.com/c/oidc - - id: lobe-chat - description: LobeChat - secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. - public: false - authorization_policy: two_factor - redirect_uris: - - https://chat.example.com/api/auth/callback/authelia - scopes: - - openid - - profile - - email - userinfo_signing_algorithm: none -``` + ```yaml + identity_providers: + oidc: + ... + ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. + ## See: https://www.authelia.com/c/oidc + - id: lobe-chat + description: LobeChat + secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. + public: false + authorization_policy: two_factor + redirect_uris: + - https://chat.example.com/api/auth/callback/authelia + scopes: + - openid + - profile + - email + userinfo_signing_algorithm: none + ``` -Make sure to replace secret and redirect_urls with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later. + Make sure to replace secret and `redirect_urls` with your own values. Note! The secret configured in Authelia is ciphertext, i.e., a salted hash value. Its corresponding plaintext needs to be filled in LobeChat later. -Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration. + Save the configuration file and restart the Authelia service. Now we have completed the Authelia configuration. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | -| `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat | -| `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is insecure_secret | -| `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example https://sso.example.com | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. https://chat.example.com/api/auth | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | + | `AUTH_AUTHELIA_ID` | Required | The id just configured in Authelia, example value is lobe-chat | + | `AUTH_AUTHELIA_SECRET` | Required | The plaintext corresponding to the secret just configured in Authelia, example value is `insecure_secret` | + | `AUTH_AUTHELIA_ISSUER` | Required | Your Authelia URL, for example [https://sso.example.com](https://sso.example.com) | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth verification. It only needs to be set when the default generated redirect address is incorrect. [https://chat.example.com/api/auth](https://chat.example.com/api/auth) | - - Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables. - + + Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authelia) for details about the variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx index 906a992cc6b81..19e6dd89266e9 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx @@ -14,56 +14,55 @@ tags: ## Authelia 配置流程 -### 创建 Authelia 提供应用 + ### 创建 Authelia 提供应用 -我们现在默认您已经了解了如何使用 Authelia。假设您的 LobeChat 实例部署在 `https://lobe.example.com/` 中。注意,目前只有 `localhost` 支持 HTTP 访问,其他域名需要启用 TLS,否则 Authelia 默认将主动中断身份认证。 + 我们现在默认您已经了解了如何使用 Authelia。假设您的 LobeChat 实例部署在 `https://lobe.example.com/` 中。注意,目前只有 `localhost` 支持 HTTP 访问,其他域名需要启用 TLS,否则 Authelia 默认将主动中断身份认证。 -现在,我们打开 Authelia 实例的配置文件进行编辑: + 现在,我们打开 Authelia 实例的配置文件进行编辑: -在 `identity_providers`-> `oidc` 下新增一个 `lobe-chat` 的项目: + 在 `identity_providers`-> `oidc` 下新增一个 `lobe-chat` 的项目: -```yaml -... -identity_providers: - oidc: - ... - ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. - ## See: https://www.authelia.com/c/oidc - - id: lobe-chat - description: LobeChat - secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. - public: false - authorization_policy: two_factor - redirect_uris: - - https://chat.example.com/api/auth/callback/authelia - scopes: - - openid - - profile - - email - userinfo_signing_algorithm: none -``` + ```yaml + ... + identity_providers: + oidc: + ... + ## The other portions of the mandatory OpenID Connect 1.0 configuration go here. + ## See: https://www.authelia.com/c/oidc + - id: lobe-chat + description: LobeChat + secret: '$pbkdf2-sha512$310000$c8p78n7pUMln0jzvd4aK4Q$JNRBzwAo0ek5qKn50cFzzvE9RXV88h1wJn5KGiHrD0YKtZaR/nCb2CJPOsKaPK0hjf.9yHxzQGZziziccp6Yng' # The digest of 'insecure_secret'. + public: false + authorization_policy: two_factor + redirect_uris: + - https://chat.example.com/api/auth/callback/authelia + scopes: + - openid + - profile + - email + userinfo_signing_algorithm: none + ``` -请您确保 `secret` 和 `redirect_urls` 替换成您自己的值。注意!Authelia 中配置 `secret` 是密文,即加盐哈希值。其对应的明文稍后需要填写在 lobeChat 中。 + 请您确保 `secret` 和 `redirect_urls` 替换成您自己的值。注意!Authelia 中配置 `secret` 是密文,即加盐哈希值。其对应的明文稍后需要填写在 lobeChat 中。 -保存配置文件,然后重启 Authelia 服务。现在我们完成了 Authelia 的配置工作。 + 保存配置文件,然后重启 Authelia 服务。现在我们完成了 Authelia 的配置工作。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authelia 请填写 `authelia`。 | -| `AUTH_AUTHELIA_ID` | 必选 | 刚刚在 Authelia 配置的 `id`,示例值是 `lobe-chat` | -| `AUTH_AUTHELIA_SECRET` | 必选 | 刚刚在 Authelia 配置的 `secret` 对应的明文,示例值是 `insecure_secret` | -| `AUTH_AUTHELIA_ISSUER` | 必选 | 您的 Authelia 的网址,例如 `https://sso.example.com` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authelia 请填写 `authelia`。 | + | `AUTH_AUTHELIA_ID` | 必选 | 刚刚在 Authelia 配置的 `id`,示例值是 `lobe-chat` | + | `AUTH_AUTHELIA_SECRET` | 必选 | 刚刚在 Authelia 配置的 `secret` 对应的明文,示例值是 `insecure_secret` | + | `AUTH_AUTHELIA_ISSUER` | 必选 | 您的 Authelia 的网址,例如 `https://sso.example.com` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authelia) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx b/docs/self-hosting/advanced/auth/next-auth/authentik.mdx index fdd6dde35008f..e2bc3092c96f6 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authentik.mdx @@ -19,52 +19,47 @@ tags: ### Create an Authentik Application Provider -In your Authentik instance, use the administrator account to go to **Admin Interface** -> **Applications** -> **Providers** and create a new provider. + In your Authentik instance, use the administrator account to go to **Admin Interface** -> **Applications** -> **Providers** and create a new provider. -Select **OAuth2/OpenID Provider** as the provider type. Fill in the provider name, select the authentication flow and authorization flow. + Select **OAuth2/OpenID Provider** as the provider type. Fill in the provider name, select the authentication flow and authorization flow. -In the `Redirect URL/Origin (regex)` field, fill in: + In the `Redirect URL/Origin (regex)` field, fill in: -```bash -https://your-domain/api/auth/callback/authentik -``` + ```bash + https://your-domain/api/auth/callback/authentik + ``` - - - You can fill in or modify the `Redirect URL/Origin (regex)` later, but make sure the filled in - URL matches the deployed URL. - Replace `your-domain` with your own domain name - + + - You can fill in or modify the `Redirect URL/Origin (regex)` later, but make sure the filled in + URL matches the deployed URL. - Replace `your-domain` with your own domain name + -Create Authentik Provider + Create Authentik Provider -Click **Done** + Click **Done** -After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**. + After the creation is successful, click **Applications** on the left -> **Create**, fill in the name and Slug, select the provider created in the previous step, and click **Create**. -After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`. + After the application provider is created, click the corresponding provider to enter the details page, click **Edit**, and save the `Client ID` and `Client Secret`. -Copy the URL of `OpenID Configuration Issuer` and save it. + Copy the URL of `OpenID Configuration Issuer` and save it. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | -| `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page | -| `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page | -| `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. | + | `AUTH_AUTHENTIK_ID` | Required | The Client ID from the Authentik application provider details page | + | `AUTH_AUTHENTIK_SECRET` | Required | The Client Secret from the Authentik application provider details page | + | `AUTH_AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Authentik) for details about the variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx index ca5f708dc9d7d..e3624c934fa46 100644 --- a/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx @@ -16,50 +16,45 @@ tags: ### 创建 Authentik 提供应用 -在你的 Authentik 实例中使用管理员账号进入 管理员界面 -> 应用程序 -> 提供程序 创建一个新的提供程序。 + 在你的 Authentik 实例中使用管理员账号进入 管理员界面 -> 应用程序 -> 提供程序 创建一个新的提供程序。 -选择 OAuth2/OpenID Provider 作为提供程序类型。填写提供程序的名称,选择身份流程和授权流程。 + 选择 OAuth2/OpenID Provider 作为提供程序类型。填写提供程序的名称,选择身份流程和授权流程。 -在 `重定向 URL/Origin(正则)` 处填写: + 在 `重定向 URL/Origin(正则)` 处填写: -```bash -https://your-domain/api/auth/callback/authentik -``` + ```bash + https://your-domain/api/auth/callback/authentik + ``` - - - 可以之后再填写或修改 `重定向 URL/Origin(正则)`,但是务必保证填写的 URL 与部署的 URL 一致。 - - your-domain 请替换为自己的域名 - + + - 可以之后再填写或修改 `重定向 URL/Origin(正则)`,但是务必保证填写的 URL 与部署的 URL 一致。 - + your-domain 请替换为自己的域名 + -创建 Authentik 提供程序 + 创建 Authentik 提供程序 -点击「完成」 + 点击「完成」 -创建成功后,点击左侧的「应用程序」-> 创建,填写名称和 Slug ,提供程序选择上一步创建的提供程序,点击「创建」。 + 创建成功后,点击左侧的「应用程序」-> 创建,填写名称和 Slug ,提供程序选择上一步创建的提供程序,点击「创建」。 -提供程序创建成功后,点击相应的提供程序,进入详情页,点击「编辑」,将 `客户端 ID` 和 `客户端 Secret` 保存下来。复制 `OpenID 配置颁发者` 的 URL,保存下来。 + 提供程序创建成功后,点击相应的提供程序,进入详情页,点击「编辑」,将 `客户端 ID` 和 `客户端 Secret` 保存下来。复制 `OpenID 配置颁发者` 的 URL,保存下来。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 | -| `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID | -| `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret | -| `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 | + | `AUTH_AUTHENTIK_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID | + | `AUTH_AUTHENTIK_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret | + | `AUTH_AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Authentik) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx index 64389a567279f..1979dd0bacaa3 100644 --- a/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx @@ -33,93 +33,121 @@ If you are deploying using a public network, the following assumptions apply: - You privately deploy Casdoor, and its domain is `https://lobe-auth-api.example.com`. + ### Create a Casdoor Application -### Create a Casdoor Application - -Access your privately deployed Casdoor WebUI (default is `http://localhost:8000/`) to enter the console. The default account is `admin`, and the password is `123`. - -Go to `Authentication` -> `Applications`, create a `LobeChat` application or directly modify the built-in `built-in` application. You can explore other fields, but you must configure at least the following fields: - -- Name, Display Name: `LobeChat` -- Redirect URLs: - - Local Development Environment: `http://localhost:3210/api/auth/callback/casdoor` - - Local Network IP Deployment: `http://LOBECHAT_IP:3210/api/auth/callback/casdoor` - - Public Network Environment: `https://lobe.example.com/api/auth/callback/casdoor` - -There are also some optional fields that can enhance user experience: - -- Logo: `https://lobehub.com/icon-192x192.png` -- Form CSS, Form CSS (Mobile): - -```html - -``` -Then, copy the `Client ID` and `Client Secret` and save them. + #parent-area + > main + > div + > div.login-content + > div.login-panel + > div.login-form + > div + > div + > button { + box-shadow: none !important; + border-radius: 10px !important; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + border: 1px solid #eee !important; + } -### Configure Environment Variables + @media (max-width: 640px) { + .login-panel { + padding: 40px 0 0 0; + box-shadow: none; + } + } -Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables. -Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows: -- `http://localhost:8000/` if you are in a local development environment. -- `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network. -- `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment. + + ``` -When deploying LobeChat, you need to configure the following environment variables: + Then, copy the `Client ID` and `Client Secret` and save them. -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. | -| `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. | -| `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. | -| `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + ### Disable User Registration - - Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for - details on related variables. - + Go to `Identity` -> `Applications`, select the `LobeChat` application, and set `Allow Register` to `false`. + + + Disabling user registration is necessary to prevent users from registering through the Casdoor login page. + + + ### Configure Webhook (Optional) + + Configure the Casdoor webhook so that LobeChat can receive notifications when user information is updated. + + Go to `Admin` -> `Webhooks`, add a webhook, and fill in the following fields: + + - URL: `https://lobe.example.com/api/webhooks/casdoor` + - Method: `POST` + - Content Type: `application/json` + - Headers: `casdoor-secret`: `Your Webhook Secret` + + > The secret is generated by yourself, you can visit [https://generate-secret.vercel.app/10](https://generate-secret.vercel.app/10) to generate a 10 bit secret. + + - Event: `update-user` + - Is user extented: `true` + + Save and Exit, then copy the Webhook secret and fill it in the environment variable \`CASDOOR\_WEBHOOK\_SECRET. + + ### Configure Environment Variables + + Set the obtained `Client ID` and `Client Secret` as `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET` in the LobeChat environment variables. + + Configure `AUTH_CASDOOR_ISSUER` in the LobeChat environment variables as follows: + + - `http://localhost:8000/` if you are in a local development environment. + - `http://CASDOOR_IP:8000/` if you are privately deploying Casdoor in a local network. + - `https://lobe-auth-api.example.com/` if you are deploying Casdoor in a public network environment. + + When deploying LobeChat, you need to configure the following environment variables: + + | Environment Variable | Type | Description | + | ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | A key for encrypting Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32`. | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. Fill in `casdoor` for using Casdoor. | + | `AUTH_CASDOOR_ID` | Required | The client ID from the Casdoor application details page. | + | `AUTH_CASDOOR_SECRET` | Required | The client secret from the Casdoor application details page. | + | `AUTH_CASDOOR_ISSUER` | Required | The OpenID Connect issuer for the Casdoor provider. | + | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification and needs to be set only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + | `CASDOOR_WEBHOOK_SECRET` | Optional | A key used to verify whether the request sent by Casdoor is legal. | + + Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#casdoor) for + details on related variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx index 3bf3b1e7574aa..36c72cd04c3e9 100644 --- a/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx @@ -30,92 +30,122 @@ tags: - 你私有部署 Casdoor,其域名为 `https://lobe-auth-api.example.com`。 + ### 创建 Casdoor 应用 -### 创建 Casdoor 应用 - -访问你私有部署的 Casdoor WebUI(默认为 `http://localhost:8000/`) 进入控制台,默认账号为 `admin`,密码为 `123`。 - -前往 `身份认证` -> `应用`,创建一个 `LobeChat` 应用或直接修改内置的 `built-in` 应用,其他字段可以自行探索,但你至少需要配置以下字段: - -- 名称、显示名称:`LobeChat` -- 重定向 URLs: - - 本地开发环境:`http://localhost:3210/api/auth/callback/casdoor` - - 局域网 IP 部署:`http://LOBECHAT_IP:3210/api/auth/callback/casdoor` - - 公网环境:`https://lobe.example.com/api/auth/callback/casdoor` - -还有一些不必需但是可以提高用户体验的字段: - -- Logo:`https://lobehub.com/icon-192x192.png` -- 表单 CSS、表单 CSS(移动端): - -```html - -``` -随后,复制 `客户端 ID` 和 `客户端密钥`,并保存。 + #parent-area + > main + > div + > div.login-content + > div.login-panel + > div.login-form + > div + > div + > button { + box-shadow: none !important; + border-radius: 10px !important; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; + border: 1px solid #eee !important; + } + + @media (max-width: 640px) { + .login-panel { + padding: 40px 0 0 0; + box-shadow: none; + } + } + + + + + ``` + + 随后,复制 `客户端 ID` 和 `客户端密钥`,并保存。 -### 配置环境变量 + ### 配置 Webhook (可选) -将获取到的 `客户端 ID` 和 `客户端`,设为 LobeChat 环境变量中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET`。 + 配置 Casdoor 的 Webhook 以便在用户信息更新时同步到 LobeChat 。 -配置 LobeChat 环境变量中 `AUTH_CASDOOR_ISSUER` 为: + 前往 `管理工具` -> `Webhooks`,创建一个 Webhook,添加一个 Webhook,填写以下字段: -- `http://localhost:8000/`,若你是本地开发环境 -- `http://CASDOOR_IP:8000/`,若你是局域网私有部署的 Casdoor -- `https://lobe-auth-api.example.com/`,若你是公网环境部署的 Casdoor + - 链接:`http://lobe.example.com/api/webhooks/casdoor` + - 方法:`POST` + - 内容类型:`application/json` + - 协议头:`casdoor-secret`: `你的Webhook密钥` -在部署 LobeChat 时,你需要配置以下环境变量: + > 密钥由你自己生成,用于验证 Casdoor 发送的请求是否合法。 可以前往 [https://generate-secret.vercel.app/10](https://generate-secret.vercel.app/10) 生成一个 10 位的密钥。 -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Casdoor 请填写 `casdoor`。 | -| `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用详情页的客户端 ID | -| `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用详情页的客户端密钥 | -| `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 提供程序的 OpenID Connect 颁发者。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + - 事件:`update-user` + - 拓展用户字段:`true` + + 保存,并退出。 将该密钥填写到环境变量中的 `CASDOOR_WEBHOOK_SECRET`。 + + ### 关闭注册 + + 为了保证你的应用安全,建议关闭 Casdoor 的注册功能,改为由管理员手动添加用户。 + + 前往 `身份认证` -> `应用`,将 `启用注册` 设置为 `否`。 + + + Casdoor 的注册功能默认是开启的,若你不关闭注册功能,任何人都可以注册并登录你的应用。 + + + ### 配置环境变量 + + 将获取到的 `客户端 ID` 和 `客户端`,设为 LobeChat 环境变量中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET`。 + + 配置 LobeChat 环境变量中 `AUTH_CASDOOR_ISSUER` 为: + + - `http://localhost:8000/`,若你是本地开发环境 + - `http://CASDOOR_IP:8000/`,若你是局域网私有部署的 Casdoor + - `https://lobe-auth-api.example.com/`,若你是公网环境部署的 Casdoor + + 在部署 LobeChat 时,你需要配置以下环境变量: + + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Casdoor 请填写 `casdoor`。 | + | `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用详情页的客户端 ID | + | `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用详情页的客户端密钥 | + | `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 提供程序的 OpenID Connect 颁发者。 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + | `CASDOOR_WEBHOOK_SECRET` | 可选 | 用于验证 Casdoor 发送的 Webhook 请求是否合法的密钥。 | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#casdoor) 可查阅相关变量详情。 - - + 部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx index 46cb1af6109db..1a33ce9e18f03 100644 --- a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx @@ -17,49 +17,48 @@ tags: ## Cloudflare Zero Trust Configuration Flow -### Creating an Application in Cloudflare Zero Trust + ### Creating an Application in Cloudflare Zero Trust -We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`. + We assume you are already familiar with using the Cloudflare Zero Trust platform and that your LobeChat instance is deployed at `https://chat.example.com`. -First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`. + First, we need to visit `https://one.dash.cloudflare.com/` and navigate to `Access - Applications`. -![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) + ![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) -Now, on the current page, click `Add an application` and select `SaaS`. + Now, on the current page, click `Add an application` and select `SaaS`. -![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) + ![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) -In the `Application` text box, enter the application name, such as `LobeChat SSO`. Then click `Select OIDC`, followed by clicking `Add application`. + In the `Application` text box, enter the application name, such as `LobeChat SSO`. Then click `Select OIDC`, followed by clicking `Add application`. -![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) + ![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) -At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust. + At this point, you have successfully created a SaaS application named `LobeChat SSO` in Cloudflare Zero Trust. -Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address). + Next, we need to enter `https://chat.example.com/api/auth/callback/cloudflare-zero-trust` in the `Redirect URLs` field (note that `chat.example.com` should be replaced with your instance's address). -![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) + ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) -Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat. + Finally, scroll down the page and record the following three values: `Client secret`, `Client ID`, and `Issuer`. You will need these for setting the environment variables when deploying LobeChat. -![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) + ![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `cloudflare-zero-trust` for Cloudflare Zero Trust. | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page | -| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `cloudflare-zero-trust` for Cloudflare Zero Trust. | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | The Client ID from the Cloudflare Zero Trust application provider details page | + | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | The Client Secret from the Cloudflare Zero Trust application provider details page | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | The OpenID Configuration Issuer from the Cloudflare Zero Trust application provider details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It only needs to be set when the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) for details about the variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx index 8100b23c400fa..492cccc476aca 100644 --- a/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx @@ -16,47 +16,46 @@ tags: ## Cloudflare Zero Trust 配置流程 -### 在 Cloudflare Zero Trust 中创建应用 + ### 在 Cloudflare Zero Trust 中创建应用 -我们现在默认您已经了解了如何使用 Cloudflare Zero Trust 平台且假设您的 LobeChat 实例部署在 `https://chat.example.com` 中。 + 我们现在默认您已经了解了如何使用 Cloudflare Zero Trust 平台且假设您的 LobeChat 实例部署在 `https://chat.example.com` 中。 -首先我们需要访问 `https://one.dash.cloudflare.com/` 并前往 `Access - Applications` 中。 + 首先我们需要访问 `https://one.dash.cloudflare.com/` 并前往 `Access - Applications` 中。 -![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) + ![image](https://github.com/user-attachments/assets/4d671a7c-5d94-4c4b-b4fd-71a5a0e9d227) -现在,在所在页面点击 `Add an application` 并选择 `SaaS`。 + 现在,在所在页面点击 `Add an application` 并选择 `SaaS`。 -![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) + ![image](https://github.com/user-attachments/assets/3da4c8c4-88c6-40a9-8005-6a0a44aa3b1f) -在 `Application` 文本框内填入应用名称,如:`LobeChat SSO`,然后点击 `Select OIDC` 后点击 `Add applicaiton` + 在 `Application` 文本框内填入应用名称,如:`LobeChat SSO`,然后点击 `Select OIDC` 后点击 `Add applicaiton` -![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) + ![image](https://github.com/user-attachments/assets/16cd9aef-c87b-48a4-95c0-b666082e7515) -至此您已成功在 Clouflare Zero Trust 中创建了一个名为 `LobeChat SSO` 的 SaaS 应用。 + 至此您已成功在 Clouflare Zero Trust 中创建了一个名为 `LobeChat SSO` 的 SaaS 应用。 -接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址) ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) + 接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址) ![image](https://github.com/user-attachments/assets/433fdce4-0af5-417f-b80d-163c2d4f02f6) -最后我们将页面往下滚动,您将需要记录以下三个值 `Client secret`, `Client ID` 及 `Issuer` 以备后续部署 LobeChat 环境变量使用。 + 最后我们将页面往下滚动,您将需要记录以下三个值 `Client secret`, `Client ID` 及 `Issuer` 以备后续部署 LobeChat 环境变量使用。 -![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) + ![image](https://github.com/user-attachments/assets/2dd3cde5-fa0d-4f52-b82b-28d9e89379a0) -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Cloudflare Zero Trust 请填写 `cloudflare-zero-trust`。 | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client ID`,示例值是 `lobe-chat` | -| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client secret`,示例值是 `insecure_secret` | -| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | 在 Cloudflare Zero Trust 生成的 `Issuer`,例如 `https://example.cloudflareaccess.com/cdn-cgi/access/sso/oidc/7db0f` | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ----------------------------------- | -- | ------------------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Cloudflare Zero Trust 请填写 `cloudflare-zero-trust`。 | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client ID`,示例值是 `lobe-chat` | + | `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client secret`,示例值是 `insecure_secret` | + | `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | 在 Cloudflare Zero Trust 生成的 `Issuer`,例如 `https://example.cloudflareaccess.com/cdn-cgi/access/sso/oidc/7db0f` | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#Cloudflare%20Zero%20Trust) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/github.mdx b/docs/self-hosting/advanced/auth/next-auth/github.mdx index 4fac6487d2cca..66f635f1d0612 100644 --- a/docs/self-hosting/advanced/auth/next-auth/github.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/github.mdx @@ -19,79 +19,52 @@ tags: ### Create a Github Provider -Click [here][github-create-app] to create a new Github App. - -Fill in the Github App name, Homepage URL, and Callback URL. - -Create a Github Provider - -Set the webhook callback URL according to your needs. - -Fill in other fields - -Set the permission to read email addresses. - -Set required permissions -Set permission to read email addresses - -Set whether it is accessible publicly or only accessible to yourself. - -Set whether it is accessible publicly or only accessible to yourself - -Click "Create Github App". - -After successful creation, click "Generate a new client secret" to create a client secret. - -Create a new client secret - -After successful creation, save the `Client ID` and `Client Secret`. - -Create a new client secret - -### Configure Environment Variables - -When deploying LobeChat, you need to configure the following environment variables: - -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | -| `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. | -| `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | - - - Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed - information on these variables. - + Click [here][github-create-app] to create a new Github App. + + Fill in the Github App name, Homepage URL, and Callback URL. + + Create a Github Provider + + Set the webhook callback URL according to your needs. + + Fill in other fields + + Set the permission to read email addresses. + + Set required permissions + + Set permission to read email addresses + + Set whether it is accessible publicly or only accessible to yourself. + + Set whether it is accessible publicly or only accessible to yourself + + Click "Create Github App". + + After successful creation, click "Generate a new client secret" to create a client secret. + + Create a new client secret + + After successful creation, save the `Client ID` and `Client Secret`. + + Create a new client secret + + ### Configure Environment Variables + + When deploying LobeChat, you need to configure the following environment variables: + + | Environment Variable | Type | Description | + | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | + | `AUTH_GITHUB_ID` | Required | Client ID in the Github App details page. | + | `AUTH_GITHUB_SECRET` | Required | Client Secret in the Github App details page. | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | + + + Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#github) for detailed + information on these variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx index 96996d7c81ab6..3417cd7acfb0a 100644 --- a/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx @@ -16,78 +16,51 @@ tags: ### 创建 Github 提供应用 -点击 [这里](https://github.com/settings/apps/new) 创建一个新的 Github App。 - -填写 Github App name、Homepage URL、Callbak URL - -创建 Github 提供程序 -按照自己所需设置Webhook回调地址 - -填写其他字段 - -设置读取邮件地址权限 - -设置所需权限 -设置读取邮件地址权限 - -设置公开访问还是仅自己访问 - -设置公开访问还是仅自己访问 - -点击「Create Github App」 - -创建成功后,点击「Generate a new client secret」创建客户端Secret - -创建新的客户端密钥 - -创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。 - -创建新的客户端密钥 - -### 配置环境变量 - -在部署 LobeChat 时,你需要配置以下环境变量: - -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | -| `AUTH_GITHUB_ID` | 必选 | Github App详情页的 客户端 ID | -| `AUTH_GITHUB_SECRET` | 必选 | Github App详情页的 客户端 Secret | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + 点击 [这里](https://github.com/settings/apps/new) 创建一个新的 Github App。 + + 填写 Github App name、Homepage URL、Callbak URL + + 创建 Github 提供程序 + + 按照自己所需设置 Webhook 回调地址 + + 填写其他字段 + + 设置读取邮件地址权限 + + 设置所需权限 + + 设置读取邮件地址权限 + + 设置公开访问还是仅自己访问 + + 设置公开访问还是仅自己访问 + + 点击「Create Github App」 + + 创建成功后,点击「Generate a new client secret」创建客户端 Secret + + 创建新的客户端密钥 + + 创建成功后, 将 `客户端 ID` 和 `客户端 Secret` 保存下来。 + + 创建新的客户端密钥 + + ### 配置环境变量 + + 在部署 LobeChat 时,你需要配置以下环境变量: + + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | + | `AUTH_GITHUB_ID` | 必选 | Github App 详情页的 客户端 ID | + | `AUTH_GITHUB_SECRET` | 必选 | Github App 详情页的 客户端 Secret | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#github) 可查阅相关变量详情。 - - + -部署成功后,用户将可以通过Github身份认证并使用 LobeChat。 +部署成功后,用户将可以通过 Github 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/logto.mdx b/docs/self-hosting/advanced/auth/next-auth/logto.mdx index 549864b6274db..80bd2acf066f9 100644 --- a/docs/self-hosting/advanced/auth/next-auth/logto.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/logto.mdx @@ -31,52 +31,55 @@ If you are using Logto Cloud, assume its endpoint domain is `https://example.log ### Create Logto Application -Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name. + Access your privately deployed Logto WebUI or [Logto Cloud](http://cloud.logto.io/) to enter the console, and create a `Next.js (App Router)` application under `Applications` with any name. -### Configure Logto + ### Configure Logto -Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`. + Set the `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto` and the `Post sign-out redirect URI` to `https://lobe.example.com/`. -Set `CORS allowed origins` to `https://lobe.example.com`. + Set `CORS allowed origins` to `https://lobe.example.com`. -Configure Logto + Configure Logto -After successful creation, save the `Client ID` and `Client Secret`. + After successful creation, save the `Client ID` and `Client Secret`. -### Configure Environment Variables + ### Configure Webhook (Optional) -Configure Environment Variables + Configure the Logto Webhook so that LobeChat can receive notifications when user information is updated. -Set the obtained `Client ID` and `Client Secret` as `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET` in the LobeChat environment variables. + Go to `Webhooks`, create a Webhook, and fill in the following fields: -Configure `AUTH_LOGTO_ISSUER` in the LobeChat environment variables as follows: + - Endpoint URL: `https://lobe.example.com/api/webhooks/logto` + - Events: `User.Data.Updated` -- `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto -- `https://example.logto.app/oidc` if you are using Logto Cloud + After successful creation, copy the Webhook's `Signing Key` and fill it in the `LOGTO_WEBHOOK_SIGNING_KEY` environment variable. -When deploying LobeChat, you need to configure the following environment variables: + ### Configure Environment Variables -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. | -| `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page | -| `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page | -| `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider | -| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + Configure Environment Variables + + Set the obtained `Client ID` and `Client Secret` as `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET` in the LobeChat environment variables. + + Configure `AUTH_LOGTO_ISSUER` in the LobeChat environment variables as follows: + + - `https://lobe-auth-api.example.com/oidc` if you are using a privately deployed Logto + - `https://example.logto.app/oidc` if you are using Logto Cloud + + When deploying LobeChat, you need to configure the following environment variables: + + | Environment Variable | Type | Description | + | --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can generate a key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LobeChat. For Logto, enter `logto`. | + | `AUTH_LOGTO_ID` | Required | The Client ID from the Logto App details page | + | `AUTH_LOGTO_SECRET` | Required | The Client Secret from the Logto App details page | + | `AUTH_LOGTO_ISSUER` | Required | OpenID Connect issuer of the Logto provider | + | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js during OAuth verification, needed only if the default generated redirect address is incorrect. `https://lobe.example.com/api/auth` | + | `LOGTO_WEBHOOK_SIGNING_KEY` | Optional | The key used to verify the legality of Webhook requests sent by Logto. | Visit [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#logto) for details on related variables. - - + ### Troubleshooting @@ -84,22 +87,22 @@ When deploying LobeChat, you need to configure the following environment variabl If you encounter issues during the Logto deployment process, refer to the following common problems: - `Only roles with the xxx attribute may create roles`: -Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles. + Check your database user's permissions and ensure that the user in your Logto database has the `admin` role to create roles. - Error executing `logto db seed` on third-party databases like `Neon`: -Try using the `logto db seed --encrypt-base-role` command. + Try using the `logto db seed --encrypt-base-role` command. - Database seeding failed: -Try skipping the seeding process with the `--skip-seed` parameter. + Try skipping the seeding process with the `--skip-seed` parameter. - `Error: role xxx already exists`: -Delete the existing role in the database. + Delete the existing role in the database. - Database migration failed after a version upgrade: -Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`). + Try using the command `npx @logto/cli db alteration deploy $version` (e.g., `npx @logto/cli db alteration deploy 1.22.0`). - I am using Docker deployment and want a one-click upgrade: -Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` + Execute the custom command in the container: `sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` After successful deployment, users will be able to authenticate via Logto and use LobeChat. diff --git a/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx index a97d2031a1181..de708e5537fe9 100644 --- a/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx @@ -28,52 +28,55 @@ tags: ### 创建 Logto 应用 -访问你私有部署的 Logto WebUI 或者 [Logto Cloud](http://cloud.logto.io/) 进入控制台,在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意 + 访问你私有部署的 Logto WebUI 或者 [Logto Cloud](http://cloud.logto.io/) 进入控制台,在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意 -### 配置 Logto + ### 配置 Logto -配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/` + 配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/` -配置 `CORS allowed origins` 为 `https://lobe.example.com` + 配置 `CORS allowed origins` 为 `https://lobe.example.com` -配置 Logto + 配置 Logto -创建成功后, 将 `Client ID` 和 `Client Secret` 保存下来。 + 创建成功后, 将 `Client ID` 和 `Client Secret` 保存下来。 -### 配置环境变量 + ### 配置 Webhook (可选) -配置环境变量 + 配置 Logto 的 Webhook,以便在用户信息更新时 LobeChat 可以接收到通知。 -将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET`。 + 前往 `Webhooks` ,创建一个 Webhook,填写以下字段: -配置 LobeChat 环境变量中 `AUTH_LOGTO_ISSUER` 为: + - 端点 URL: `https://lobe.example.com/api/webhooks/logto` + - 事件: `User.Data.Updated` -- `https://lobe-auth-api.example.com/oidc`,若你是私有部署的 Logto -- `https://example.logto.app/oidc`,若你是使用的 Logto Cloud + 创建成功后,复制 Webhook 的 `签名密钥`。填写到环境变量中的 `LOGTO_WEBHOOK_SIGNING_KEY`。 -在部署 LobeChat 时,你需要配置以下环境变量: + ### 配置环境变量 -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Logto 请填写 `logto`。 | -| `AUTH_LOGTO_ID` | 必选 | Logto App 详情页的 Client ID | -| `AUTH_LOGTO_SECRET` | 必选 | Logto App 详情页的 Client Secret | -| `AUTH_LOGTO_ISSUER` | 必选 | Logto 提供程序的 OpenID Connect 颁发者 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + 配置环境变量 + + 将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET`。 + + 配置 LobeChat 环境变量中 `AUTH_LOGTO_ISSUER` 为: + + - `https://lobe-auth-api.example.com/oidc`,若你是私有部署的 Logto + - `https://example.logto.app/oidc`,若你是使用的 Logto Cloud + + 在部署 LobeChat 时,你需要配置以下环境变量: + + | 环境变量 | 类型 | 描述 | + | --------------------------- | -- | ------------------------------------------------------------------------------------------------ | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Logto 请填写 `logto`。 | + | `AUTH_LOGTO_ID` | 必选 | Logto App 详情页的 Client ID | + | `AUTH_LOGTO_SECRET` | 必选 | Logto App 详情页的 Client Secret | + | `AUTH_LOGTO_ISSUER` | 必选 | Logto 提供程序的 OpenID Connect 颁发者 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://lobe.example.com/api/auth` | + | `LOGTO_WEBHOOK_SIGNING_KEY` | 可选 | 用于验证 Logto 发送的 Webhook 请求是否合法的密钥。 | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#logto) 可查阅相关变量详情。 - - + ### 故障排除 @@ -81,21 +84,21 @@ tags: 若你在部署 Logto 过程中遇到问题,可以参考以下常见问题: - `Only roles with the xxx attribute may create roles`: -请检查你的数据库用户权限,确保你的 Logto 数据库中的用户具有 `admin` 角色,以便创建角色。 + 请检查你的数据库用户权限,确保你的 Logto 数据库中的用户具有 `admin` 角色,以便创建角色。 - 在第三方数据库例如 `Neon` 上执行`logto db seed`出错: -尝试使用`logto db seed --encrypt-base-role`命令。 + 尝试使用`logto db seed --encrypt-base-role`命令。 - 数据库播种失败: -请尝试使用`--skip-seed`参数跳过播种。 + 请尝试使用`--skip-seed`参数跳过播种。 - `Error: role xxx already exists`: -在数据库中删除已存在的角色即可。 + 在数据库中删除已存在的角色即可。 - 版本升级后,数据库迁移失败: -请尝试使用` npx @logto/cli db alteration deploy $version`命令(例如`npx @logto/cli db alteration deploy 1.22.0`) + 请尝试使用` npx @logto/cli db alteration deploy $version`命令 (例如`npx @logto/cli db alteration deploy 1.22.0`) - 我使用 docker 部署 希望一键升级: -在容器中执行自定义命令:`sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` + 在容器中执行自定义命令:`sh -c "npm run cli db seed -- --swe --encrypt-base-role" && npx @logto/cli db alteration deploy $version && npm start` 部署成功后,用户将可以通过 Logto 身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx index 6a6ca7bf2a5a4..a16c4b542236d 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx @@ -18,72 +18,59 @@ tags: ### Create a Microsoft Entra ID Application -In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application. + In your [Microsoft Azure Portal][microsoft-azure-portal], go to Microsoft Entra ID -> App registrations -> New registration to create a new application. -Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`. + Fill in the desired application name to be displayed to organizational users, choose the account types you wish to support, and if only internal users are supported, select `Accounts in this organizational directory only (Default Directory only - Single tenant)`. -In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter: + In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter: -```bash -https://your-domain/api/auth/callback/microsoft-entra-id -``` + ```bash + https://your-domain/api/auth/callback/microsoft-entra-id + ``` - - - You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter - matches the deployed URL. - Please replace "your-domain" with your own domain. - - -App Register + + - You can fill in or modify the Redirect URIs after registering, but make sure the URL you enter + matches the deployed URL. - Please replace "your-domain" with your own domain. + -Click on "Register". + App Register -After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information. + Click on "Register". -App Overview + After successfully creating the application, click on the corresponding application to enter the application details page, and switch to the "Overview" tab to view the corresponding configuration information. -Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret. + App Overview -Create App Client Secret + Go to "Certificates & secrets", select the "Client secrets" tab, click on "New client secret", fill in the description, select the expiration time, and click on "Add" to create a new client secret. - - Please make sure to save your client secret as this is your only chance to view it. - + Create App Client Secret -### Add Users + + Please make sure to save your client secret as this is your only chance to view it. + -Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat. + ### Add Users -### Configure Environment Variables + Go back to the "Microsoft Entra ID" interface, enter "Users", click on "New user", fill in the user information, and click on "Create" to create a user for using LobeChat. -When deploying LobeChat, you need to configure the following environment variables: + ### Configure Environment Variables -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. | -| `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. | -| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. | -| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` | + When deploying LobeChat, you need to configure the following environment variables: - - You can refer to [📘 environment - variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related - variables. - + | Environment Variable | Type | Description | + | ----------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. | + | `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. | + | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. | + | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` | + + You can refer to [📘 environment + variables](/docs/self-hosting/environment-variable#microsoft-entra-id) for details on related + variables. + diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx index 276268abebf66..5df442de86634 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx @@ -17,68 +17,55 @@ tags: ### 创建 Microsoft Entra ID 应用 -在你的 [Microsoft Azure Portal][microsoft-azure-portal] 进入 Microsoft Entra ID -> App registrations -> New registration 创建一个新的应用。 + 在你的 [Microsoft Azure Portal][microsoft-azure-portal] 进入 Microsoft Entra ID -> App registrations -> New registration 创建一个新的应用。 -填写你想向组织用户显示的应用名称,选择你期望支持的账户类型,如果只支持内部用户请选择 `Accounts in this organizational directory only (Default Directory only - Single tenant)`。 + 填写你想向组织用户显示的应用名称,选择你期望支持的账户类型,如果只支持内部用户请选择 `Accounts in this organizational directory only (Default Directory only - Single tenant)`。 -在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写: + 在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写: -```bash -https://your-domain/api/auth/callback/microsoft-entra-id -``` + ```bash + https://your-domain/api/auth/callback/microsoft-entra-id + ``` - - - 可以在 Register 后再填写或修改 Redirect URIs,但是务必保证填写的 URL 与部署的 URL 一致。 - - your-domain 请填写自己的域名 - + + - 可以在 Register 后再填写或修改 Redirect URIs,但是务必保证填写的 URL 与部署的 URL 一致。 - + your-domain 请填写自己的域名 + -App Register + App Register -点击「Register」 + 点击「Register」 -创建成功后,点击相应的应用,进入应用详情页,切换到「Overview」标签页,就可以看到相应的配置信息。 + 创建成功后,点击相应的应用,进入应用详情页,切换到「Overview」标签页,就可以看到相应的配置信息。 -App Overview + App Overview -进入「Certificates & secrets」,选择「Client secrets」标签,点击「New client secret」,填写描述,选择过期时间,点击「Add」,创建一个新的客户端密钥。 + 进入「Certificates & secrets」,选择「Client secrets」标签,点击「New client secret」,填写描述,选择过期时间,点击「Add」,创建一个新的客户端密钥。 -Create App Client Secret + Create App Client Secret -请务必保存好你的客户端密钥,因为这是你唯一的机会查看它。 + 请务必保存好你的客户端密钥,因为这是你唯一的机会查看它。 -### 新增用户 + ### 新增用户 -回到「Microsoft Entra ID」界面,进入「Users」,点击「New user」,填写用户信息,点击「Create」,创建用户以使用 LobeChat。 + 回到「Microsoft Entra ID」界面,进入「Users」,点击「New user」,填写用户信息,点击「Create」,创建用户以使用 LobeChat。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`。 | -| `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID | -| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret | -| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ----------------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`。 | + | `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID | + | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret | + | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variable#microsoft-entra-id) 可查阅相关变量详情。 - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx b/docs/self-hosting/advanced/auth/next-auth/wechat.mdx index bff736904ede0..adc9e84447105 100644 --- a/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/wechat.mdx @@ -18,28 +18,27 @@ tags: ### Create a Wechat Application -Click [here](https://open.weixin.qq.com/cgi-bin/index) and then click "Management Center", "Website Application", and "Create Website Application" in sequence. + Click [here](https://open.weixin.qq.com/cgi-bin/index) and then click "Management Center", "Website Application", and "Create Website Application" in sequence. -Fill in the information as required by the official website prompts and submit for review. + Fill in the information as required by the official website prompts and submit for review. -After successful creation, click "Application Details" to obtain the AppID and AppSecret. + After successful creation, click "Application Details" to obtain the AppID and AppSecret. -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | -| `WECHAT_CLIENT_ID` | Required | Client ID from the Wechat website application details page | -| `WECHAT_CLIENT_SECRET` | Required | Client Secret from the Wechat website application details page | -| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. | + | `WECHAT_CLIENT_ID` | Required | Client ID from the Wechat website application details page | + | `WECHAT_CLIENT_SECRET` | Required | Client Secret from the Wechat website application details page | + | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. Only set it if the default generated redirect address is incorrect. `https://example.com/api/auth` | Go to [📘 Environment Variables](/en/docs/self-hosting/environment-variables/auth#wechat) for more details about related variables. - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx index 24e25ad136ea4..8c710c27d6869 100644 --- a/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx @@ -11,33 +11,32 @@ tags: # 配置微信身份验证服务 -##微信配置流程 +\## 微信配置流程 ### 创建微信网站应用 -点击 [这里](https://open.weixin.qq.com/cgi-bin/index) 依次点击“管理中心”、“网站应用”、“创建网站应用” + 点击 [这里](https://open.weixin.qq.com/cgi-bin/index) 依次点击 “管理中心”、“网站应用”、“创建网站应用” -按照管网提示要求填写信息并提交审核。 + 按照管网提示要求填写信息并提交审核。 -创建成功后,点击“应用详情”,可获知AppID和AppSecret。 + 创建成功后,点击 “应用详情”,可获知 AppID 和 AppSecret。 -### 配置环境变量 + ### 配置环境变量 -在部署 LobeChat 时,你需要配置以下环境变量: + 在部署 LobeChat 时,你需要配置以下环境变量: -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | -| `WECHAT_CLIENT_ID` | 必选 |微信网站应用详情页的 客户端 ID | -| `WECHAT_CLIENT_SECRET` | 必选 |微信网站应用详情页的 客户端 Secret | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 | + | `WECHAT_CLIENT_ID` | 必选 | 微信网站应用详情页的 客户端 ID | + | `WECHAT_CLIENT_SECRET` | 必选 | 微信网站应用详情页的 客户端 Secret | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` | 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#wechat) 可查阅相关变量详情。 - - + 部署成功后,用户将可以通过微信开放平台身份认证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx index cb2395680e65e..f9a0747c64179 100644 --- a/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx @@ -17,99 +17,65 @@ tags: ### Create ZITADEL Application -Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application. + Log in to the console of your ZITADEL instance using an account with at least a [`Project Owner` role](https://zitadel.com/docs/guides/manage/console/managers#roles), navigate to (or [create](https://zitadel.com/docs/guides/manage/console/projects#create-a-project)) the project you'd like to host your application in, and click the **New** button to create an application. -Create ZITADEL Application S1 + Create ZITADEL Application S1 -Fill in the name, choose **Web** as the application type, and click **Continue**. + Fill in the name, choose **Web** as the application type, and click **Continue**. -Create ZITADEL Application S2 + Create ZITADEL Application S2 -Choose **Code** as the authentication method. + Choose **Code** as the authentication method. -Create ZITADEL Application S3 + Create ZITADEL Application S3 -In the **Redirect URIs** field, fill in: + In the **Redirect URIs** field, fill in: -``` -http(s)://your-domain/api/auth/callback/zitadel -``` + ``` + http(s)://your-domain/api/auth/callback/zitadel + ``` -Create ZITADEL Application S4 + Create ZITADEL Application S4 - - - You can fill in or modify redirect URIs after creating the application, but make sure the filled - URL is consistent with the deployed URL. + + - You can fill in or modify redirect URIs after creating the application, but make sure the filled + URL is consistent with the deployed URL. -- Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to. + - Replace `http(s)://your-domain` with the actual URL that LobeChat is deployed to. + - - -Confirm the configuration and click **Create**. + Confirm the configuration and click **Create**. -Create ZITADEL Application S5 + Create ZITADEL Application S5 -Save the **ClientId** and **ClientSecret** for later use. + Save the **ClientId** and **ClientSecret** for later use. -Create ZITADEL Application S6 + Create ZITADEL Application S6 -In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside ID Token** option, and click **Save**. + In the application settings page, navigate to the **Token Settings** tab, enable **User Info inside ID Token** option, and click **Save**. -Create ZITADEL Application S7 + Create ZITADEL Application S7 -Navigate to the **URLs** tab, and save the **issuer** URL. + Navigate to the **URLs** tab, and save the **issuer** URL. -Create ZITADEL Application S8 + Create ZITADEL Application S8 -### Configure Environment Variables + ### Configure Environment Variables -When deploying LobeChat, you need to configure the following environment variables: + When deploying LobeChat, you need to configure the following environment variables: -| Environment Variable | Type | Description | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. | -| `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application | -| `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application | -| `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application | -| `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | + | Environment Variable | Type | Description | + | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. | + | `AUTH_ZITADEL_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application | + | `AUTH_ZITADEL_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application | + | `AUTH_ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application | + | `NEXTAUTH_URL` | Required | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` | You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel). - - + diff --git a/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx index 5599247c4c023..499afb9cc5d1a 100644 --- a/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx @@ -14,98 +14,64 @@ tags: ### 创建 ZITADEL 应用 -使用具有 [`Project Owner` 角色](https://zitadel.com/docs/guides/manage/console/managers#roles)的账户登录到 ZITADEL 实例控制台,进入(或[创建](https://zitadel.com/docs/guides/manage/console/projects#create-a-project))该应用所属的项目,点击「创建」按钮创建应用。 + 使用具有 [`Project Owner` 角色](https://zitadel.com/docs/guides/manage/console/managers#roles)的账户登录到 ZITADEL 实例控制台,进入(或[创建](https://zitadel.com/docs/guides/manage/console/projects#create-a-project))该应用所属的项目,点击「创建」按钮创建应用。 -创建 ZITADEL 应用 1 + 创建 ZITADEL 应用 1 -填写应用名称,应用类型选择「Web」,点击「继续」。 + 填写应用名称,应用类型选择「Web」,点击「继续」。 -创建 ZITADEL 应用 2 + 创建 ZITADEL 应用 2 -选择「Code」作为身份验证方式。 + 选择「Code」作为身份验证方式。 -创建 ZITADEL 应用 3 + 创建 ZITADEL 应用 3 -在「重定向 URLs」字段中填写: + 在「重定向 URLs」字段中填写: -``` -http(s)://your-domain/api/auth/callback/zitadel -``` + ``` + http(s)://your-domain/api/auth/callback/zitadel + ``` -创建 ZITADEL 应用 4 + 创建 ZITADEL 应用 4 - - - 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。 + + - 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。 -- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。 + - 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。 + - + 确认配置并点击「创建」。 -确认配置并点击「创建」。 + 创建 ZITADEL 应用 5 -创建 ZITADEL 应用 5 + 记录下「ClientId」和「ClientSecret」备用。 -记录下「ClientId」和「ClientSecret」备用。 + 创建 ZITADEL 应用 6 -创建 ZITADEL 应用 6 + 在应用设置页面中,切换到「令牌设置」选项卡,勾选「在 ID Token 中包含用户信息」选项,点击「保存」。 -在应用设置页面中,切换到「令牌设置」选项卡,勾选「在 ID Token 中包含用户信息」选项,点击「保存」。 + 创建 ZITADEL 应用 7 -创建 ZITADEL 应用 7 + 切换到「URLs」选项卡,记录下「issuer」URL。 -切换到「URLs」选项卡,记录下「issuer」URL。 + 创建 ZITADEL 应用 8 -创建 ZITADEL 应用 8 + ### 配置环境变量 -### 配置环境变量 + 部署 LobeChat 时,您需要配置以下环境变量: -部署 LobeChat 时,您需要配置以下环境变量: - -| 环境变量 | 类型 | 描述 | -| --- | --- | --- | -| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` | -| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 | -| `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 | -| `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 | -| `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 | -| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` | + | 环境变量 | 类型 | 描述 | + | ------------------------- | -- | ----------------------------------------------------------------------------------- | + | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` | + | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 | + | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 | + | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 | + | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 | + | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 中执行 OAuth 认证的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` | 您可以在 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 中查看相关变量的详细信息。 - - + 部署成功后,用户将能够通过 ZITADEL 中配置的用户进行身份验证并使用 LobeChat。 diff --git a/docs/self-hosting/advanced/feature-flags.zh-CN.mdx b/docs/self-hosting/advanced/feature-flags.zh-CN.mdx index a3933fe93a55f..14f5a08db4b08 100644 --- a/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +++ b/docs/self-hosting/advanced/feature-flags.zh-CN.mdx @@ -28,20 +28,20 @@ tags: 关键字,你需要手动控制所有的功能标志(否则它们会采用对应的默认值)。 -| 配置项 | 解释 | 默认值 | -| ------------------------- | -------------------------------- | ------ | -| `webrtc_sync` | 启用 WebRTC 同步功能。 | 关闭 | -| `language_model_settings` | 启用语言模型设置。 | 开启 | -| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 | -| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 | -| `create_session` | 允许用户创建会话。 | 开启 | -| `edit_agent` | 允许用户编辑助手。 | 开启 | -| `dalle` | 启用 DALL-E 功能。 | 开启 | -| `check_updates` | 允许检查更新。 | 开启 | -| `welcome_suggest` | 显示欢迎建议。 | 开启 | -| `market` | 启用助手市场功能。 | 开启 | -| `speech_to_text` | 启用语音转文本功能。 | 开启 | -| `knowledge_base` | 启用知识库功能。 | 开启 | -| `clerk_sign_up` | 启用Clerk注册功能。 | 开启 | +| 配置项 | 解释 | 默认值 | +| ------------------------- | ----------------------- | --- | +| `webrtc_sync` | 启用 WebRTC 同步功能。 | 关闭 | +| `language_model_settings` | 启用语言模型设置。 | 开启 | +| `openai_api_key` | 允许用户自定义 OpenAI API Key。 | 开启 | +| `openai_proxy_url` | 允许用户自定义 OpenAI 代理 URL。 | 开启 | +| `create_session` | 允许用户创建会话。 | 开启 | +| `edit_agent` | 允许用户编辑助手。 | 开启 | +| `dalle` | 启用 DALL-E 功能。 | 开启 | +| `check_updates` | 允许检查更新。 | 开启 | +| `welcome_suggest` | 显示欢迎建议。 | 开启 | +| `market` | 启用助手市场功能。 | 开启 | +| `speech_to_text` | 启用语音转文本功能。 | 开启 | +| `knowledge_base` | 启用知识库功能。 | 开启 | +| `clerk_sign_up` | 启用 Clerk 注册功能。 | 开启 | 你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。 diff --git a/docs/self-hosting/advanced/knowledge-base.mdx b/docs/self-hosting/advanced/knowledge-base.mdx index 219bf38af4c71..dd9b1df9446f0 100644 --- a/docs/self-hosting/advanced/knowledge-base.mdx +++ b/docs/self-hosting/advanced/knowledge-base.mdx @@ -1,3 +1,16 @@ +--- +title: LobeChat Knowledge Base / File Upload +description: >- + Explore LobeChat's file upload and knowledge base management features with + core components. +tags: + - LobeChat + - File Upload + - Knowledge Base + - PostgreSQL + - OpenAI Embedding +--- + # Knowledge Base / File Upload LobeChat supports file upload and knowledge base management. This feature relies on the following core technical components. Understanding these components will help you successfully deploy and maintain the knowledge base system. @@ -32,9 +45,7 @@ S3 (or S3-compatible storage services) is used for storing uploaded files. OpenAI's Embedding service is used to convert text into vector representations. - -LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model. - + LobeChat currently uses OpenAI's `text-embedding-3-small` model by default. Ensure your API Key has access to this model. - **Purpose**: Generate vector representations for semantic search @@ -51,3 +62,13 @@ Unstructured.io is a powerful document processing tool. - **Note**: Evaluate processing needs based on document complexity By correctly configuring and integrating these core components, you can build a powerful and efficient knowledge base system for LobeChat. Each component plays a crucial role in the overall architecture, supporting advanced document management and intelligent retrieval functions. + +### 5. Custom Embedding + +- **Purpose**: Use different Embedding generate vector representations for semantic search +- **Options**: support model provider list: zhipu/github/openai/bedrock/ollama +- **Deployment Tip**: Used to configure the default Embedding model + +``` +environment: DEFAULT_FILES_CONFIG=embedding_model=openai/embedding-text-3-small +``` diff --git a/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx b/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx index 075fa57d65817..b8af042c74a08 100644 --- a/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +++ b/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx @@ -1,3 +1,14 @@ +--- +title: LobeChat 知识库 / 文件上传 +description: 了解 LobeChat 的文件上传和知识库管理核心组件,助力成功部署。 +tags: + - LobeChat + - 文件上传 + - 知识库管理 + - PostgreSQL + - OpenAI +--- + # 知识库 / 文件上传 LobeChat 支持文件上传 / 知识库管理。该功能依赖于以下核心技术组件,了解这些组件将有助于你成功部署和维护知识库系统。 @@ -32,9 +43,7 @@ S3(或兼容 S3 协议的存储服务)用于存储上传的文件。 OpenAI 的嵌入(Embedding)服务用于将文本转化为向量表示。 - -LobeChat 当前默认使用 OpenAI `text-embedding-3-small` 模型,请确保你的 API Key 可以访问该模型。 - + LobeChat 当前默认使用 OpenAI `text-embedding-3-small` 模型,请确保你的 API Key 可以访问该模型。 - **用途**:生成文本的向量表示,用于语义搜索 @@ -51,3 +60,13 @@ Unstructured.io 是一个强大的文档处理工具。 - **注意事项**:评估处理需求,根据文档复杂度决定是否部署 通过正确配置和集成这些核心组件,您可以为 LobeChat 构建一个强大、高效的知识库系统。每个组件都在整体架构中扮演着关键角色,共同支持高级的文档管理和智能检索功能。 + +### 5. 自定义 Embedding(可选) + +- **用途**: 使用不同的嵌入模型(Embedding)生成文本的向量表示,用于语义搜索 +- **选项**: 支持的模型提供商:zhipu/github/openai/bedrock/ollama +- **部署建议**: 使用环境变量配置默认嵌入模型 + +``` +environment: DEFAULT_FILES_CONFIG=embedding_model=openai/embedding-text-3-small +``` diff --git a/docs/self-hosting/advanced/model-list.mdx b/docs/self-hosting/advanced/model-list.mdx index f3fbd577124a0..760eec163a281 100644 --- a/docs/self-hosting/advanced/model-list.mdx +++ b/docs/self-hosting/advanced/model-list.mdx @@ -17,7 +17,7 @@ LobeChat supports customizing the model list during deployment. This configurati You can use `+` to add a model, `-` to hide a model, and use `model name=display name` to customize the display name of a model, separated by English commas. The basic syntax is as follows: ```text -id=displayName,model2,model3 +id=displayName,model2,model3 ``` For example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo` @@ -29,7 +29,7 @@ In the above example, it adds `qwen-7b-chat` and `glm-6b` to the model list, rem Considering the diversity of model capabilities, we started to add extension configuration in version `0.147.8`, with the following rules: ```shell -id=displayName +id=displayName ``` The first value in angle brackets is designated as the `maxToken` for this model. The second value and beyond are the model's extension capabilities, separated by colons `:`, and the order is not important. @@ -39,12 +39,14 @@ Examples are as follows: - `chatglm-6b=ChatGLM 6B<4096>`: ChatGLM 6B, maximum context of 4k, no advanced capabilities; - `spark-v3.5=讯飞星火 v3.5<8192:fc>`: Xunfei Spark 3.5 model, maximum context of 8k, supports Function Call; - `gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>`: Google Vision model, maximum context of 16k, supports image recognition; +- `o3-mini=OpenAI o3-mini<200000:reasoning:fc>`: OpenAI o3-mini model, maximum context of 200k, supports reasoning and Function Call; - `gpt-4-all=ChatGPT Plus<128000:fc:vision:file>`, hacked version of ChatGPT Plus web, context of 128k, supports image recognition, Function Call, file upload. Currently supported extension capabilities are: -| --- | Description | -| -------- | -------------------------------------------------------- | -| `fc` | Function Calling | -| `vision` | Image Recognition | -| `file` | File Upload (a bit hacky, not recommended for daily use) | +| --- | Description | +| ----------- | -------------------------------------------------------- | +| `fc` | Function Calling | +| `vision` | Image Recognition | +| `reasoning` | Support Reasoning | +| `file` | File Upload (a bit hacky, not recommended for daily use) | diff --git a/docs/self-hosting/advanced/model-list.zh-CN.mdx b/docs/self-hosting/advanced/model-list.zh-CN.mdx index 6ade0e71e6766..543c7e7188432 100644 --- a/docs/self-hosting/advanced/model-list.zh-CN.mdx +++ b/docs/self-hosting/advanced/model-list.zh-CN.mdx @@ -16,7 +16,7 @@ LobeChat 支持在部署时自定义模型列表,详情请参考 [模型提供 你可以使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。通过 `<>` 来添加扩展配置。基本语法如下: ```text -id=displayName,model2,model3 +id=displayName,model2,model3 ``` 例如: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo` @@ -28,7 +28,7 @@ id=displayName,model2,model3 考虑到模型的能力多样性,我们在 `0.147.8` 版本开始增加扩展性配置,它的规则如下: ```shell -id=displayName +id=displayName ``` 尖括号第一个值约定为这个模型的 `maxToken` 。第二个及以后作为模型的扩展能力,能力与能力之间用冒号 `:` 作为分隔符,顺序不重要。 @@ -38,12 +38,14 @@ id=displayName - `chatglm-6b=ChatGLM 6B<4096>`:ChatGLM 6B,最大上下文 4k,没有高阶能力; - `spark-v3.5=讯飞星火 v3.5<8192:fc>`:讯飞星火 3.5 模型,最大上下文 8k,支持 Function Call; - `gemini-1.5-flash-latest=Gemini 1.5 Flash<16000:vision>`:Google 视觉模型,最大上下文 16k,支持图像识别; +- `o3-mini=OpenAI o3-mini<200000:reasoning:fc>`:OpenAI o3-mini 模型,最大上下文 200k,支持推理及 Function Call; - `gpt-4-all=ChatGPT Plus<128000:fc:vision:file>`,hack 的 ChatGPT Plus 网页版,上下 128k ,支持图像识别、Function Call、文件上传 目前支持的扩展能力有: -| --- | 描述 | -| -------- | ------------------------------------ | -| `fc` | 函数调用(function calling) | -| `vision` | 视觉识别 | -| `file` | 文件上传(比较hack,不建议日常使用) | +| --- | 描述 | +| ----------- | ---------------------- | +| `fc` | 函数调用(function calling) | +| `vision` | 视觉识别 | +| `reasoning` | 支持推理 | +| `file` | 文件上传(比较 hack,不建议日常使用) | diff --git a/docs/self-hosting/advanced/observability/langfuse.mdx b/docs/self-hosting/advanced/observability/langfuse.mdx new file mode 100644 index 0000000000000..46110892f1165 --- /dev/null +++ b/docs/self-hosting/advanced/observability/langfuse.mdx @@ -0,0 +1,75 @@ +--- +title: Observability and Tracing for LobeChat +description: >- + Enhance your LobeChat applications with open-source observability and tracing + using Langfuse. Automatically capture detailed traces and metrics for every + request to optimize and debug your chats. +tags: + - Observability + - Tracing + - Langfuse +--- + +# Monitor your LobeChat application with Langfuse + +## What is Langfuse? + +[Langfuse](https://langfuse.com/) an **open-source LLM Observability platform**. By enabling the Langfuse integration, you can trace your application data to develop, monitor, and improve the use of LobeChat, including: + +- Application [traces](https://langfuse.com/docs/tracing) +- Usage patterns +- Cost data by user and model +- [Evaluations](https://langfuse.com/docs/scores/overview) + +## Get Started + + + ### Set up Langfuse + + Get your Langfuse API key by signing up for [Langfuse Cloud](https://cloud.langfuse.com) or [self-hosting](https://langfuse.com/docs/deployment/self-host) Langfuse. + + ### Set up LobeChat + + There are multiple ways to [self-host LobeChat](https://lobehub.com/docs/self-hosting/start). For this example, we will use the Docker Desktop deployment. + + + + Before deploying LobeChat, set the following four environment variables with the Langfuse API keys you created in the previous step. + + ```sh + ENABLE_LANGFUSE = '1' + LANGFUSE_SECRET_KEY = 'sk-lf...' + LANGFUSE_PUBLIC_KEY = 'pk-lf...' + LANGFUSE_HOST = 'https://cloud.langfuse.com' + ``` + + + + Before running the Docker container, set the environment variables in the Docker Desktop with the Langfuse API keys you created in the previous step. + + {'Environment + + + + ### Activate Analytics in Settings + + Once you have LobeChat running, navigate to the **About** tab in the **Settings** and activate analytics. This is necessary for traces to be sent to Langfuse. + + {'LobeChat + + ### See Chat Traces in Langfuse + + After setting your LLM model key, you can start interacting with your LobeChat application. + + {'LobeChat + + All conversations in the chat are automatically traced and sent to Langfuse. You can view the traces in the [Traces section](https://langfuse.com/docs/tracing) in the Langfuse UI. + + {'LobeChat + + *[Example trace in the Langfuse UI](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/traces/63e9246d-3f22-4e45-936d-b0c4ccf55a1e?timestamp=2024-11-26T17%3A00%3A02.028Z\&observation=7ea75a0c-d9d1-425c-9b88-27561c63b413)* + + +## Feedback + +If you have any feedback or requests, please create a GitHub [Issue](https://langfuse.com/issue) or share your work with the Langfuse community on [Discord](https://discord.langfuse.com/). diff --git a/docs/self-hosting/advanced/observability/langfuse.zh-CN.mdx b/docs/self-hosting/advanced/observability/langfuse.zh-CN.mdx new file mode 100644 index 0000000000000..1018117d2588b --- /dev/null +++ b/docs/self-hosting/advanced/observability/langfuse.zh-CN.mdx @@ -0,0 +1,70 @@ +--- +title: LobeChat 的可观测性和追踪 +description: 使用 Langfuse 为你的 LobeChat 应用增强开源可观测性和追踪功能。自动捕获每个请求的详细追踪和指标,以优化和调试你的对话。 +tags: + - 可观测性 + - 追踪 + - Langfuse +--- + +# 使用 Langfuse 监控你的 LobeChat 应用 + +## 什么是 Langfuse? + +[Langfuse](https://langfuse.com/) 是一个 **开源的 LLM 可观测性平台**。启用 Langfuse 集成后,你可以追踪应用数据,以开发、监控和优化 LobeChat 的使用,包括: + +- 应用 [追踪](https://langfuse.com/docs/tracing) +- 使用模式 +- 按用户和模型的成本数据 +- [评估](https://langfuse.com/docs/scores/overview) + +## 快速开始 + + + ### 设置 Langfuse + + 通过注册 [Langfuse Cloud](https://cloud.langfuse.com) 或 [自托管](https://langfuse.com/docs/deployment/self-host) Langfuse 来获取你的 Langfuse API 密钥。 + + ### 设置 LobeChat + + 有多种方式可以 [自托管 LobeChat](https://lobehub.com/docs/self-hosting/start)。在本示例中,我们将使用 Docker Desktop 部署。 + + + + 在部署 LobeChat 之前,使用你在上一步创建的 Langfuse API 密钥设置以下四个环境变量。 + + ```sh + ENABLE_LANGFUSE = '1' + LANGFUSE_SECRET_KEY = 'sk-lf...' + LANGFUSE_PUBLIC_KEY = 'pk-lf...' + LANGFUSE_HOST = 'https://cloud.langfuse.com' + ``` + + + + 在运行 Docker 容器之前,在 Docker Desktop 中设置环境变量,并填入你在上一步创建的 Langfuse API 密钥。 + + {'Docker + + + + ### 在设置中启用分析功能 + + 当 LobeChat 运行后,进入 **设置** 中的 **关于** 选项卡,并启用分析功能。这是将追踪数据发送到 Langfuse 所必需的。 + + {'LobeChat + + ### 在 Langfuse 中查看聊天追踪 + + 设置好 LLM 模型密钥后,你就可以开始与 LobeChat 进行交互。 + + {'LobeChat + + 所有对话都会被自动追踪并发送到 Langfuse。你可以在 Langfuse UI 的 [追踪部分](https://langfuse.com/docs/tracing) 查看这些数据。 + + {'LobeChat + + +## 反馈 + +如果你有任何反馈或需求,请在 GitHub 上创建 [Issue](https://langfuse.com/issue),或在 [Discord](https://discord.langfuse.com/) 上与 Langfuse 社区分享你的想法。 diff --git a/docs/self-hosting/advanced/s3.mdx b/docs/self-hosting/advanced/s3.mdx index 9c5fe3b995bfd..9d22d8aa55c0c 100644 --- a/docs/self-hosting/advanced/s3.mdx +++ b/docs/self-hosting/advanced/s3.mdx @@ -26,60 +26,55 @@ The best practice in this area is to use a file storage service (S3) to store im ### `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` -These are the two keys required by all S3 compatible storage services to access the S3 storage service, not detailed here. + These are the two keys required by all S3 compatible storage services to access the S3 storage service, not detailed here. -### `S3_ENDPOINT` + ### `S3_ENDPOINT` -The request endpoint of the storage bucket. Note that this link should not contain the name of the storage bucket. + The request endpoint of the storage bucket. Note that this link should not contain the name of the storage bucket. - - `S3_ENDPOINT` must remove the suffix path, otherwise the uploaded files will not be accessible - + + `S3_ENDPOINT` must remove the suffix path, otherwise the uploaded files will not be accessible + -For example, for Cloudflare: + For example, for Cloudflare: -```shell -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -``` + ```shell + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + ``` -### `S3_BUCKET` and `S3_REGION` + ### `S3_BUCKET` and `S3_REGION` -The name and region of the storage bucket. `S3_BUCKET` is required to specify the name of the storage bucket. `S3_REGION` is optional and is used to specify the region of the storage bucket. Generally, it does not need to be added, but some service providers may require configuration. + The name and region of the storage bucket. `S3_BUCKET` is required to specify the name of the storage bucket. `S3_REGION` is optional and is used to specify the region of the storage bucket. Generally, it does not need to be added, but some service providers may require configuration. -### `S3_SET_ACL` + ### `S3_SET_ACL` -Whether to set the ACL to `public-read` when uploading files. This option is enabled by default. If the service provider does not support setting individual ACLs for files (i.e., all files inherit the ACL of the storage bucket), enabling this option may cause request errors. Set `S3_SET_ACL` to `0` to disable it. + Whether to set the ACL to `public-read` when uploading files. This option is enabled by default. If the service provider does not support setting individual ACLs for files (i.e., all files inherit the ACL of the storage bucket), enabling this option may cause request errors. Set `S3_SET_ACL` to `0` to disable it. -### `S3_PUBLIC_DOMAIN` + ### `S3_PUBLIC_DOMAIN` -The public access domain of the storage bucket, used to access files in the storage bucket. This address needs to be **publicly readable**. The reason is that when OpenAI's gpt-4o and other vision models recognize images, OpenAI will try to download this image link on their servers. Therefore, this link must be publicly accessible. If it is a private link, OpenAI will not be able to access the image and thus will not be able to recognize the image content properly. + The public access domain of the storage bucket, used to access files in the storage bucket. This address needs to be **publicly readable**. The reason is that when OpenAI's gpt-4o and other vision models recognize images, OpenAI will try to download this image link on their servers. Therefore, this link must be publicly accessible. If it is a private link, OpenAI will not be able to access the image and thus will not be able to recognize the image content properly. - - Additionally, since this access domain is often a separate URL, it needs to be configured to allow - cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser. - + + Additionally, since this access domain is often a separate URL, it needs to be configured to allow + cross-origin access to the site. Otherwise, cross-origin issues will occur in the browser. + -### `S3_ENABLE_PATH_STYLE` + ### `S3_ENABLE_PATH_STYLE` -Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it. + Whether to enable the `path-style` access mode of S3. This option is disabled by default. If your S3 service provider uses `path-style`, set `S3_ENABLE_PATH_STYLE` to `1` to enable it. + `path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions. -`path-style` and `virtual-host` are different ways to access buckets and objects in S3, with different URL structures and domain name resolutions. - -Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows: + Assuming the domain name of the S3 service provider is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are as follows: -- path-style: `s3.example.net/mybucket/config.env` -- virtual-host: `mybucket.s3.example.net/config.env` - - + - path-style: `s3.example.net/mybucket/config.env` + - virtual-host: `mybucket.s3.example.net/config.env` + - -Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`. - - - + Common S3 cloud service providers often default to the `virtual-host` mode, while self-deployed services like Minio default to using `path-style`. Therefore, if you use Minio as the S3 service, you need to set `S3_ENABLE_PATH_STYLE=1`. + ## S3 Configuration Guide @@ -88,6 +83,7 @@ Currently, the S3 configuration tutorials included in the documentation are: + diff --git a/docs/self-hosting/advanced/s3.zh-CN.mdx b/docs/self-hosting/advanced/s3.zh-CN.mdx index c8a10265d61e0..e3f3de3adeb43 100644 --- a/docs/self-hosting/advanced/s3.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3.zh-CN.mdx @@ -12,7 +12,7 @@ tags: LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) 就支持了多模态的 AI 会话,其中涉及到图片上传给大模型的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 IndexedDB 数据库,但在服务端数据库中这个方案并不可行。因为在 Postgres 中直接存储文件类二进制数据会大大浪费宝贵的数据库存储空间,并拖慢计算性能。 -这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传/知识库功能所依赖的大容量静态文件存储方案。 +这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传 / 知识库功能所依赖的大容量静态文件存储方案。 在本文档库中,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 @@ -24,58 +24,52 @@ LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) ### `S3_ACCESS_KEY_ID` 与 `S3_SECRET_ACCESS_KEY` -所有 S3 兼容存储服务都需要的两个密钥,用于访问 S3 存储服务,不详细展开。 + 所有 S3 兼容存储服务都需要的两个密钥,用于访问 S3 存储服务,不详细展开。 -### `S3_ENDPOINT` + ### `S3_ENDPOINT` -存储桶的请求端点, 注意此处链接不应该包含存储桶的名称。 + 存储桶的请求端点, 注意此处链接不应该包含存储桶的名称。 -`S3_ENDPOINT`必须删除后缀路径,否则会无法访问所上传文件 + `S3_ENDPOINT`必须删除后缀路径,否则会无法访问所上传文件 -例如 Cloudflare 为: + 例如 Cloudflare 为: -```shell -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -``` + ```shell + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + ``` -### `S3_BUCKET` 和 `S3_REGION` + ### `S3_BUCKET` 和 `S3_REGION` -存储桶的名称和区域,`S3_BUCKET` 是必须的,用于指定存储桶的名称。 `S3_REGION` 是可选的,用于指定存储桶的区域,一般来说不需要添加,但某些服务商则需要配置。 + 存储桶的名称和区域,`S3_BUCKET` 是必须的,用于指定存储桶的名称。 `S3_REGION` 是可选的,用于指定存储桶的区域,一般来说不需要添加,但某些服务商则需要配置。 -### `S3_SET_ACL` + ### `S3_SET_ACL` -是否在上传文件时设置 ACL 为 `public-read`。该选项默认启用。如果服务商不支持为文件设置单独的 ACL(即所有文件继承存储桶的 ACL),启用此选项可能会导致请求错误,将 `S3_SET_ACL` 设置为 `0` 即可关闭。 + 是否在上传文件时设置 ACL 为 `public-read`。该选项默认启用。如果服务商不支持为文件设置单独的 ACL(即所有文件继承存储桶的 ACL),启用此选项可能会导致请求错误,将 `S3_SET_ACL` 设置为 `0` 即可关闭。 -### `S3_PUBLIC_DOMAIN` + ### `S3_PUBLIC_DOMAIN` -存储桶对外的访问域名,用于访问存储桶中的文件,这个地址需要**允许互联网可读**。 原因是 OpenAI 的 gpt-4o 等视觉模型识别图片时,OpenAI 会尝试在他们的服务器中下载这个图片链接,因此这个链接必须是公开可访问的,如果是私有的链接,OpenAI 将无法访问到这个图片,进而无法正常识别到图片内容。 + 存储桶对外的访问域名,用于访问存储桶中的文件,这个地址需要**允许互联网可读**。 原因是 OpenAI 的 gpt-4o 等视觉模型识别图片时,OpenAI 会尝试在他们的服务器中下载这个图片链接,因此这个链接必须是公开可访问的,如果是私有的链接,OpenAI 将无法访问到这个图片,进而无法正常识别到图片内容。 此外,由于该访问域名往往是一个独立的网址,因此需要配置允许站点的跨域访问,否则会在浏览器中出现跨域问题。 + - - -### `S3_ENABLE_PATH_STYLE` - -是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。 + ### `S3_ENABLE_PATH_STYLE` - - -`path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 + 是否启用 S3 的 `path-style` 访问模式。此选项默认禁用。如果您的 S3 服务提供商使用 `path-style`,请将 `S3_ENABLE_PATH_STYLE` 设置为 `1` 以启用它。 -假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下: + + `path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 -- path-style : `s3.example.net/mybucket/config.env` -- virtual-host : `mybucket.s3.example.net/config.env` + 假设 S3 服务商的域名是 s3.example.net ,bucket 为 mybucket,object 为 config.env,具体区别如下: - - - - -常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1` 。 - - + - path-style : `s3.example.net/mybucket/config.env` + - virtual-host : `mybucket.s3.example.net/config.env` + + + 常见的 S3 Cloud 服务商往往默认采用 `virtual-host` 模式,而自部署服务 minio 则默认使用的是 `path-style`。 因此如果你使用了 minio 作为 S3 服务,你需要设置 `S3_ENABLE_PATH_STYLE=1` 。 + ## S3 配置指南 @@ -84,6 +78,7 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + diff --git a/docs/self-hosting/advanced/s3/cloudflare-r2.mdx b/docs/self-hosting/advanced/s3/cloudflare-r2.mdx index 52e219cdeddba..28aaf881b9e17 100644 --- a/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +++ b/docs/self-hosting/advanced/s3/cloudflare-r2.mdx @@ -14,118 +14,89 @@ We need to configure an S3 storage service in the server-side database to store ## Configuration Steps + ### Configure and Obtain S3 Bucket -### Configure and Obtain S3 Bucket + You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following is an example using Cloudflare R2 to guide you through the creation process. -You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following is an example using Cloudflare R2 to guide you through the creation process. + The interface of Cloudflare R2 is shown below: -The interface of Cloudflare R2 is shown below: + {'Cloudflare -{'Cloudflare + When creating the bucket, specify its name and then click create. -When creating the bucket, specify its name and then click create. + {'Create -{'Create + ### Obtain Environment Variables for the Bucket -### Obtain Environment Variables for the Bucket + In the settings of the R2 storage bucket, you can view the bucket configuration information: -In the settings of the R2 storage bucket, you can view the bucket configuration information: + {'View -{'View + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + # Bucket name + S3_BUCKET=lobechat + # Request endpoint of the bucket (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the page for applying S3 API token) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Access domain of the bucket + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# Bucket name -S3_BUCKET=lobechat -# Request endpoint of the bucket (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the page for applying S3 API token) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Access domain of the bucket -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + + `S3_ENDPOINT` must have its path removed, otherwise uploaded files cannot be accessed. + - - `S3_ENDPOINT` must have its path removed, otherwise uploaded files cannot be accessed. - + ### Obtain S3 Key Environment Variables -### Obtain S3 Key Environment Variables + You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details: -You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details: + {'View -{'View + Click the button in the upper right corner to create an API token and enter the create API Token page. -Click the button in the upper right corner to create an API token and enter the create API Token page. + {'Create -{'Create + Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create. -Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create. + {'Configure -{'Configure + After creation, you can see the corresponding S3 API token. -After creation, you can see the corresponding S3 API token. + {'Copy -{'Copy + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### Configure Cross-Origin Resource Sharing (CORS) -### Configure Cross-Origin Resource Sharing (CORS) + Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. -Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. + In R2, you can find the CORS configuration in the settings of the storage bucket: -In R2, you can find the CORS configuration in the settings of the storage bucket: + {'Cross-Origin -{'Cross-Origin + Add a CORS rule to allow requests from your domain (in the previous section, it is `https://your-project.vercel.app`): -Add a CORS rule to allow requests from your domain (in the previous section, it is `https://your-project.vercel.app`): + {'Configure -{'Configure - -Example configuration is as follows: - -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + Example configuration is as follows: -After configuration, click save. + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + After configuration, click save. ## Overview of Environment Variables diff --git a/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx b/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx index 83819e7de5b38..a0de1f88abd2c 100644 --- a/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx @@ -15,121 +15,92 @@ tags: ## 配置步骤 + ### 配置并获取 S3 存储桶 -### 配置并获取 S3 存储桶 + 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 -你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 + 下图是 Cloudflare R2 的界面: -下图是 Cloudflare R2 的界面: + {'Cloudflare -{'Cloudflare + 创建存储桶时将指定其名称,然后点击创建。 -创建存储桶时将指定其名称,然后点击创建。 + {'R2 -{'R2 + ### 获取存储桶相关环境变量 -### 获取存储桶相关环境变量 + 在 R2 存储桶的设置中,可以看到桶配置的信息: -在 R2 存储桶的设置中,可以看到桶配置的信息: + {'查看存储桶的相关信息'} -{'查看存储桶的相关信息'} + 其对应的环境变量为: -其对应的环境变量为: + ```shell + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + `S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 -`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 + ### 获取 S3 密钥环境变量 -### 获取 S3 密钥环境变量 + 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: -你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: + {'查看存储桶的访问秘钥'} -{'查看存储桶的访问秘钥'} + 点击右上角按钮创建 API token,进入创建 API Token 页面 -点击右上角按钮创建 API token,进入创建 API Token 页面 + {'创建对应 -{'创建对应 + 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 -鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 + {'配置 -{'配置 + 创建完成后,就可以看到对应的 S3 API token -创建完成后,就可以看到对应的 S3 API token + {'复制 -{'复制 + 其对应的环境变量为: -其对应的环境变量为: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### 配置跨域 -### 配置跨域 + 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 -由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 + 在 R2 中,你可以在存储桶的设置中找到跨域配置: -在 R2 中,你可以在存储桶的设置中找到跨域配置: + {'Cloudflare -{'Cloudflare + 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: -添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: + {'配置允许你的站点域名'} -{'配置允许你的站点域名'} - -示例配置如下: - -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + 示例配置如下: -配置后点击保存即可。 + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + 配置后点击保存即可。 ## 环境变量一览 -URL的`https://`不可缺失,须保持URL的完整性 +URL 的`https://`不可缺失,须保持 URL 的完整性 ```shell # S3 秘钥 diff --git a/docs/self-hosting/advanced/s3/tencent-cloud.mdx b/docs/self-hosting/advanced/s3/tencent-cloud.mdx index 21ae7b1a16e0b..eed8a276d4421 100644 --- a/docs/self-hosting/advanced/s3/tencent-cloud.mdx +++ b/docs/self-hosting/advanced/s3/tencent-cloud.mdx @@ -19,58 +19,44 @@ We need to configure S3 storage service for file storage in the server-side data ### Configure and Obtain S3 Bucket -Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket): + Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket): -{'Tencent + {'Tencent -Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default. + Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default. -{'COS + {'COS -### Get Bucket-related Environment Variables + ### Get Bucket-related Environment Variables -View bucket information in COS bucket overview: + View bucket information in COS bucket overview: -{'View + {'View -Corresponding environment variables: + Corresponding environment variables: -```shell -S3_BUCKET=lobe-130xxxxxx2 -S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com -S3_REGION=ap-chengdu -S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com -``` + ```shell + S3_BUCKET=lobe-130xxxxxx2 + S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com + S3_REGION=ap-chengdu + S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com + ``` Note: `S3_ENDPOINT` should be `https://cos.ap-chengdu.myqcloud.com`, not `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` Include `https://` in the URL + - + ### Configure CORS -### Configure CORS + Add the following in 'Security Management - CORS Settings': -Add the following in 'Security Management - CORS Settings': + {'Configure -{'Configure - -### Get S3 Keys - -Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. + ### Get S3 Keys + Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. ### Additional Notes diff --git a/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx b/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx index 5292bb00c89d9..ed7a3ae0ce63f 100644 --- a/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +++ b/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx @@ -15,65 +15,50 @@ tags: ## 配置步骤 + ### 配置并获取 S3 存储桶 -### 配置并获取 S3 存储桶 + 你需要首先前往 [腾讯云 COS](https://console.cloud.tencent.com/cos/bucket) 并创建一个新的存储桶(Bucket): -你需要首先前往 [腾讯云 COS](https://console.cloud.tencent.com/cos/bucket) 并创建一个新的存储桶(Bucket): + {'腾讯云 -{'腾讯云 + 创建存储桶时将指定其名称,下文以 `lobe` 为例。选择 `公有读私有写`,地域随意,其余配置一概默认即可,然后点击创建。 -创建存储桶时将指定其名称,下文以 `lobe` 为例。选择 `公有读私有写`,地域随意,其余配置一概默认即可,然后点击创建。 + {'COS -{'COS + ### 获取存储桶相关环境变量 -### 获取存储桶相关环境变量 + 在 COS 存储桶的概览设置中,可以看到桶配置的信息: -在 COS 存储桶的概览设置中,可以看到桶配置的信息: + {'查看存储桶的相关信息'} -{'查看存储桶的相关信息'} + 其对应的环境变量为: -其对应的环境变量为: + ```shell + # 存储桶的名称 + S3_BUCKET=lobe-130xxxxxx2 + # 存储桶的请求端点,注意没有前面的桶名 + S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com + # 桶的区域 + S3_REGION=ap-chengdu + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com + ``` -```shell -# 存储桶的名称 -S3_BUCKET=lobe-130xxxxxx2 -# 存储桶的请求端点,注意没有前面的桶名 -S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com -# 桶的区域 -S3_REGION=ap-chengdu -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com -``` + + 请注意,`S3_ENDPOINT` 的值为 `https://cos.ap-chengdu.myqcloud.com`,而不是 `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` - -请注意,`S3_ENDPOINT` 的值为 `https://cos.ap-chengdu.myqcloud.com`,而不是 `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` + 且此处 URL 的 `https://` 不可缺失,须保持 URL 的完整性 + -且此处 URL 的 `https://` 不可缺失,须保持 URL 的完整性 + ### 配置跨域 - + 在左侧 `安全管理 - 跨域访问 CORS 设置` 中,添加以下配置并保存: -### 配置跨域 + {'配置跨域'} -在左侧 `安全管理 - 跨域访问 CORS 设置` 中,添加以下配置并保存: - -{'配置跨域'} - -### 获取 S3 秘钥 - -前往 [腾讯云 API 密钥管理](https://console.cloud.tencent.com/cam/capi) 创建一个新的 SecretId 和 SecretKey,填写为 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 即可。 + ### 获取 S3 秘钥 + 前往 [腾讯云 API 密钥管理](https://console.cloud.tencent.com/cam/capi) 创建一个新的 SecretId 和 SecretKey,填写为 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 即可。 ### 附加说明 diff --git a/docs/self-hosting/advanced/settings-url-share.mdx b/docs/self-hosting/advanced/settings-url-share.mdx index c12a09ac26d87..80e121be3d6a0 100644 --- a/docs/self-hosting/advanced/settings-url-share.mdx +++ b/docs/self-hosting/advanced/settings-url-share.mdx @@ -139,9 +139,9 @@ export type UserModelProviderConfig = Record; - Type `ProviderConfig` -| Property name | Type | Description | -| ------------------- | -------- | ------------------------------------------- | ------------------------------ | -| autoFetchModelLists | boolean | Whether to automatically fetch model lists. | -| enabled | boolean | Whether the model provider is enabled. | -| enabledModels | string[] | null | The IDs of the enabled models. | -| fetchOnClient | boolean | Whether to fetch on the client. | +| Property name | Type | Description | | +| ------------------- | --------- | ------------------------------------------- | ------------------------------ | +| autoFetchModelLists | boolean | Whether to automatically fetch model lists. | | +| enabled | boolean | Whether the model provider is enabled. | | +| enabledModels | string\[] | null | The IDs of the enabled models. | +| fetchOnClient | boolean | Whether to fetch on the client. | | diff --git a/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx b/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx index 14f47b5fc715e..e372e7117fd51 100644 --- a/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +++ b/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx @@ -30,7 +30,7 @@ https://lobehub.com/?settings= https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}} ``` -JSON格式的设置示例: +JSON 格式的设置示例: ```json { @@ -70,7 +70,7 @@ console.log(url); - 参数及其类型 -| 参数名称 | 类型 | +| 参数名称 | 类型 | | ---------- | -------------------------- | | anthropic | `OpenAICompatibleKeyVault` | | azure | `AzureOpenAIKeyVault` | @@ -90,25 +90,25 @@ console.log(url); - Type `OpenAICompatibleKeyVault` -| 参数 | 类型 | 描述 | -| ------- | ------ | ----------------- | +| 参数 | 类型 | 描述 | +| ------- | ------ | ----------- | | apiKey | string | 模型的 API 密钥。 | -| baseURL | string | 模型API端点。 | +| baseURL | string | 模型 API 端点。 | - Type `AzureOpenAIKeyVault` -| 参数 | 类型 | 描述 | -| ---------- | ------ | -------------------------- | +| 参数 | 类型 | 描述 | +| ---------- | ------ | ---------------------- | | apiVersion | string | Azure OpenAI 的 API 版本。 | -| apiKey | string | 模型的 API 密钥。 | -| baseURL | string | 模型API端点。 | +| apiKey | string | 模型的 API 密钥。 | +| baseURL | string | 模型 API 端点。 | - Type `AWSBedrockKeyVault` -| 参数 | 类型 | 描述 | -| --------------- | ------ | --------------------------- | +| 参数 | 类型 | 描述 | +| --------------- | ------ | --------------------- | | accessKeyId | string | AWS Bedrock 的访问密钥 ID。 | -| region | string | AWS Bedrock 的区域。 | +| region | string | AWS Bedrock 的区域。 | | secretAccessKey | string | AWS Bedrock 的访问密钥。 | ### languageModel @@ -117,7 +117,7 @@ console.log(url); export type UserModelProviderConfig = Record; ``` -| 参数名称 | 类型 | +| 参数名称 | 类型 | | ---------- | ---------------- | | anthropic | `ProviderConfig` | | azure | `ProviderConfig` | @@ -137,9 +137,9 @@ export type UserModelProviderConfig = Record; - 类型 `ProviderConfig` -| 参数 | TS 类型 | 描述 | -| ------------------- | -------- | -------------------------------------------- | -| autoFetchModelLists | boolean | 是否自动获取模型列表。 | -| enabled | boolean | 是否启用该模型。 | -| enabledModels | string[] | 启用的模型的 ID。 | -| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 | +| 参数 | TS 类型 | 描述 | +| ------------------- | --------- | ---------------------- | +| autoFetchModelLists | boolean | 是否自动获取模型列表。 | +| enabled | boolean | 是否启用该模型。 | +| enabledModels | string\[] | 启用的模型的 ID。 | +| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 | diff --git a/docs/self-hosting/advanced/upstream-sync.mdx b/docs/self-hosting/advanced/upstream-sync.mdx index 4fb124dc70ae1..92877b723730e 100644 --- a/docs/self-hosting/advanced/upstream-sync.mdx +++ b/docs/self-hosting/advanced/upstream-sync.mdx @@ -30,27 +30,15 @@ If you deployed your project according to the one-click deployment steps in the After forking the project, due to Github's limitations, you need to manually enable Workflows on the Actions page of your forked project and start the Upstream Sync Action. Once enabled, you can set up automatic updates to occur every hour. -Enable Automatic Updates S1 +Enable Automatic Updates S1 -Enable Automatic Updates S2 +Enable Automatic Updates S2 If you encounter a sync failure, you need to manually click "Update Branch" once. -GitHub Action Sync Failure +GitHub Action Sync Failure -Manually Sync 'Update Branch' +Manually Sync 'Update Branch' ## `B` Docker Deployment @@ -59,34 +47,33 @@ Upgrading the Docker deployment version is very simple, you just need to redeplo ### Stop and Remove the Current Running LobeChat Container -Assuming the LobeChat container is named `lobe-chat`, use the following commands to stop and remove the currently running LobeChat container: + Assuming the LobeChat container is named `lobe-chat`, use the following commands to stop and remove the currently running LobeChat container: -```fish -docker stop lobe-chat -docker rm lobe-chat -``` + ```fish + docker stop lobe-chat + docker rm lobe-chat + ``` -### Pull the Latest LobeChat Image + ### Pull the Latest LobeChat Image -Use the following command to pull the latest Docker image for LobeChat: + Use the following command to pull the latest Docker image for LobeChat: -```fish -docker pull lobehub/lobe-chat -``` + ```fish + docker pull lobehub/lobe-chat + ``` -### Restart the Docker Container + ### Restart the Docker Container -Redeploy the LobeChat container using the newly pulled image: - -```fish -docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + Redeploy the LobeChat container using the newly pulled image: + ```fish + docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` Ensure that you have sufficient permissions to stop and remove the container before executing these commands, and that Docker has sufficient permissions to pull the new image. @@ -94,80 +81,77 @@ Ensure that you have sufficient permissions to stop and remove the container bef **If I redeploy, will I lose my local chat records?** -No need to worry, you won't. All of LobeChat's chat records are stored in your local browser. Therefore, when redeploying LobeChat using Docker, your chat records will not be lost. - + No need to worry, you won't. All of LobeChat's chat records are stored in your local browser. Therefore, when redeploying LobeChat using Docker, your chat records will not be lost. If you wish to automate the above steps, you can follow the method below and use Crontab scheduling to complete it. The specific steps are as follows. + ### Write automatic update scripts and configuration files -### Write automatic update scripts and configuration files - -First, create a `lobe.env` configuration file with various environment variables, for example: + First, create a `lobe.env` configuration file with various environment variables, for example: -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -Then, you can use the following script to automate the update: + Then, you can use the following script to automate the update: -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Set up proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + # Set up proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -echo "Detected lobe-chat update" + echo "Detected lobe-chat update" -# Remove the old container -echo "Removed: $(docker rm -f lobe-chat)" + # Remove the old container + echo "Removed: $(docker rm -f lobe-chat)" -# Run the new container(Please change the path to the env file) -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" + # Run the new container(Please change the path to the env file) + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` - - - This script can be used in Crontab, but please ensure that your Crontab can find the correct - Docker command. It is recommended to use absolute paths. - + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + + This script can be used in Crontab, but please ensure that your Crontab can find the correct + Docker command. It is recommended to use absolute paths. + -### Configure Crontab to automatically execute scripts + Configure Crontab to execute the script every 5 minutes: -The following command configures Crontab to execute scripts every 5 minutes, or as often as you like: + ### Configure Crontab to automatically execute scripts -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + The following command configures Crontab to execute scripts every 5 minutes, or as often as you like: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx index 41396dd63331e..60340f8e6bcf0 100644 --- a/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +++ b/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx @@ -25,27 +25,15 @@ tags: 当你 Fork 了项目后,由于 Github 的限制,你需要手动在你 Fork 的项目的 Actions 页面启用 Workflows,并启动 Upstream Sync Action。启用后,你可以设置每小时进行一次自动更新。 -启动自动更新 S1 +启动自动更新 S1 -启动自动更新 S2 +启动自动更新 S2 如果你遇到了同步失败的情况,你需要手动重新点一次 「Update Branch」。 -GitHub Action 同步失败 +GitHub Action 同步失败 -手动同步 「Update Branch」 +手动同步 「Update Branch」 ## `B` Docker 部署 @@ -54,34 +42,33 @@ Docker 部署版本的升级非常简单,只需要重新部署 LobeChat 的最 ### 停止并删除当前运行的 LobeChat 容器 -假设 LobeChat 容器的名称是 `lobe-chat`,使用以下指令停止并删除当前运行的 LobeChat 容器: + 假设 LobeChat 容器的名称是 `lobe-chat`,使用以下指令停止并删除当前运行的 LobeChat 容器: -```fish -docker stop lobe-chat -docker rm lobe-chat -``` + ```fish + docker stop lobe-chat + docker rm lobe-chat + ``` -### 拉取最新的 LobeChat 镜像 + ### 拉取最新的 LobeChat 镜像 -使用以下命令拉取 LobeChat 的最新 Docker 镜像: + 使用以下命令拉取 LobeChat 的最新 Docker 镜像: -```fish -docker pull lobehub/lobe-chat -``` + ```fish + docker pull lobehub/lobe-chat + ``` -### 重新启动 Docker 容器 + ### 重新启动 Docker 容器 -使用新拉取的镜像重新部署 LobeChat 容器: - -```fish -docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 使用新拉取的镜像重新部署 LobeChat 容器: + ```fish + docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` 确保在执行这些命令之前,您有足够的权限来停止和删除容器,并且 Docker 有足够的权限来拉取新的镜像。 @@ -89,77 +76,74 @@ docker run -d -p 3210:3210 \ **重新部署的话,我本地的聊天记录会丢失吗?** -放心,不会的。LobeChat 的聊天记录全部都存储在你的本地浏览器中。因此使用 Docker 重新部署 LobeChat 时,你的聊天记录并不会丢失。 - + 放心,不会的。LobeChat 的聊天记录全部都存储在你的本地浏览器中。因此使用 Docker 重新部署 LobeChat 时,你的聊天记录并不会丢失。 如果你希望自动化执行以上步骤,你可以参照下面的方法,利用 Crontab 定时来完成。具体步骤如下。 + ### 撰写自动更新脚本、配置文件 -### 撰写自动更新脚本、配置文件 - -首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: + 首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -然后,你可以使用以下脚本来自动更新: + 然后,你可以使用以下脚本来自动更新: -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# 设置代理(可选) -# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + # 设置代理(可选) + # export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# 拉取最新的镜像并将输出存储在变量中 -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # 拉取最新的镜像并将输出存储在变量中 + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# 检查拉取命令是否成功执行 -if [ $? -ne 0 ]; then - exit 1 -fi + # 检查拉取命令是否成功执行 + if [ $? -ne 0 ]; then + exit 1 + fi -# 检查输出中是否包含特定的字符串 -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # 检查输出中是否包含特定的字符串 + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -# 如果镜像已经是最新的,则不执行任何操作 -if [ $? -eq 0 ]; then - exit 0 -fi + # 如果镜像已经是最新的,则不执行任何操作 + if [ $? -eq 0 ]; then + exit 0 + fi -echo "Detected lobe-chat update" + echo "Detected lobe-chat update" -# 删除旧的容器 -echo "Removed: $(docker rm -f lobe-chat)" + # 删除旧的容器 + echo "Removed: $(docker rm -f lobe-chat)" -# 运行新的容器(请将env配置文件地址改为你的实际地址) -echo "Started: $(docker run -d --network=host --env-file path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" + # 运行新的容器(请将env配置文件地址改为你的实际地址) + echo "Started: $(docker run -d --network=host --env-file path/to/lobe.env --name=lobe-chat --restart=always lobehub/lobe-chat)" -# 打印更新的时间和版本 -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # 打印更新的时间和版本 + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -# 清理不再使用的镜像 -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` - - - 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 - + # 清理不再使用的镜像 + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -### 配置 Crontab 自动执行脚本 + + 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 + -以下命令可以配置 Crontab 每 5 分钟执行一次脚本,你也可以根据需要调整执行频率: + ### 配置 Crontab 自动执行脚本 -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + 以下命令可以配置 Crontab 每 5 分钟执行一次脚本,你也可以根据需要调整执行频率: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/advanced/webrtc.mdx b/docs/self-hosting/advanced/webrtc.mdx index 25903615c3bbb..ddd2c71625ddf 100644 --- a/docs/self-hosting/advanced/webrtc.mdx +++ b/docs/self-hosting/advanced/webrtc.mdx @@ -22,38 +22,31 @@ WebRTC (Web Real-Time Communication) is a technology that enables peer-to-peer c To use the WebRTC synchronization feature in LobeChat, you need to complete the following steps: + ### Deploy Signaling Server -### Deploy Signaling Server + Deploy a WebRTC signaling server with one click using the Zeabur platform: -Deploy a WebRTC signaling server with one click using the Zeabur platform: + [![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) -[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) + Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own. -Alternatively, you can view the [source code](https://github.com/lobehub/y-webrtc-signaling) and deploy it on your own. + After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`. -After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`. + ### Enable WebRTC Sync in the Deployment Instance -### Enable WebRTC Sync in the Deployment Instance + The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`. -The WebRTC sync feature in LobeChat is hidden by default and needs to be enabled by adding the environment variable `FEATURE_FLAGS=+webrtc_sync`. + ### Configure WebRTC Sync Settings in LobeChat -### Configure WebRTC Sync Settings in LobeChat + 1. Open LobeChat settings -> Data Sync + 2. Enter the signaling server address in the WebRTC sync section; + 3. Set the sync channel name and password -1. Open LobeChat settings -> Data Sync -2. Enter the signaling server address in the WebRTC sync section; -3. Set the sync channel name and password + {'LobeChat -{'LobeChat - -### Repeat the Above Configuration on Devices that Need to Sync - -Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data. + ### Repeat the Above Configuration on Devices that Need to Sync + Ensure all devices use the same signaling server, channel name, and password. Once configured, the devices should automatically start syncing data. ## Limitations and Known Issues diff --git a/docs/self-hosting/advanced/webrtc.zh-CN.mdx b/docs/self-hosting/advanced/webrtc.zh-CN.mdx index a9fd2c3d8e205..3ddc3c4b8c8a5 100644 --- a/docs/self-hosting/advanced/webrtc.zh-CN.mdx +++ b/docs/self-hosting/advanced/webrtc.zh-CN.mdx @@ -10,45 +10,38 @@ tags: ## WebRTC 简介 -WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。 +WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。 ## 配置 WebRTC 并实现同步 -要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤: +要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤: + ### 部署信令服务器 -### 部署信令服务器 + 使用 Zeabur 平台一键部署 WebRTC 信令服务器: -使用 Zeabur 平台一键部署 WebRTC 信令服务器: + [![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) -[![Deploy on Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx) + 或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。 -或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。 + 部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。 -部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。 + ### 在部署实例中开启 WebRTC 同步 -### 在部署实例中开启 WebRTC 同步 + LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。 -LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。 + ### 配置 LobeChat 的 WebRTC 同步设置 -### 配置 LobeChat 的 WebRTC 同步设置 + 1. 打开 LobeChat 设置 -> 数据同步 + 2. 在 WebRTC 同步中填写信令服务器地址; + 3. 设置同步频道名称和密码 -1. 打开 LobeChat 设置 -> 数据同步 -2. 在 WebRTC 同步中填写信令服务器地址; -3. 设置同步频道名称和密码 + {'LobeChat -{'LobeChat - -### 在需要同步的设备上重复以上配置 - -确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。 + ### 在需要同步的设备上重复以上配置 + 确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。 ## 使用局限性和已知问题 @@ -67,17 +60,17 @@ WebRTC 要求设备同时在线才能进行同步,这意味着无法在一台 由于 WebRTC 的实现机制,其点对点通信对于网络要求非常苛刻,我们的很多用户反馈: -- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和PC一样的WIFI可以和 PC 同步; +- 在 PC 上可以互相同步、 手机 sim 卡无法和 PC 同步、但是换成和 PC 一样的 WIFI 可以和 PC 同步; - 任何切换网络都无法同步; ### 稳定性与性能问题 - 部分用户报告在 Firefox 浏览器上遇到 ICE 连接失败的问题:[WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907) -- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962) +- 对于超长文本或大量对话记录,同步过程可能变慢或不稳定:[当模型输出超长对话时,对话末尾会出现同步相关的内容标签,导致同步失败](https://github.com/lobehub/lobe-chat/issues/1962) ## 我们的建议 -鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。 +鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。 目前我们已经发布了更稳定、更用户友好的服务端数据库同步方案([部署指南](/zh/docs/self-hosting/advanced/server-database)),我们建议用户优先考虑使用服务端数据库同步方案。 diff --git a/docs/self-hosting/environment-variables.mdx b/docs/self-hosting/environment-variables.mdx index d5fe17f20197a..51d5fc50b1827 100644 --- a/docs/self-hosting/environment-variables.mdx +++ b/docs/self-hosting/environment-variables.mdx @@ -16,15 +16,19 @@ LobeChat provides some additional configuration options when deployed, which can + + + + -## Building a Custom Image with Overridden NEXT_PUBLIC Variables +## Building a Custom Image with Overridden `NEXT_PUBLIC` Variables -If you need to override NEXT_PUBLIC environment variables, you can build a custom Docker image using GitHub Actions without forking the entire LobeChat repository. Here's a guide on how to do this: +If you need to override `NEXT_PUBLIC` environment variables, you can build a custom Docker image using GitHub Actions without forking the entire LobeChat repository. Here's a guide on how to do this: 1. Create a new GitHub repository for your custom build. @@ -82,10 +86,10 @@ jobs: NEXT_PUBLIC_SERVICE_MODE=${{ secrets.NEXT_PUBLIC_SERVICE_MODE }} ``` -4. In your GitHub Repository settings > Secrets and variables > Actions > Repository secrets, add any NEXT_PUBLIC variables you want to override +4. In your GitHub Repository settings > Secrets and variables > Actions > Repository secrets, add any `NEXT_PUBLIC` variables you want to override 5. Set "Read and write" permissions for workflows in Repository settings > Actions > General > Workflow permissions. 6. To build your custom image, go to the "Actions" tab in your GitHub repository and manually trigger the "Build Custom LobeChat Image" workflow. -This approach allows you to create a custom build with your desired NEXT_PUBLIC variables without maintaining a full fork of the LobeChat repository. You can trigger a new build whenever you need to update your custom image. +This approach allows you to create a custom build with your desired `NEXT_PUBLIC` variables without maintaining a full fork of the LobeChat repository. You can trigger a new build whenever you need to update your custom image. diff --git a/docs/self-hosting/environment-variables.zh-CN.mdx b/docs/self-hosting/environment-variables.zh-CN.mdx index b492e15f20176..a6f76ec61243d 100644 --- a/docs/self-hosting/environment-variables.zh-CN.mdx +++ b/docs/self-hosting/environment-variables.zh-CN.mdx @@ -14,8 +14,12 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 + + + + diff --git a/docs/self-hosting/environment-variables/analytics.zh-CN.mdx b/docs/self-hosting/environment-variables/analytics.zh-CN.mdx index df02c2d86b1b4..98067382994d2 100644 --- a/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/analytics.zh-CN.mdx @@ -77,6 +77,3 @@ tags: - 描述:Umami 脚本的网址,默认为 Umami Cloud 提供的脚本网址 - 默认值:`https://analytics.umami.is/script.js` - 示例:`https://umami.your-site.com/script.js` - -[posthog-analytics-url]: https://posthog.com -[umami-analytics-url]: https://umami.is diff --git a/docs/self-hosting/environment-variables/auth.mdx b/docs/self-hosting/environment-variables/auth.mdx index deed6dc2d8c77..52d0dd0fa8aeb 100644 --- a/docs/self-hosting/environment-variables/auth.mdx +++ b/docs/self-hosting/environment-variables/auth.mdx @@ -19,6 +19,16 @@ LobeChat provides a complete authentication service capability when deployed. Th ### General Settings +#### `NEXT_PUBLIC_ENABLE_NEXT_AUTH` + +- Changes after v1.52.0. + +- For users who deploy with Vercel using Next Auth, it is necessary to add the environment variable NEXT\_PUBLIC\_ENABLE\_NEXT\_AUTH=1 to ensure that Next Auth is enabled. + +- For users who use Clerk in their self-built image, it is necessary to configure the environment variable NEXT\_PUBLIC\_ENABLE\_NEXT\_AUTH=0 to disable Next Auth.\n + +- Other standard deployment scenarios (using Clerk on Vercel and next-auth in Docker) are not affected + #### `NEXT_AUTH_SECRET` - Type: Required diff --git a/docs/self-hosting/environment-variables/auth.zh-CN.mdx b/docs/self-hosting/environment-variables/auth.zh-CN.mdx index a92e16a7d3d6a..a78303f886593 100644 --- a/docs/self-hosting/environment-variables/auth.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/auth.zh-CN.mdx @@ -17,6 +17,13 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相 ### 通用设置 +#### `NEXT_PUBLIC_ENABLE_NEXT_AUTH` + +- v1.52.0 之后有变更 +- 针对使用 Vercel 部署中使用 next-auth 的用户,需要额外添加 NEXT\_PUBLIC\_ENABLE\_NEXT\_AUTH=1 环境变量来确保开启 Next Auth +- 针对使用自构建镜像中使用 clerk 的用户,需要额外配置 NEXT\_PUBLIC\_ENABLE\_NEXT\_AUTH=0 环境变量来关闭 Next Auth +- 其他标准部署场景(Vercel 中使用 Clerk 与 Docker 中使用 next-auth )不受影响 + #### `NEXT_AUTH_SECRET` - 类型:必选 @@ -47,7 +54,7 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相 - 默认值: `-` - 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P` -#### \`AUTH_AUTH_SECRET +#### `AUTH_AUTH0_SECRET` - 类型:必选 - 描述: Auth0 应用程序的 Client Secret diff --git a/docs/self-hosting/environment-variables/basic.mdx b/docs/self-hosting/environment-variables/basic.mdx index bfdccfa5e103c..5bd0882df22c1 100644 --- a/docs/self-hosting/environment-variables/basic.mdx +++ b/docs/self-hosting/environment-variables/basic.mdx @@ -54,22 +54,22 @@ When using the `turn` mode, the API Keys will be retrieved in a polling manner a The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the LobeChat default agent. It supports various data types and structures, including key-value pairs, nested fields, array values, and more. The table below provides detailed information on the configuration options, examples, and corresponding explanations for the `DEFAULT_AGENT_CONFIG` environment variable: -| Configuration Type | Example | Explanation | -| --- | --- | --- | -| Basic Key-Value Pair | `model=gpt-4` | Set the model to `gpt-4`. | -| Nested Field | `tts.sttLocale=en-US` | Set the language locale for the text-to-speech service to `en-US`. | -| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. | -| Chinese Comma | `plugins=search-engine,lobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. | -| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. | -| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. | -| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. | -| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. | -| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. | -| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. | +| Configuration Type | Example | Explanation | +| ----------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| Basic Key-Value Pair | `model=gpt-4` | Set the model to `gpt-4`. | +| Nested Field | `tts.sttLocale=en-US` | Set the language locale for the text-to-speech service to `en-US`. | +| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. | +| Chinese Comma | `plugins=search-engine,lobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. | +| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. | +| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. | +| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. | +| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. | +| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. | +| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. | Further reading: -- [[RFC] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913) +- [\[RFC\] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913) ### `FEATURE_FLAGS` diff --git a/docs/self-hosting/environment-variables/basic.zh-CN.mdx b/docs/self-hosting/environment-variables/basic.zh-CN.mdx index 59b5b94ccc2ff..82ad02ef88524 100644 --- a/docs/self-hosting/environment-variables/basic.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/basic.zh-CN.mdx @@ -50,22 +50,22 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 `DEFAULT_AGENT_CONFIG` 用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。下表详细说明了 `DEFAULT_AGENT_CONFIG` 环境变量的配置项、示例以及相应解释: -| 配置项类型 | 示例 | 解释 | -| --- | --- | --- | -| 基本键值对 | `model=gpt-4` | 设置模型为 `gpt-4`。 | -| 嵌套字段 | `tts.sttLocale=en-US` | 设置文本到语音服务的语言区域为 `en-US`。 | -| 数组 | `plugins=search-engine,lobe-image-designer` | 启用 `search-engine` 和 `lobe-image-designer` 插件。 | -| 中文逗号 | `plugins=search-engine,lobe-image-designer` | 同上,演示支持中文逗号分隔。 | -| 多个配置项 | `model=glm-4;provider=zhipu` | 设置模型为 `glm-4` 且模型服务商为 `zhipu`。 | -| 数字值 | `params.max_tokens=300`, `chatConfig.historyCount=5` | 设置最大令牌数为 `300`,设置历史消息条数为5。 | -| 布尔值 | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 | -| 特殊字符 | `inputTemplate="Hello; I am a bot;"` | 设置输入模板为 `Hello; I am a bot;`。 | -| 错误处理 | `model=gpt-4;maxToken` | 忽略无效条目 `maxToken`,仅解析出 `model=gpt-4`。 | -| 值覆盖 | `model=gpt-4;model=gpt-4-1106-preview` | 如果键重复,使用最后一次出现的值,此处 `model` 的值为 `gpt-4-1106-preview`。 | +| 配置项类型 | 示例 | 解释 | +| ----- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| 基本键值对 | `model=gpt-4` | 设置模型为 `gpt-4`。 | +| 嵌套字段 | `tts.sttLocale=en-US` | 设置文本到语音服务的语言区域为 `en-US`。 | +| 数组 | `plugins=search-engine,lobe-image-designer` | 启用 `search-engine` 和 `lobe-image-designer` 插件。 | +| 中文逗号 | `plugins=search-engine,lobe-image-designer` | 同上,演示支持中文逗号分隔。 | +| 多个配置项 | `model=glm-4;provider=zhipu` | 设置模型为 `glm-4` 且模型服务商为 `zhipu`。 | +| 数字值 | `params.max_tokens=300`, `chatConfig.historyCount=5` | 设置最大令牌数为 `300`,设置历史消息条数为 5。 | +| 布尔值 | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 | +| 特殊字符 | `inputTemplate="Hello; I am a bot;"` | 设置输入模板为 `Hello; I am a bot;`。 | +| 错误处理 | `model=gpt-4;maxToken` | 忽略无效条目 `maxToken`,仅解析出 `model=gpt-4`。 | +| 值覆盖 | `model=gpt-4;model=gpt-4-1106-preview` | 如果键重复,使用最后一次出现的值,此处 `model` 的值为 `gpt-4-1106-preview`。 | 相关阅读: -- [[RFC] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913) +- [\[RFC\] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913) ### `FEATURE_FLAGS` @@ -91,14 +91,14 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境 ### `SSRF_ALLOW_PRIVATE_IP_ADDRESS` - 类型:可选 -- 描述:是否允许连接私有IP地址。在可信环境中可以设置为true来关闭SSRF防护。 +- 描述:是否允许连接私有 IP 地址。在可信环境中可以设置为 true 来关闭 SSRF 防护。 - 默认值:`0` - 示例:`1` or `0` ### `SSRF_ALLOW_IP_ADDRESS_LIST` - 类型:可选 -- 描述:允许连接的私有IP地址列表,多个IP地址时使用逗号分隔。当 `SSRF_ALLOW_PRIVATE_IP_ADDRESS` 为 `0` 时才会生效。 +- 描述:允许连接的私有 IP 地址列表,多个 IP 地址时使用逗号分隔。当 `SSRF_ALLOW_PRIVATE_IP_ADDRESS` 为 `0` 时才会生效。 - 默认值:- - 示例:`198.18.1.62,224.0.0.3` diff --git a/docs/self-hosting/environment-variables/model-provider.mdx b/docs/self-hosting/environment-variables/model-provider.mdx index 71ff9d7be87f1..e8921e911ac8a 100644 --- a/docs/self-hosting/environment-variables/model-provider.mdx +++ b/docs/self-hosting/environment-variables/model-provider.mdx @@ -169,6 +169,13 @@ If you need to use Azure OpenAI to provide model services, you can refer to the ## DeepSeek AI +### `DEEPSEEK_PROXY_URL` + +- Type: Optional +- Description: If you manually configure the DeepSeek API proxy, you can use this configuration item to override the default DeepSeek API request base URL +- Default: - +- Example: `https://xxxx.models.ai.azure.com/v1` + ### `DEEPSEEK_API_KEY` - Type: Required @@ -482,7 +489,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the ### `AI21_API_KEY` - Type: Required -- Description: This is the API key you applied from AI21_API_KEY service +- Description: This is the API key you applied from `AI21_API_KEY` service - Default: - - Example: `xxxxxx...xxxxxx` diff --git a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx index 24f9b56df4c9e..cdc5224c9b6f4 100644 --- a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx @@ -167,6 +167,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, ## DeepSeek AI +### `DEEPSEEK_PROXY_URL` + +- 类型:可选 +- 描述:如果您手动配置了 DeepSeek API 代理,可以使用此配置项覆盖默认的 DeepSeek API 请求基础 URL +- 默认值: - +- 示例: `https://xxxx.models.ai.azure.com/v1` + ### `DEEPSEEK_API_KEY` - 类型:必选 @@ -430,7 +437,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量, ### `AI360_API_KEY` - 类型:必选 -- 描述:这是你在 360智脑 服务平台申请的 API 密钥 +- 描述:这是你在 360 智脑 服务平台申请的 API 密钥 - 默认值:- - 示例:`xxxxxx...xxxxxx` diff --git a/docs/self-hosting/environment-variables/s3.mdx b/docs/self-hosting/environment-variables/s3.mdx index a5bce868f269f..6a619a1a19e76 100644 --- a/docs/self-hosting/environment-variables/s3.mdx +++ b/docs/self-hosting/environment-variables/s3.mdx @@ -75,11 +75,10 @@ LobeChat supports multimodal AI sessions, including the ability to upload unstru `path-style` and `virtual-host` are different methods of accessing buckets and objects in S3, with differences in URL structure and domain name resolution. -Assuming the S3 service provider's domain is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are: - -- path-style: `s3.example.net/mybucket/config.env` -- virtual-host: `mybucket.s3.example.net/config.env` + Assuming the S3 service provider's domain is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are: + - path-style: `s3.example.net/mybucket/config.env` + - virtual-host: `mybucket.s3.example.net/config.env` ### `LLM_VISION_IMAGE_USE_BASE64` diff --git a/docs/self-hosting/environment-variables/s3.zh-CN.mdx b/docs/self-hosting/environment-variables/s3.zh-CN.mdx index 711842d48f6eb..99d19f8dbd8fb 100644 --- a/docs/self-hosting/environment-variables/s3.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/s3.zh-CN.mdx @@ -10,7 +10,7 @@ tags: # 配置 S3 存储服务 -LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化数据上传给大模型的功能。为了优化存储和性能,我们使用 S3 兼容的文件存储服务来存储图片文件和支持文件上传/知识库功能。 +LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化数据上传给大模型的功能。为了优化存储和性能,我们使用 S3 兼容的文件存储服务来存储图片文件和支持文件上传 / 知识库功能。 ## 核心环境变量 @@ -71,14 +71,12 @@ LobeChat 支持多模态的 AI 会话,包括将图片、文件等非结构化 - 示例:`1` + `path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 -`path-style` 和 `virtual-host` 在 S3 中是访问 bucket 和 object 的不同方式,URL 的结构和域名解析不太一样 - -假设 S3 服务商的域名是 s3.example.net ,bucket为mybucket,object为config.env,具体区别如下: - -- path-style : `s3.example.net/mybucket/config.env` -- virtual-host : `mybucket.s3.example.net/config.env` + 假设 S3 服务商的域名是 s3.example.net ,bucket 为 mybucket,object 为 config.env,具体区别如下: + - path-style : `s3.example.net/mybucket/config.env` + - virtual-host : `mybucket.s3.example.net/config.env` ### `LLM_VISION_IMAGE_USE_BASE64` diff --git a/docs/self-hosting/examples/azure-openai.mdx b/docs/self-hosting/examples/azure-openai.mdx index 30ce886e271fd..d79867f0a8310 100644 --- a/docs/self-hosting/examples/azure-openai.mdx +++ b/docs/self-hosting/examples/azure-openai.mdx @@ -19,17 +19,14 @@ LobeChat supports using [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/a Click in the bottom left corner "Actions" - "Settings", then switch to the "Language Model" tab and enable the "Azure OpenAI" switch to start using Azure OpenAI. -Configuring in the Interface +Configuring in the Interface You can fill in the corresponding configuration items as needed: - **API Key**: The API key you applied for on the Azure OpenAI account page, which can be found in the "Keys and Endpoints" section. - **API Address**: Azure API address, which can be found in the "Keys and Endpoints" section when checking resources in the Azure portal. - **Azure API Version**: The API version of Azure, following the format YYYY-MM-DD. Refer to the [latest version](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions). -- ** Model List**: set your model list +- \*\* Model List\*\*: set your model list After completing the configuration of the above fields, click "Check". If it prompts "Check passed", it means the configuration was successful. @@ -37,10 +34,10 @@ After completing the configuration of the above fields, click "Check". If it pro If you want the deployed version to be pre-configured with Azure OpenAI for end users to use directly, you need to configure the following environment variables during deployment: -| Environment Variable | Type | Description | Default Value | Example | -| --- | --- | --- | --- | --- | -| `AZURE_API_KEY` | Required | This is the API key you obtained from the Azure OpenAI account page | - | `c55168be3874490ef0565d9779ecd5a6` | -| `AZURE_ENDPOINT` | Required | Azure API address, can be found in the "Keys and Endpoints" section when checking resources in the Azure portal | - | `https://docs-test-001.openai.azure.com` | -| `AZURE_API_VERSION` | Required | Azure API version, following the format YYYY-MM-DD | 2023-08-01-preview | `-`, see [latest version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions) | -| `AZURE_MODEL_LIST` | Required | Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see [Model List](/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` or `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | -| `ACCESS_CODE` | Optional | Add a password to access LobeChat. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | - | `awCT74` or `e3@09!` or `code1,code2,code3` | +| Environment Variable | Type | Description | Default Value | Example | +| -------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- | +| `AZURE_API_KEY` | Required | This is the API key you obtained from the Azure OpenAI account page | - | `c55168be3874490ef0565d9779ecd5a6` | +| `AZURE_ENDPOINT` | Required | Azure API address, can be found in the "Keys and Endpoints" section when checking resources in the Azure portal | - | `https://docs-test-001.openai.azure.com` | +| `AZURE_API_VERSION` | Required | Azure API version, following the format YYYY-MM-DD | 2023-08-01-preview | `-`, see [latest version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions) | +| `AZURE_MODEL_LIST` | Required | Used to control the model list, use `+` to add a model, use `-` to hide a model, use `id->deplymentName=displayName` to customize the display name of a model, separated by commas. Definition syntax rules see [Model List](/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` or `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | +| `ACCESS_CODE` | Optional | Add a password to access LobeChat. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | - | `awCT74` or `e3@09!` or `code1,code2,code3` | diff --git a/docs/self-hosting/examples/azure-openai.zh-CN.mdx b/docs/self-hosting/examples/azure-openai.zh-CN.mdx index 31700ece81fdf..f875ccac76518 100644 --- a/docs/self-hosting/examples/azure-openai.zh-CN.mdx +++ b/docs/self-hosting/examples/azure-openai.zh-CN.mdx @@ -19,10 +19,7 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai- 点击左下角「操作」 -「设置」,切到 「语言模型」 Tab 后通过开启「Azure OpenAI」开关,即可开启使用 Azure OpenAI。 -在界面中配置 +在界面中配置 你按需填写相应的配置项: @@ -39,10 +36,10 @@ LobeChat 支持使用 [Azure OpenAI](https://learn.microsoft.com/zh-cn/azure/ai- 如果你希望部署的版本直接配置好 Azure OpenAI,让终端用户直接使用,那么你需要在部署时配置以下环境变量: -| 环境变量 | 类型 | 描述 | 默认值 | 示例 | -| --- | --- | --- | --- | --- | -| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥 | - | `c55168be3874490ef0565d9779ecd5a6` | -| `AZURE_ENDPOINT` | 必选 | Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值 | - | `https://docs-test-001.openai.azure.com` | -| `AZURE_API_VERSION` | 必选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式 | 2023-08-01-preview | `-`,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions) | -| `AZURE_MODEL_LIST` | 必选 | 用来控制模型列表,使用 `模型名->部署名=展示名` 来自定义模型的展示名,用英文逗号隔开。支持扩展能力,其余语法规则详见 [模型列表](/zh/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` 或 `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | -| `ACCESS_CODE` | 可选 | 添加访问 LobeChat 的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` | +| 环境变量 | 类型 | 描述 | 默认值 | 示例 | +| ------------------- | -- | --------------------------------------------------------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------- | +| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥 | - | `c55168be3874490ef0565d9779ecd5a6` | +| `AZURE_ENDPOINT` | 必选 | Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值 | - | `https://docs-test-001.openai.azure.com` | +| `AZURE_API_VERSION` | 必选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式 | 2023-08-01-preview | `-`,查阅[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions) | +| `AZURE_MODEL_LIST` | 必选 | 用来控制模型列表,使用 `模型名->部署名=展示名` 来自定义模型的展示名,用英文逗号隔开。支持扩展能力,其余语法规则详见 [模型列表](/zh/docs/self-hosting/advanced/model-list) | - | `gpt-35-turbo->my-deploy=GPT 3.5 Turbo` 或 `gpt-4-turbo->my-gpt4=GPT 4 Turbo<128000:vision:fc>` | +| `ACCESS_CODE` | 可选 | 添加访问 LobeChat 的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | - | `awCT74` 或 `e3@09!` or `code1,code2,code3` | diff --git a/docs/self-hosting/examples/ollama.mdx b/docs/self-hosting/examples/ollama.mdx index 1ff70552d9565..bb5f60121a059 100644 --- a/docs/self-hosting/examples/ollama.mdx +++ b/docs/self-hosting/examples/ollama.mdx @@ -40,13 +40,13 @@ When you first initiate Ollama, it is configured to allow access only from the l ### Ollama Environment Variables -| Environment Variable | Description | Default Value | Additional Information | -| --- | --- | --- | --- | -| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine | -| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "\*" to avoid CORS, please set on demand | -| `OLLAMA_MODELS` | Path to the directory where models are located | "~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements | -| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O | -| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | | +| Environment Variable | Description | Default Value | Additional Information | +| -------------------- | ------------------------------------------------------ | --------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine | +| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "\*" to avoid CORS, please set on demand | +| `OLLAMA_MODELS` | Path to the directory where models are located | "\~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements | +| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O | +| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | | ### Setting environment variables on Windows @@ -90,6 +90,7 @@ If Ollama is run as a systemd service, environment variables should be set using ``` 3. Save and exit. + 4. Reload `systemd` and restart Ollama: ```bash diff --git a/docs/self-hosting/examples/ollama.zh-CN.mdx b/docs/self-hosting/examples/ollama.zh-CN.mdx index e7e82af5c483e..2ce219204bc59 100644 --- a/docs/self-hosting/examples/ollama.zh-CN.mdx +++ b/docs/self-hosting/examples/ollama.zh-CN.mdx @@ -38,13 +38,13 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 ### Ollama 环境变量 -| 环境变量 | 描述 | 默认值 | 附加说明 | -| --- | --- | --- | --- | -| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0:端口号 可以指定所有人访问特定端口 | -| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "\*" 可以避免 CORS 跨域错误,按需设置 | -| `OLLAMA_MODELS` | 模型存放的路径 | "~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 | -| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 | -| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | | +| 环境变量 | 描述 | 默认值 | 附加说明 | +| ------------------- | ---------------- | -------------------------------------------------------- | ----------------------------- | +| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0: 端口号 可以指定所有人访问特定端口 | +| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "\*" 可以避免 CORS 跨域错误,按需设置 | +| `OLLAMA_MODELS` | 模型存放的路径 | "\~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 | +| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 | +| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | | ### 在 Windows 上设置环境变量 @@ -88,6 +88,7 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 ``` 3. 保存并退出。 + 4. 重载`systemd`并重启 Ollama: ```bash diff --git a/docs/self-hosting/platform/alibaba-cloud.mdx b/docs/self-hosting/platform/alibaba-cloud.mdx index eead36e8deca3..c0cc3ec92a941 100644 --- a/docs/self-hosting/platform/alibaba-cloud.mdx +++ b/docs/self-hosting/platform/alibaba-cloud.mdx @@ -18,17 +18,15 @@ If you want to deploy LobeChat on Alibaba Cloud, you can follow the steps below: ## Alibaba Cloud Deployment Process + ### Prepare your API Key -### Prepare your API Key + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. Or go to [Tongyi Qianwen API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) to get your API Key. -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. Or go to [Tongyi Qianwen API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) to get your API Key. + ### One-click to deploy -### One-click to deploy - -[![][deploy-button-image]][deploy-link] - -### Once deployed, you can start using it + [![][deploy-button-image]][deploy-link] + ### Once deployed, you can start using it [deploy-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg diff --git a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx index b8bf26d6e2a14..b7395f167cc77 100644 --- a/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +++ b/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx @@ -15,17 +15,15 @@ tags: ## 阿里云 部署流程 + ### 准备好你的 API Key -### 准备好你的 API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key 或 前往 [通义千问 API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) 获取你的通义千问 API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key 或 前往 [通义千问 API Key](https://bailian.console.aliyun.com/?apiKey=1#/api-key) 获取你的通义千问 API Key + ### 点击下方按钮进行部署 -### 点击下方按钮进行部署 - -[![][deploy-button-image]][deploy-link] - -### 部署完毕后,即可开始使用 + [![][deploy-button-image]][deploy-link] + ### 部署完毕后,即可开始使用 [deploy-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg diff --git a/docs/self-hosting/platform/btpanel.mdx b/docs/self-hosting/platform/btpanel.mdx index c6163aea6e6c7..eae910076b9a3 100644 --- a/docs/self-hosting/platform/btpanel.mdx +++ b/docs/self-hosting/platform/btpanel.mdx @@ -21,10 +21,11 @@ To install aaPanel, go to the [aaPanel](https://www.aapanel.com/new/download.htm 2. The first time you will be prompted to install the `Docker` and `Docker Compose` services, click Install Now. If it is already installed, please ignore it. ![install2](https://github.com/user-attachments/assets/e269bd27-d323-43ba-811b-c0f5e4137903) -3. After the installation is complete, find `LobeChat` in `One-Click Install` and click `install` +3. After the installation is complete, find `LobeChat` in `One-Click Install` and click `install`\ ![install-LobeChat](https://github.com/user-attachments/assets/9f989104-bb8e-4acd-9721-6b1db1017d2b) -4. configure basic information such as the domain name, OpenAI API key, and port to complete the installation Note: The domain name is optional, if the domain name is filled, it can be managed through [Website]--> [Proxy Project], and you do not need to check [Allow external access] after filling in the domain name, otherwise you need to check it before you can access it through the port ![addLobeChat](https://github.com/user-attachments/assets/f0b2e72d-9eee-46a8-b094-4834b78764df) +4. configure basic information such as the domain name, OpenAI API key, and port to complete the installation Note: The domain name is optional, if the domain name is filled, it can be managed through \[Website]--> \[Proxy Project], and you do not need to check \[Allow external access] after filling in the domain name, otherwise you need to check it before you can access it through the port ![addLobeChat](https://github.com/user-attachments/assets/f0b2e72d-9eee-46a8-b094-4834b78764df) + 5. After installation, enter the domain name or IP+ port set in the previous step in the browser to access. - Name: application name, default `LobeChat-random characters` @@ -35,6 +36,10 @@ To install aaPanel, go to the [aaPanel](https://www.aapanel.com/new/download.htm 6. After submission, the panel will automatically initialize the application, which will take about `1-3` minutes. It can be accessed after the initialization is completed. + + ⚠️ Do not enable any form of cache in the reverse proxy settings of the panel to avoid affecting the normal operation of the service. Read more at [https://github.com/lobehub/lobe-chat/discussions/5986](https://github.com/lobehub/lobe-chat/discussions/5986) + + ## Visit LobeChat - If you have set a domain name, please directly enter the domain name in the browser address bar, such as `http://demo.lobechat`, to access the `LobeChat` console. diff --git a/docs/self-hosting/platform/btpanel.zh-CN.mdx b/docs/self-hosting/platform/btpanel.zh-CN.mdx index f7b168dd641f3..379ef5254c7bb 100644 --- a/docs/self-hosting/platform/btpanel.zh-CN.mdx +++ b/docs/self-hosting/platform/btpanel.zh-CN.mdx @@ -13,7 +13,7 @@ tags: ## 前提 -- 仅适用于宝塔面板9.2.0及以上版本 +- 仅适用于宝塔面板 9.2.0 及以上版本 - 安装宝塔面板,前往[宝塔面板](https://www.bt.cn/new/download.html)官网,选择正式版的脚本下载安装 ## 部署 @@ -35,11 +35,15 @@ tags: - OpenAI API 密钥:请输入您的 Open API 密钥 - OpenAI 代理 URL:默认为官方地址 - OpenAI 模型列表:输入使用的模型 -- CPU 核心数限制:0为不限制,根据实际需要设置 -- 内存限制:0为不限制,根据实际需要设置 +- CPU 核心数限制:0 为不限制,根据实际需要设置 +- 内存限制:0 为不限制,根据实际需要设置 5. 提交后面板会自动进行应用初始化,大概需要`1-3`分钟,初始化完成后即可访问。 + + ⚠️ 请不要在面板的反向代理设置中开启任何形式的缓存,以免影响服务的正常运行。详情请见 [https://github.com/lobehub/lobe-chat/discussions/5986](https://github.com/lobehub/lobe-chat/discussions/5986) + + ## 访问 LobeChat - 如果您填写域名,请在浏览器输入您的域名访问,如`http://demo.lobechat`,即可访问 `LobeChat` 页面。 diff --git a/docs/self-hosting/platform/docker-compose.mdx b/docs/self-hosting/platform/docker-compose.mdx index 66cc38cd20373..4934b73ebca4b 100644 --- a/docs/self-hosting/platform/docker-compose.mdx +++ b/docs/self-hosting/platform/docker-compose.mdx @@ -15,124 +15,114 @@ tags: # Docker Compose Deployment Guide
+ [![][docker-release-shield]][docker-release-link] -[![][docker-release-shield]][docker-release-link] - -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
We provide a [Docker image][docker-release-link] for deploying the LobeChat service on your private device. + ### Install Docker Container Environment -### Install Docker Container Environment - -(Skip this step if already installed) - - - - - -```fish -$ apt install docker.io -``` - - - - - -```fish -$ yum install docker -``` - - + (Skip this step if already installed) - + + + ```fish + $ apt install docker.io + ``` + -### Run Docker Compose Deployment Command + + ```fish + $ yum install docker + ``` + + -When using `docker-compose`, the configuration file is as follows: + ### Run Docker Compose Deployment Command -```yml -version: '3.8' + When using `docker-compose`, the configuration file is as follows: -services: - lobe-chat: - image: lobehub/lobe-chat - container_name: lobe-chat - restart: always - ports: - - '3210:3210' - environment: - OPENAI_API_KEY: sk-xxxx - OPENAI_PROXY_URL: https://api-proxy.com/v1 - ACCESS_CODE: lobe66 -``` + ```yml + version: '3.8' -Run the following command to start the Lobe Chat service: + services: + lobe-chat: + image: lobehub/lobe-chat + container_name: lobe-chat + restart: always + ports: + - '3210:3210' + environment: + OPENAI_API_KEY: sk-xxxx + OPENAI_PROXY_URL: https://api-proxy.com/v1 + ACCESS_CODE: lobe66 + ``` -```bash -$ docker-compose up -d -``` + Run the following command to start the Lobe Chat service: -### Crontab Automatic Update Script (Optional) + ```bash + $ docker-compose up -d + ``` -Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required. + ### Crontab Automatic Update Script (Optional) -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + Similarly, you can use the following script to automatically update Lobe Chat. When using `Docker Compose`, no additional configuration of environment variables is required. -# Set proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# You may need to navigate to the directory where `docker-compose.yml` is located first -# cd /path/to/docker-compose-folder + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Run the new container -echo "Started: $(docker-compose up)" + # You may need to navigate to the directory where `docker-compose.yml` is located first + # cd /path/to/docker-compose-folder -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker-compose up)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat diff --git a/docs/self-hosting/platform/docker-compose.zh-CN.mdx b/docs/self-hosting/platform/docker-compose.zh-CN.mdx index ac281712c24d8..3694ddd79718d 100644 --- a/docs/self-hosting/platform/docker-compose.zh-CN.mdx +++ b/docs/self-hosting/platform/docker-compose.zh-CN.mdx @@ -12,122 +12,112 @@ tags: # Docker Compose 部署指引
+ [![](https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff\&label=docker\&labelColor=black\&logo=docker\&logoColor=white\&style=flat-square)](https://hub.docker.com/r/lobehub/lobe-chat) -[![](https://img.shields.io/docker/v/lobehub/lobe-chat?color=369eff&label=docker&labelColor=black&logo=docker&logoColor=white&style=flat-square)](https://hub.docker.com/r/lobehub/lobe-chat) - -[![](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square)](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff&labelColor=black&style=flat-square) - -[![](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square)](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11&labelColor=black&style=flat-square) + [![](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff\&labelColor=black\&style=flat-square)](https://img.shields.io/docker/image-size/lobehub/lobe-chat?color=369eff\&labelColor=black\&style=flat-square) + [![](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11\&labelColor=black\&style=flat-square)](https://img.shields.io/docker/pulls/lobehub/lobe-chat?color=45cc11\&labelColor=black\&style=flat-square)
我们提供了 [Docker 镜像](https://hub.docker.com/r/lobehub/lobe-chat) ,供你在自己的私有设备上部署 LobeChat 服务。 + ### 安装 Docker 容器环境 -### 安装 Docker 容器环境 - -(如果已安装,请跳过此步) - - - - - -```fish -$ apt install docker.io -``` - - - - - -```fish -$ yum install docker -``` - - + (如果已安装,请跳过此步) - + + + ```fish + $ apt install docker.io + ``` + -### 运行 Docker Compose 部署指令 + + ```fish + $ yum install docker + ``` + + -使用 `docker-compose` 时配置文件如下: + ### 运行 Docker Compose 部署指令 -```yml -version: '3.8' + 使用 `docker-compose` 时配置文件如下: -services: - lobe-chat: - image: lobehub/lobe-chat - container_name: lobe-chat - restart: always - ports: - - '3210:3210' - environment: - OPENAI_API_KEY: sk-xxxx - OPENAI_PROXY_URL: https://api-proxy.com/v1 - ACCESS_CODE: lobe66 -``` + ```yml + version: '3.8' -运行以下命令启动 Lobe Chat 服务: + services: + lobe-chat: + image: lobehub/lobe-chat + container_name: lobe-chat + restart: always + ports: + - '3210:3210' + environment: + OPENAI_API_KEY: sk-xxxx + OPENAI_PROXY_URL: https://api-proxy.com/v1 + ACCESS_CODE: lobe66 + ``` -```bash -$ docker-compose up -d -``` + 运行以下命令启动 Lobe Chat 服务: -### Crontab 自动更新脚本(可选) + ```bash + $ docker-compose up -d + ``` -类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。 + ### Crontab 自动更新脚本(可选) -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + 类似地,你可以使用以下脚本来自动更新 Lobe Chat,使用 `Docker Compose` 时,环境变量无需额外配置。 -# Set proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# You may need to navigate to the directory where `docker-compose.yml` is located first -# cd /path/to/docker-compose-folder + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Run the new container -echo "Started: $(docker-compose up)" + # You may need to navigate to the directory where `docker-compose.yml` is located first + # cd /path/to/docker-compose-folder -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker-compose up)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can also be used in Crontab, but ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` diff --git a/docs/self-hosting/platform/docker.mdx b/docs/self-hosting/platform/docker.mdx index 3b8fc8fb60319..bc50015d50331 100644 --- a/docs/self-hosting/platform/docker.mdx +++ b/docs/self-hosting/platform/docker.mdx @@ -16,10 +16,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
We provide a [Docker image][docker-release-link] for you to deploy the LobeChat service on your private device. @@ -27,138 +26,134 @@ We provide a [Docker image][docker-release-link] for you to deploy the LobeChat ### Install Docker Container Environment -(If already installed, skip this step) + (If already installed, skip this step) ```fish $ apt install docker.io ``` - - + ```fish $ yum install docker ``` + + - - - - -### Docker Command Deployment - -Use the following command to start the LobeChat service with one click: + ### Docker Command Deployment -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + Use the following command to start the LobeChat service with one click: -Command explanation: + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -- The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping. + Command explanation: -- Replace `sk-xxxx` in the above command with your OpenAI API Key. + - The default port mapping is `3210`, please ensure it is not occupied or manually change the port mapping. -- For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-variables) section. + - Replace `sk-xxxx` in the above command with your OpenAI API Key. - - Since the official Docker image build takes about half an hour, if you see the "update available" - prompt after deployment, you can wait for the image to finish building before deploying again. - + - For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-variables) section. - - The official Docker image does not have a password set. It is strongly recommended to add a - password to enhance security, otherwise you may encounter situations like [My API Key was - stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123). - + + Since the official Docker image build takes about half an hour, if you see the "update available" + prompt after deployment, you can wait for the image to finish building before deploying again. + - - Note that when the **deployment architecture is inconsistent with the image**, you need to - cross-compile **Sharp**, see [Sharp - Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details. - + + The official Docker image does not have a password set. It is strongly recommended to add a + password to enhance security, otherwise you may encounter situations like [My API Key was + stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123). + -#### Using a Proxy Address + + Note that when the **deployment architecture is inconsistent with the image**, you need to + cross-compile **Sharp**, see [Sharp + Cross-Compilation](https://sharp.pixelplumbing.com/install#cross-platform) for details. + -If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable: + #### Using a Proxy Address -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + If you need to use the OpenAI service through a proxy, you can configure the proxy address using the `OPENAI_PROXY_URL` environment variable: -### Crontab Automatic Update Script (Optional) + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -If you want to automatically obtain the latest image, you can follow these steps. + ### Crontab Automatic Update Script (Optional) -First, create a `lobe.env` configuration file with various environment variables, for example: + If you want to automatically obtain the latest image, you can follow these steps. -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + First, create a `lobe.env` configuration file with various environment variables, for example: -Then, you can use the following script to automate the update: + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + Then, you can use the following script to automate the update: -# Set up proxy (optional) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# Pull the latest image and store the output in a variable -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # Set up proxy (optional) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# Check if the pull command was executed successfully -if [ $? -ne 0 ]; then - exit 1 -fi + # Pull the latest image and store the output in a variable + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# Check if the output contains a specific string -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # Check if the pull command was executed successfully + if [ $? -ne 0 ]; then + exit 1 + fi -# If the image is already up to date, do nothing -if [ $? -eq 0 ]; then - exit 0 -fi + # Check if the output contains a specific string + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # If the image is already up to date, do nothing + if [ $? -eq 0 ]; then + exit 0 + fi -# Remove the old container -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# Run the new container -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" + # Remove the old container + echo "Removed: $(docker rm -f Lobe-Chat)" -# Print the update time and version -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # Run the new container + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" -# Clean up unused images -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # Print the update time and version + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. + # Clean up unused images + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -Configure Crontab to execute the script every 5 minutes: + This script can be used in Crontab, but please ensure that your Crontab can find the correct Docker command. It is recommended to use absolute paths. -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + Configure Crontab to execute the script every 5 minutes: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat diff --git a/docs/self-hosting/platform/docker.zh-CN.mdx b/docs/self-hosting/platform/docker.zh-CN.mdx index f0de6c82dc99d..66feb8c0c7c8d 100644 --- a/docs/self-hosting/platform/docker.zh-CN.mdx +++ b/docs/self-hosting/platform/docker.zh-CN.mdx @@ -15,10 +15,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。 @@ -28,138 +27,134 @@ tags: ### 安装 Docker 容器环境 -(如果已安装,请跳过此步) + (如果已安装,请跳过此步) ```fish $ apt install docker.io ``` - - + ```fish $ yum install docker ``` + + - - - + ### Docker 指令部署 -### Docker 指令部署 + 使用以下命令即可使用一键启动 LobeChat 服务: -使用以下命令即可使用一键启动 LobeChat 服务: + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 指令说明: -指令说明: - -- 默认映射端口为 `3210`, 请确保未被占用或手动更改端口映射 -- 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx` ,获取 API Key 的方式详见最后一节。 - - - LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) - 部分 - + - 默认映射端口为 `3210`, 请确保未被占用或手动更改端口映射 + - 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx` ,获取 API Key 的方式详见最后一节。 - - 由于官方的 Docker - 镜像构建大约需要半小时左右,如果在更新部署后会出现「存在更新」的提示,可以等待镜像构建完成后再次部署。 - + + LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) + 部分 + - - 官方 Docker 镜像中未设定密码,强烈建议添加密码以提升安全性,否则你可能会遇到 [My API Key was - stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123) 这样的情况 - + + 由于官方的 Docker + 镜像构建大约需要半小时左右,如果在更新部署后会出现「存在更新」的提示,可以等待镜像构建完成后再次部署。 + - - 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp - 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform) - + + 官方 Docker 镜像中未设定密码,强烈建议添加密码以提升安全性,否则你可能会遇到 [My API Key was + stolen!!!](https://github.com/lobehub/lobe-chat/issues/1123) 这样的情况 + -#### 使用代理地址 + + 注意,当**部署架构与镜像的不一致时**,需要对 **Sharp** 进行交叉编译,详见 [Sharp + 交叉编译](https://sharp.pixelplumbing.com/install#cross-platform) + -如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址: + #### 使用代理地址 -```fish -$ docker run -d -p 3210:3210 \ - -e OPENAI_API_KEY=sk-xxxx \ - -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ - -e ACCESS_CODE=lobe66 \ - --name lobe-chat \ - lobehub/lobe-chat -``` + 如果你需要通过代理使用 OpenAI 服务,你可以使用 `OPENAI_PROXY_URL` 环境变量来配置代理地址: -### Crontab 自动更新脚本(可选) + ```fish + $ docker run -d -p 3210:3210 \ + -e OPENAI_API_KEY=sk-xxxx \ + -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \ + -e ACCESS_CODE=lobe66 \ + --name lobe-chat \ + lobehub/lobe-chat + ``` -如果你想自动获得最新的镜像,你可以如下操作。 + ### Crontab 自动更新脚本(可选) -首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: + 如果你想自动获得最新的镜像,你可以如下操作。 -```env -OPENAI_API_KEY=sk-xxxx -OPENAI_PROXY_URL=https://api-proxy.com/v1 -ACCESS_CODE=arthals2333 -OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision -``` + 首先,新建一个 `lobe.env` 配置文件,内容为各种环境变量,例如: -然后,你可以使用以下脚本来自动更新: + ```env + OPENAI_API_KEY=sk-xxxx + OPENAI_PROXY_URL=https://api-proxy.com/v1 + ACCESS_CODE=arthals2333 + OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.5-turbo-16k,gpt-4-0125-preview=gpt-4-turbo,gpt-4-vision-preview=gpt-4-vision + ``` -```bash -#!/bin/bash -# auto-update-lobe-chat.sh + 然后,你可以使用以下脚本来自动更新: -# 设置代理(可选) -export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 + ```bash + #!/bin/bash + # auto-update-lobe-chat.sh -# 拉取最新的镜像并将输出存储在变量中 -output=$(docker pull lobehub/lobe-chat:latest 2>&1) + # 设置代理(可选) + export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890 -# 检查拉取命令是否成功执行 -if [ $? -ne 0 ]; then - exit 1 -fi + # 拉取最新的镜像并将输出存储在变量中 + output=$(docker pull lobehub/lobe-chat:latest 2>&1) -# 检查输出中是否包含特定的字符串 -echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" + # 检查拉取命令是否成功执行 + if [ $? -ne 0 ]; then + exit 1 + fi -# 如果镜像已经是最新的,则不执行任何操作 -if [ $? -eq 0 ]; then - exit 0 -fi + # 检查输出中是否包含特定的字符串 + echo "$output" | grep -q "Image is up to date for lobehub/lobe-chat:latest" -echo "Detected Lobe-Chat update" + # 如果镜像已经是最新的,则不执行任何操作 + if [ $? -eq 0 ]; then + exit 0 + fi -# 删除旧的容器 -echo "Removed: $(docker rm -f Lobe-Chat)" + echo "Detected Lobe-Chat update" -# 运行新的容器 -echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" + # 删除旧的容器 + echo "Removed: $(docker rm -f Lobe-Chat)" -# 打印更新的时间和版本 -echo "Update time: $(date)" -echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" + # 运行新的容器 + echo "Started: $(docker run -d --network=host --env-file /path/to/lobe.env --name=Lobe-Chat --restart=always lobehub/lobe-chat)" -# 清理不再使用的镜像 -docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 -echo "Removed old images." -``` + # 打印更新的时间和版本 + echo "Update time: $(date)" + echo "Version: $(docker inspect lobehub/lobe-chat:latest | grep 'org.opencontainers.image.version' | awk -F'"' '{print $4}')" -此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 + # 清理不再使用的镜像 + docker images | grep 'lobehub/lobe-chat' | grep -v 'lobehub/lobe-chat-database' | grep -v 'latest' | awk '{print $3}' | xargs -r docker rmi > /dev/null 2>&1 + echo "Removed old images." + ``` -配置 Crontab,每 5 分钟执行一次脚本: + 此脚本可以在 Crontab 中使用,但请确认你的 Crontab 可以找到正确的 Docker 命令。建议使用绝对路径。 -```bash -*/5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 -``` + 配置 Crontab,每 5 分钟执行一次脚本: + ```bash + */5 * * * * /path/to/auto-update-lobe-chat.sh >> /path/to/auto-update-lobe-chat.log 2>&1 + ``` ## 获取 OpenAI API Key @@ -172,31 +167,17 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节 - 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key: + #### 步骤 1:打开创建窗口 -#### 步骤 1:打开创建窗口 - -{'打开创建窗口'} - -#### 步骤 2:创建 API Key + {'打开创建窗口'} -{'创建 + #### 步骤 2:创建 API Key -#### 步骤 3:获取 API Key + {'创建 -{'获取 + #### 步骤 3:获取 API Key + {'获取 将此 API Key 填写到 LobeChat 的 API Key 配置中,即可开始使用。 @@ -211,8 +192,8 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节 如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考: -| Logo | 服务商 | 特性说明 | Proxy 代理地址 | 链接 | -| --- | --- | --- | --- | --- | +| Logo | 服务商 | 特性说明 | Proxy 代理地址 | 链接 | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------- | ------------------------- | ----------------------------- | | | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 、Cluade 3.5 等) | `https://aihubmix.com/v1` | [获取](https://lobe.li/CnsM6fH) | diff --git a/docs/self-hosting/platform/netlify.mdx b/docs/self-hosting/platform/netlify.mdx index f20084b5f2b18..7b86e482e7d77 100644 --- a/docs/self-hosting/platform/netlify.mdx +++ b/docs/self-hosting/platform/netlify.mdx @@ -22,129 +22,79 @@ If you want to deploy LobeChat on Netlify, you can follow these steps: ### Fork the LobeChat Repository -Click the Fork button to fork the LobeChat repository to your GitHub account. + Click the Fork button to fork the LobeChat repository to your GitHub account. -### Prepare your OpenAI API Key + ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to obtain your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to obtain your OpenAI API Key. -### Import to Netlify Workspace + ### Import to Netlify Workspace - - After testing, it is currently not supported to have a one-click deployment button similar to - Vercel/Zeabur. The reason is unknown. Therefore, manual import is required. - + + After testing, it is currently not supported to have a one-click deployment button similar to + Vercel/Zeabur. The reason is unknown. Therefore, manual import is required. + -Click "Import from git" + Click "Import from git" -{'Click + {'Click -Then click "Deploy with Github" and authorize Netlify to access your GitHub account. + Then click "Deploy with Github" and authorize Netlify to access your GitHub account. -{'Authorize + {'Authorize -Next, select the LobeChat project: + Next, select the LobeChat project: -{'Select + {'Select -### Configure Site Name and Environment Variables + ### Configure Site Name and Environment Variables -In this step, you need to configure your site, including the site name, build command, and publish directory. Fill in your site name in the "Site Name" field. If there are no special requirements, you do not need to modify the remaining configurations as we have already set the default configurations. + In this step, you need to configure your site, including the site name, build command, and publish directory. Fill in your site name in the "Site Name" field. If there are no special requirements, you do not need to modify the remaining configurations as we have already set the default configurations. -{'Configure + {'Configure -Click the "Add environment variables" button to add site environment variables: + Click the "Add environment variables" button to add site environment variables: -{'Add + {'Add -Taking OpenAI as an example, the environment variables you need to add are as follows: + Taking OpenAI as an example, the environment variables you need to add are as follows: -| Environment Variable | Type | Description | Example | -| --- | --- | --- | --- | -| `OPENAI_API_KEY` | Required | This is the API key you applied for on the OpenAI account page | `sk-xxxxxx...xxxxxx` | -| `ACCESS_CODE` | Required | Add a password to access this service. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | `awCT74` or `e3@09!` or `code1,code2,code3` | -| `OPENAI_PROXY_URL` | Optional | If you manually configure the OpenAI interface proxy, you can use this configuration to override the default OpenAI API request base URL | `https://aihubmix.com/v1`, default value: `https://api.openai.com/v1` | + | Environment Variable | Type | Description | Example | + | -------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | + | `OPENAI_API_KEY` | Required | This is the API key you applied for on the OpenAI account page | `sk-xxxxxx...xxxxxx` | + | `ACCESS_CODE` | Required | Add a password to access this service. You can set a long password to prevent brute force attacks. When this value is separated by commas, it becomes an array of passwords | `awCT74` or `e3@09!` or `code1,code2,code3` | + | `OPENAI_PROXY_URL` | Optional | If you manually configure the OpenAI interface proxy, you can use this configuration to override the default OpenAI API request base URL | `https://aihubmix.com/v1`, default value: `https://api.openai.com/v1` | - - For a complete list of environment variables supported by LobeChat, please refer to the [📘 - Environment Variables](/docs/self-hosting/environment-variables) - + + For a complete list of environment variables supported by LobeChat, please refer to the [📘 + Environment Variables](/docs/self-hosting/environment-variables) + -Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase + Afteradding the variables, finally click "Deploy lobe-chat" to enter the deployment phase -{'Environment + {'Environment -### Wait for Deployment to Complete + ### Wait for Deployment to Complete -After clicking deploy, you will enter the site details page, where you can click the "Deploying your site" in blue or the "Building" in yellow to view the deployment progress. + After clicking deploy, you will enter the site details page, where you can click the "Deploying your site" in blue or the "Building" in yellow to view the deployment progress. -{'Netlify + {'Netlify -Upon entering the deployment details, you will see the following interface, indicating that your LobeChat is currently being deployed. Simply wait for the deployment to complete. + Upon entering the deployment details, you will see the following interface, indicating that your LobeChat is currently being deployed. Simply wait for the deployment to complete. -{'LobeChat + {'LobeChat -During the deployment and build process: + During the deployment and build process: -{'Deployment - -### Deployment Successful, Start Using + {'Deployment -If your Deploy Log in the interface looks like the following, it means your LobeChat has been successfully deployed. - -{'Deployment + ### Deployment Successful, Start Using -At this point, you can click on "Open production deploy" to access your LobeChat site. + If your Deploy Log in the interface looks like the following, it means your LobeChat has been successfully deployed. + + {'Deployment + + At this point, you can click on "Open production deploy" to access your LobeChat site. {'Access diff --git a/docs/self-hosting/platform/netlify.zh-CN.mdx b/docs/self-hosting/platform/netlify.zh-CN.mdx index 3760bb95e1075..0078a80ebb2f4 100644 --- a/docs/self-hosting/platform/netlify.zh-CN.mdx +++ b/docs/self-hosting/platform/netlify.zh-CN.mdx @@ -20,126 +20,76 @@ tags: ### Fork LobeChat 仓库 -点击 Fork 按钮,将 LobeChat 仓库 Fork 到你的 GitHub 账号下。 + 点击 Fork 按钮,将 LobeChat 仓库 Fork 到你的 GitHub 账号下。 -### 准备好你的 OpenAI API Key + ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 在 Netlify 工作台导入 + ### 在 Netlify 工作台导入 -经过测试,暂不支持类似 Vercel/Zeabur 的一键部署按钮,原因未知。因此需要手动导入 + 经过测试,暂不支持类似 Vercel/Zeabur 的一键部署按钮,原因未知。因此需要手动导入 -点击 「Import from git」 + 点击 「Import from git」 -{'在 + {'在 -然后点击 「Deploy with Github」,并授权 Netlify 访问你的 GitHub 账号 + 然后点击 「Deploy with Github」,并授权 Netlify 访问你的 GitHub 账号 -{'授权 + {'授权 -然后选择 LobeChat 项目: + 然后选择 LobeChat 项目: -{'选择 + {'选择 -### 配置站点名称与环境变量 + ### 配置站点名称与环境变量 -在这一步,你需要配置你的站点,包括站点名称、构建命令、发布目录等。在「Site Name」字段填写上你的站点名称。其余配置如果没有特殊要求,无需修改,我们已经设定好了默认配置。 + 在这一步,你需要配置你的站点,包括站点名称、构建命令、发布目录等。在「Site Name」字段填写上你的站点名称。其余配置如果没有特殊要求,无需修改,我们已经设定好了默认配置。 -{'配置 + {'配置 -点击 「Add environment variables」按钮,添加站点环境变量: + 点击 「Add environment variables」按钮,添加站点环境变量: -{'添加 + {'添加 -以配置 OpenAI 为例,你需要添加的环境变量如下: + 以配置 OpenAI 为例,你需要添加的环境变量如下: -| 环境变量 | 类型 | 描述 | 示例 | -| --- | --- | --- | --- | -| `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` | -| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | `awCT74` 或 `e3@09!` or `code1,code2,code3` | -| `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://aihubmix.com/v1` ,默认值:`https://api.openai.com/v1` | + | 环境变量 | 类型 | 描述 | 示例 | + | ------------------ | -- | ------------------------------------------------------- | ---------------------------------------------------------- | + | `OPENAI_API_KEY` | 必选 | 这是你在 OpenAI 账户页面申请的 API 密钥 | `sk-xxxxxx...xxxxxx` | + | `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个长密码以防被爆破,该值用逗号分隔时为密码数组 | `awCT74` 或 `e3@09!` or `code1,code2,code3` | + | `OPENAI_PROXY_URL` | 可选 | 如果你手动配置了 OpenAI 接口代理,可以使用此配置项来覆盖默认的 OpenAI API 请求基础 URL | `https://aihubmix.com/v1` ,默认值:`https://api.openai.com/v1` | - - LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) - 部分 - + + LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/zh/docs/self-hosting/environment-variables) + 部分 + -添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。 + 添加完成后,最后点击「Deploy lobe-chat」 进入部署阶段。 -{'环境变量添加完成'} + {'环境变量添加完成'} -### 等待部署完成 + ### 等待部署完成 -点击部署后,会进入站点详情页面,你可以点击青色字样的「Deploying your site」或者 「Building」 黄色标签查看部署进度。 + 点击部署后,会进入站点详情页面,你可以点击青色字样的「Deploying your site」或者 「Building」 黄色标签查看部署进度。 -{'Netlify + {'Netlify -进入部署详情,你会看到下述界面,这意味着你的 LobeChat 正在部署中,只需等待部署完成即可。 + 进入部署详情,你会看到下述界面,这意味着你的 LobeChat 正在部署中,只需等待部署完成即可。 -{'LobeChat + {'LobeChat -部署构建过程中: + 部署构建过程中: -{'部署构建中'} + {'部署构建中'} -### 部署成功,开始使用 + ### 部署成功,开始使用 -如果你的界面中的 Deploy Log 如下所示,意味着你的 LobeChat 部署成功了。 - -{'部署成功'} + 如果你的界面中的 Deploy Log 如下所示,意味着你的 LobeChat 部署成功了。 -此时,你可以点击「Open production deploy」,即可访问你的 LobeChat 站点 + {'部署成功'} + + 此时,你可以点击「Open production deploy」,即可访问你的 LobeChat 站点 {'访问你的 diff --git a/docs/self-hosting/platform/railway.mdx b/docs/self-hosting/platform/railway.mdx index f312329f86515..3c6d683a5fc56 100644 --- a/docs/self-hosting/platform/railway.mdx +++ b/docs/self-hosting/platform/railway.mdx @@ -20,16 +20,15 @@ If you want to deploy LobeChat on Railway, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) + [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by Railway, or choose to bind a custom domain. Currently, the domains provided by Railway have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by Railway, or choose to bind a custom domain. Currently, the domains provided by Railway have not been contaminated, and most regions can connect directly. diff --git a/docs/self-hosting/platform/railway.zh-CN.mdx b/docs/self-hosting/platform/railway.zh-CN.mdx index 57fb29a21ace3..4f466ede01600 100644 --- a/docs/self-hosting/platform/railway.zh-CN.mdx +++ b/docs/self-hosting/platform/railway.zh-CN.mdx @@ -19,16 +19,15 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) + [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/FB6HrV?referralCode=9bD9mT) -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 Railway 提供的子域名,也可以选择绑定自定义域名。目前 Railway 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 Railway 提供的子域名,也可以选择绑定自定义域名。目前 Railway 提供的域名还未被污染,大多数地区都可以直连。 diff --git a/docs/self-hosting/platform/repocloud.mdx b/docs/self-hosting/platform/repocloud.mdx index 2b07870c4942c..a0bf8bc08aa80 100644 --- a/docs/self-hosting/platform/repocloud.mdx +++ b/docs/self-hosting/platform/repocloud.mdx @@ -20,18 +20,17 @@ If you want to deploy LobeChat on RepoCloud, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### One-click to deploy + ### One-click to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly. [deploy-button-image]: https://d16t0pc4846x52.cloudfront.net/deploy.svg diff --git a/docs/self-hosting/platform/repocloud.zh-CN.mdx b/docs/self-hosting/platform/repocloud.zh-CN.mdx index 0bdaabccef2a4..58d0e8097ee18 100644 --- a/docs/self-hosting/platform/repocloud.zh-CN.mdx +++ b/docs/self-hosting/platform/repocloud.zh-CN.mdx @@ -18,18 +18,17 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 RepoCloud 提供的子域名,也可以选择绑定自定义域名。目前 RepoCloud 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 RepoCloud 提供的子域名,也可以选择绑定自定义域名。目前 RepoCloud 提供的域名还未被污染,大多数地区都可以直连。 [deploy-button-image]: https://d16t0pc4846x52.cloudfront.net/deploy.svg diff --git a/docs/self-hosting/platform/sealos.mdx b/docs/self-hosting/platform/sealos.mdx index 440510e444aac..8ad9dae019f1d 100644 --- a/docs/self-hosting/platform/sealos.mdx +++ b/docs/self-hosting/platform/sealos.mdx @@ -19,18 +19,17 @@ If you want to deploy LobeChat on SealOS, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### After deployment, you can start using it + ### After deployment, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by SealOS, or choose to bind a custom domain. Currently, the domains provided by SealOS have not been contaminated, and can be directly accessed in most regions. + ### Bind a custom domain (optional) + You can use the subdomain provided by SealOS, or choose to bind a custom domain. Currently, the domains provided by SealOS have not been contaminated, and can be directly accessed in most regions. [deploy-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg diff --git a/docs/self-hosting/platform/sealos.zh-CN.mdx b/docs/self-hosting/platform/sealos.zh-CN.mdx index b0bf457a1ea7e..9896d9a5adcb8 100644 --- a/docs/self-hosting/platform/sealos.zh-CN.mdx +++ b/docs/self-hosting/platform/sealos.zh-CN.mdx @@ -18,18 +18,17 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 SealOS 提供的子域名,也可以选择绑定自定义域名。目前 SealOS 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 SealOS 提供的子域名,也可以选择绑定自定义域名。目前 SealOS 提供的域名还未被污染,大多数地区都可以直连。 [deploy-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg diff --git a/docs/self-hosting/platform/tencentcloud-lighthouse.mdx b/docs/self-hosting/platform/tencentcloud-lighthouse.mdx new file mode 100644 index 0000000000000..85d8f108d638c --- /dev/null +++ b/docs/self-hosting/platform/tencentcloud-lighthouse.mdx @@ -0,0 +1,33 @@ +--- +title: Deploy LobeChat on TencentCloud Lighthouse +description: >- + Learn how to deploy the LobeChat application on TencentCloud Lighthouse, + including preparing the large model API Key, clicking the deploy button, and + other operations. +tags: + - TencentCloud Lighthouse + - TencentCloud + - LobeChat + - API Key +--- + +# Deploy LobeChat with TencentCloud Lighthouse + +If you want to deploy LobeChat on TencentCloud Lighthouse, you can follow the steps below: + +## Tencent Cloud Deployment Process + + + ### Prepare your API Key + + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + + ### One-click to deploy + + [![][deploy-button-image]][deploy-link] + + ### Once deployed, you can start using it + + +[deploy-button-image]: https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/d65fb782-4fb0-4348-ad85-f2943d6bee8f.svg +[deploy-link]: https://buy.tencentcloud.com/lighthouse?blueprintType=APP_OS&blueprintOfficialId=lhbp-6u0ti132®ionId=9&zone=ap-singapore-3&bundleId=bundle_starter_nmc_lin_med2_01&loginSet=AUTO&rule=true&from=lobechat diff --git a/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx b/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx new file mode 100644 index 0000000000000..395ca10a976ac --- /dev/null +++ b/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx @@ -0,0 +1,31 @@ +--- +title: 在 腾讯轻量云 上部署 LobeChat +description: 学习如何快速在腾讯轻量云上部署LobeChat应用,包括准备大模型 API Key、点击部署按钮等操作。 +tags: + - 腾讯云 + - 腾讯轻量云 + - LobeChat + - 部署流程 + - 大模型 API Key +--- + +# 使用 腾讯轻量云 部署 + +如果想在 腾讯云 上部署 LobeChat,可以按照以下步骤进行操作: + +## 腾讯轻量云 部署流程 + + + ### 准备好你的 API Key + + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + + ### 点击下方按钮进行部署 + + [![][deploy-button-image]][deploy-link] + + ### 部署完毕后,即可开始使用 + + +[deploy-button-image]: https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/d65fb782-4fb0-4348-ad85-f2943d6bee8f.svg +[deploy-link]: https://buy.cloud.tencent.com/lighthouse?blueprintType=APP_OS&blueprintOfficialId=lhbp-6u0ti132®ionId=8&zone=ap-beijing-3&bundleId=bundle_starter_mc_med2_01&loginSet=AUTO&rule=true&from=lobechat diff --git a/docs/self-hosting/platform/vercel.mdx b/docs/self-hosting/platform/vercel.mdx index a521cf70d63d5..0c9efe23c6cb1 100644 --- a/docs/self-hosting/platform/vercel.mdx +++ b/docs/self-hosting/platform/vercel.mdx @@ -20,20 +20,19 @@ If you want to deploy LobeChat on Vercel, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat) + [![](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat\&env=OPENAI_API_KEY,ACCESS_CODE\&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website\&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys\&project-name=lobe-chat\&repository-name=lobe-chat) -Simply log in with your GitHub account, and remember to fill in `OPENAI_API_KEY` (required) and `ACCESS_CODE` (recommended) in the environment variables page. + Simply log in with your GitHub account, and remember to fill in `OPENAI_API_KEY` (required) and `ACCESS_CODE` (recommended) in the environment variables page. -### After deployment, you can start using it + ### After deployment, you can start using it -### Bind a custom domain (optional) - -Vercel's assigned domain DNS may be polluted in some regions, so binding a custom domain can establish a direct connection. + ### Bind a custom domain (optional) + Vercel's assigned domain DNS may be polluted in some regions, so binding a custom domain can establish a direct connection. ## Automatic Synchronization of Updates diff --git a/docs/self-hosting/platform/vercel.zh-CN.mdx b/docs/self-hosting/platform/vercel.zh-CN.mdx index 60fc6d012509f..acf68749bbe4d 100644 --- a/docs/self-hosting/platform/vercel.zh-CN.mdx +++ b/docs/self-hosting/platform/vercel.zh-CN.mdx @@ -19,20 +19,19 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -直接使用 GitHub 账号登录即可,记得在环境变量页填入 `OPENAI_API_KEY` (必填) and `ACCESS_CODE`(推荐); + 直接使用 GitHub 账号登录即可,记得在环境变量页填入 `OPENAI_API_KEY` (必填) and `ACCESS_CODE`(推荐); -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名即可直连。 + ### 绑定自定义域名(可选) + Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名即可直连。 ## 自动同步更新 diff --git a/docs/self-hosting/platform/zeabur.mdx b/docs/self-hosting/platform/zeabur.mdx index d6a4705a3e4bf..50baf76ffc585 100644 --- a/docs/self-hosting/platform/zeabur.mdx +++ b/docs/self-hosting/platform/zeabur.mdx @@ -19,23 +19,19 @@ If you want to deploy LobeChat on Zeabur, you can follow the steps below: ### Prepare your OpenAI API Key -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -### Click the button below to deploy + ### Click the button below to deploy -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### Once deployed, you can start using it + ### Once deployed, you can start using it -### Bind a custom domain (optional) - -You can use the subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. -[deploy-button-image]: https://zeabur.com/button.svg -[deploy-link]: https://zeabur.com/templates/VZGGTI - # Deploy LobeChat with Zeabur as serverless function > Note: There are still issues with [middlewares and rewrites of next.js on Zeabur](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899), use at your own risk! @@ -45,40 +41,41 @@ Since Zeabur does NOT officially support FREE users deploy containerized service ## Zeabur Deployment Process + ### Fork LobeChat -### Fork LobeChat - -### Add Zeabur pack config file + ### Add Zeabur pack config file -Add a `zbpack.json` configuration file with the following content to the root dir of your fork: + Add a `zbpack.json` configuration file with the following content to the root dir of your fork: -```json -{ - "ignore_dockerfile": true, - "serverless": true -} -``` + ```json + { + "ignore_dockerfile": true, + "serverless": true + } + ``` -### Prepare your OpenAI API Key - -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + ### Prepare your OpenAI API Key -### Login to your [Zeabur dashboard](https://dash.zeabur.com) + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -If you do not already have an account, you will need to register one. + ### Login to your [Zeabur dashboard](https://dash.zeabur.com) -### Create a project and service + If you do not already have an account, you will need to register one. -Create a project, then create a service under this project. + ### Create a project and service -### Link your fork of LobeChat to the just created Zeabur service. + Create a project, then create a service under this project. -When adding service, choose github. This may triger a oAuth depend on varies factors like how you login to Zeabur and if you have already authorized Zeabur to access all your repos + ### Link your fork of LobeChat to the just created Zeabur service. -### Bind a custom domain (optional) + When adding service, choose github. This may triger a oAuth depend on varies factors like how you login to Zeabur and if you have already authorized Zeabur to access all your repos -You can create a subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) -### Zeabur shall start auto build and you should be able to access it by the domain of your choice after a while. + You can create a subdomain provided by Zeabur, or choose to bind a custom domain. Currently, the domains provided by Zeabur have not been contaminated, and most regions can connect directly. + ### Zeabur shall start auto build and you should be able to access it by the domain of your choice after a while. + +[deploy-button-image]: https://zeabur.com/button.svg +[deploy-link]: https://zeabur.com/templates/VZGGTI diff --git a/docs/self-hosting/platform/zeabur.zh-CN.mdx b/docs/self-hosting/platform/zeabur.zh-CN.mdx index 00ee9aa463755..8b6fc7e2100b7 100644 --- a/docs/self-hosting/platform/zeabur.zh-CN.mdx +++ b/docs/self-hosting/platform/zeabur.zh-CN.mdx @@ -18,23 +18,19 @@ tags: ### 准备好你的 OpenAI API Key -前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key + 前往 [OpenAI API Key](https://platform.openai.com/account/api-keys) 获取你的 OpenAI API Key -### 点击下方按钮进行部署 + ### 点击下方按钮进行部署 -[![][deploy-button-image]][deploy-link] + [![][deploy-button-image]][deploy-link] -### 部署完毕后,即可开始使用 + ### 部署完毕后,即可开始使用 -### 绑定自定义域名(可选) - -你可以使用 Zeabur 提供的子域名,也可以选择绑定自定义域名。目前 Zeabur 提供的域名还未被污染,大多数地区都可以直连。 + ### 绑定自定义域名(可选) + 你可以使用 Zeabur 提供的子域名,也可以选择绑定自定义域名。目前 Zeabur 提供的域名还未被污染,大多数地区都可以直连。 -[deploy-button-image]: https://zeabur.com/button.svg -[deploy-link]: https://zeabur.com/templates/VZGGTI - # 使用 Zeabur 将 LobeChat 部署为无服务器函数 > **注意:** 仍然存在关于 [Zeabur 上 next.js 的中间件和重写问题](https://github.com/lobehub/lobe-chat/pull/2775?notification_referrer_id=NT_kwDOAdi2DrQxMDkyODQ4MDc2NTozMDk3OTU5OA#issuecomment-2146713899),请自担风险! @@ -44,40 +40,41 @@ tags: ## Zeabur 部署流程 + ### Fork LobeChat -### Fork LobeChat - -### 添加 Zeabur 打包配置文件 + ### 添加 Zeabur 打包配置文件 -在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下: + 在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下: -```json -{ - "ignore_dockerfile": true, - "serverless": true -} -``` + ```json + { + "ignore_dockerfile": true, + "serverless": true + } + ``` -### 准备您的 OpenAI API 密钥 + ### 准备您的 OpenAI API 密钥 -前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 + 前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 -### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com) + ### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com) -如果您尚未拥有一个账号,您需要注册一个。 + 如果您尚未拥有一个账号,您需要注册一个。 -### 创建项目与服务。 + ### 创建项目与服务。 -创建一个项目,并再这个项目下新建一个服务。 + 创建一个项目,并再这个项目下新建一个服务。 -### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。 + ### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。 -在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。 + 在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur 以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。 -### 绑定自定义域名(可选) + ### 绑定自定义域名(可选) -您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。 - -### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。 + 您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。 + ### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。 + +[deploy-button-image]: https://zeabur.com/button.svg +[deploy-link]: https://zeabur.com/templates/VZGGTI diff --git a/docs/self-hosting/server-database.mdx b/docs/self-hosting/server-database.mdx index d995f10efe08a..833720b8a9791 100644 --- a/docs/self-hosting/server-database.mdx +++ b/docs/self-hosting/server-database.mdx @@ -47,58 +47,56 @@ Before deployment, make sure you have a Postgres database instance ready. You ca Since we support file-based conversations/knowledge base conversations, we need to install the `pgvector` plugin for Postgres. This plugin provides vector search capabilities and is a key component for LobeChat to implement RAG. -### `NEXT_PUBLIC_SERVICE_MODE` + ### `NEXT_PUBLIC_SERVICE_MODE` -LobeChat supports both client-side and server-side databases, so we provide an environment variable for switching modes, which is `NEXT_PUBLIC_SERVICE_MODE`, with a default value of `client`. + LobeChat supports both client-side and server-side databases, so we provide an environment variable for switching modes, which is `NEXT_PUBLIC_SERVICE_MODE`, with a default value of `client`. -For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`. + For server-side database deployment scenarios, you need to set `NEXT_PUBLIC_SERVICE_MODE` to `server`. - - In the official `lobe-chat-database` Docker image, this environment variable is already set to - `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure - this environment variable again. - - - -Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image. - -If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build. + + In the official `lobe-chat-database` Docker image, this environment variable is already set to + `server` by default. Therefore, if you deploy using the Docker image, you do not need to configure + this environment variable again. + - + + Since environment variables starting with `NEXT_PUBLIC` take effect in the front-end code, they cannot be modified through container runtime injection. (Refer to the `next.js` documentation [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)). This is why we chose to create a separate DB version image. -### `DATABASE_URL` + If you need to modify variables with the `NEXT_PUBLIC` prefix in a Docker deployment, you must build the image yourself and inject your own `NEXT_PUBLIC` prefixed environment variables during the build. + -The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`. + ### `DATABASE_URL` - - If you want to enable SSL when connecting to the database, please refer to the - [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) - for setup instructions. - + The core of configuring the database is to add the `DATABASE_URL` environment variable and fill in the Postgres database connection URL you have prepared. The typical format of the database connection URL is `postgres://username:password@host:port/database`. -### `DATABASE_DRIVER` + + If you want to enable SSL when connecting to the database, please refer to the + [documentation](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) + for setup instructions. + -The `DATABASE_DRIVER` environment variable is used to distinguish between the two types of Postgres database instances, with values of `node` or `neon`. + ### `DATABASE_DRIVER` -To streamline deployment, we have set default values based on the characteristics of different platforms: + The `DATABASE_DRIVER` environment variable is used to distinguish between the two types of Postgres database instances, with values of `node` or `neon`. -- On the Vercel platform, `DATABASE_DRIVER` defaults to `neon`; -- In our provided Docker image `lobe-chat-database`, `DATABASE_DRIVER` defaults to `node`. + To streamline deployment, we have set default values based on the characteristics of different platforms: -Therefore, if you follow the standard deployment methods below, you do not need to manually configure the `DATABASE_DRIVER` environment variable: + - On the Vercel platform, `DATABASE_DRIVER` defaults to `neon`; + - In our provided Docker image `lobe-chat-database`, `DATABASE_DRIVER` defaults to `node`. -- Vercel + Serverless Postgres -- Docker image + Node Postgres + Therefore, if you follow the standard deployment methods below, you do not need to manually configure the `DATABASE_DRIVER` environment variable: -### `KEY_VAULTS_SECRET` + - Vercel + Serverless Postgres + - Docker image + Node Postgres -Considering that users will store sensitive information such as their API Key and baseURL in the database, we need a key to encrypt this information to prevent leakage in case of a database breach. Hence, the `KEY_VAULTS_SECRET` environment variable is used to encrypt sensitive information like user-stored apikeys. + ### `KEY_VAULTS_SECRET` - - You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl - rand -base64 32`. - + Considering that users will store sensitive information such as their API Key and baseURL in the database, we need a key to encrypt this information to prevent leakage in case of a database breach. Hence, the `KEY_VAULTS_SECRET` environment variable is used to encrypt sensitive information like user-stored apikeys. + + You can generate a random 32-character string as the value of `KEY_VAULTS_SECRET` using `openssl + rand -base64 32`. + ## Configuring Authentication Services @@ -107,7 +105,7 @@ In the server-side database mode, we need an authentication service to distingui ### Clerk -[Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) is an authentication SaaS service that provides out-of-the-box authentication capabilities with high productization, low integration costs, and a great user experience. For those who offer SaaS products, Clerk is a good choice. Our official [LobeChat Cloud](https://lobechat.com) uses Clerk as the authentication service. +[Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) is an authentication SaaS service that provides out-of-the-box authentication capabilities with high productization, low integration costs, and a great user experience. For those who offer SaaS products, Clerk is a good choice. Our official [LobeChat Cloud](https://lobechat.com) uses Clerk as the authentication service. The integration of Clerk is relatively simple, requiring only the configuration of these environment variables: diff --git a/docs/self-hosting/server-database.zh-CN.mdx b/docs/self-hosting/server-database.zh-CN.mdx index 8f0c966d0d361..fc8a0c94e224a 100644 --- a/docs/self-hosting/server-database.zh-CN.mdx +++ b/docs/self-hosting/server-database.zh-CN.mdx @@ -15,7 +15,7 @@ tags: LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用服务端数据库(下简称 DB 版)。LobeChat 采用了 Postgres 作为后端存储数据库。 - PostgreSQL是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准SQL支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。 + PostgreSQL 是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准 SQL 支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。 本文将从框架角度介绍在任何一个平台中部署 DB 版 LobeChat 的流程和原理,让你知其然也知其所以然,最后可以根据自己的实际情况进行部署。 @@ -41,59 +41,56 @@ LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用 两者的配置方式在环境变量的取值上会略有一点区别,其他方面是一样的。 -同时,由于我们支持了文件对话/知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 +同时,由于我们支持了文件对话 / 知识库对话的能力,因此我们需要为 Postgres 安装 `pgvector` 插件,该插件提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 + ### `NEXT_PUBLIC_SERVICE_MODE` -### `NEXT_PUBLIC_SERVICE_MODE` + LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。 -LobeChat 同时支持了客户端数据库和服务端数据库,因此我们提供了一个环境变量用于切换模式,这个变量为 `NEXT_PUBLIC_SERVICE_MODE`,该值默认为 `client`。 + 针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。 -针对服务端数据库部署场景,你需要将 `NEXT_PUBLIC_SERVICE_MODE` 设置为 `server`。 + + 在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用 + Docker 镜像部署,则无需再配置该环境变量。 + - - 在官方的 `lobe-chat-database` Docker 镜像中,已经默认将该环境变量设为 `server`,因此如果你使用 - Docker 镜像部署,则无需再配置该环境变量。 - + + 由于 `NEXT_PUBLIC` 开头的环境变量是在前端代码中生效的,而因此无法通过容器运行时注入进行修改。 (`next.js`的参考文档 [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables) ) 这也是为什么我们选择再打一个 DB 版镜像的原因。 - - 由于 `NEXT_PUBLIC` 开头的环境变量是在前端代码中生效的,而因此无法通过容器运行时注入进行修改。 (`next.js`的参考文档 [Configuring: Environment Variables | Next.js (nextjs.org)](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables) ) 这也是为什么我们选择再打一个 DB 版镜像的原因。 + 如果你需要在 Docker 部署中修改 `NEXT_PUBLIC` 前缀的变量,你必须自行构建镜像,在 build 时就把自己的 `NEXT_PUBLIC` 开头的环境变量打进去。 + -如果你需要在 Docker 部署中修改 `NEXT_PUBLIC` 前缀的变量,你必须自行构建镜像,在 build 时就把自己的 `NEXT_PUBLIC` 开头的环境变量打进去。 + ### `DATABASE_URL` - + 配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 -### `DATABASE_URL` + + 如果希望连接数据库时启用 SSL + ,请自行参考[文档](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 + -配置数据库,核心是添加 `DATABASE_URL` 环境变量,将你准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 + ### `DATABASE_DRIVER` - - 如果希望连接数据库时启用 SSL - ,请自行参考[文档](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 - + `DATABASE_DRIVER` 环境变量用于区分两种 Postgres 数据库实例,`DATABASE_DRIVER` 的取值为 `node` 或 `neon`。 -### `DATABASE_DRIVER` + 为提升部署便捷性,我们根据不同的平台特点设置了默认值: -`DATABASE_DRIVER` 环境变量用于区分两种 Postgres 数据库实例,`DATABASE_DRIVER` 的取值为 `node` 或 `neon`。 + - 在 Vercel 平台下,`DATABASE_DRIVER` 默认为 `neon`; + - 在我们提供的 Docker 镜像 `lobe-chat-database` 中,`DATABASE_DRIVER` 默认为 `node`。 -为提升部署便捷性,我们根据不同的平台特点设置了默认值: + 因此如果你采用了以下标准的部署方式,你无需手动配置 `DATABASE_DRIVER` 环境变量: -- 在 Vercel 平台下,`DATABASE_DRIVER` 默认为 `neon`; -- 在我们提供的 Docker 镜像 `lobe-chat-database` 中,`DATABASE_DRIVER` 默认为 `node`。 + - Vercel + Serverless Postgres + - Docker 镜像 + Node Postgres -因此如果你采用了以下标准的部署方式,你无需手动配置 `DATABASE_DRIVER` 环境变量: + ### `KEY_VAULTS_SECRET` -- Vercel + Serverless Postgres -- Docker 镜像 + Node Postgres - -### `KEY_VAULTS_SECRET` - -考虑到用户会存储自己的 API Key 和 baseURL 等敏感信息到数据库中,因此我们需要一个密钥来加密这些信息,避免数据库被爆破/脱库时这些关键信息被泄露。 因此有了 `KEY_VAULTS_SECRET` 环境变量,用于加密用户存储的 apikey 等敏感信息。 - - - 你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为 `KEY_VAULTS_SECRET` 的值。 - + 考虑到用户会存储自己的 API Key 和 baseURL 等敏感信息到数据库中,因此我们需要一个密钥来加密这些信息,避免数据库被爆破 / 脱库时这些关键信息被泄露。 因此有了 `KEY_VAULTS_SECRET` 环境变量,用于加密用户存储的 apikey 等敏感信息。 + + 你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为 `KEY_VAULTS_SECRET` 的值。 + ## 配置身份验证服务 @@ -102,7 +99,7 @@ LobeChat 同时支持了客户端数据库和服务端数据库,因此我们 ### Clerk -[Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 是一个身份验证 SaaS 服务,提供了开箱即用的身份验证能力,产品化程度很高,集成成本较低,体验很好。对于提供 SaaS 化产品的诉求来说,Clerk 是一个不错的选择。我们官方提供的 [LobeChat Cloud](https://lobechat.com),就是使用了 Clerk 作为身份验证服务。 +[Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 是一个身份验证 SaaS 服务,提供了开箱即用的身份验证能力,产品化程度很高,集成成本较低,体验很好。对于提供 SaaS 化产品的诉求来说,Clerk 是一个不错的选择。我们官方提供的 [LobeChat Cloud](https://lobechat.com),就是使用了 Clerk 作为身份验证服务。 Clerk 的集成也相对简单,只需要配置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、 `CLERK_SECRET_KEY` 和 `CLERK_WEBHOOK_SECRET` 环境变量即可,这三个环境变量可以在 Clerk 控制台中获取。 @@ -132,7 +129,7 @@ NextAuth 是一个开源的身份验证库,支持多种身份验证提供商 LobeChat 在 [很早以前](https://x.com/lobehub/status/1724289575672291782) 就支持了多模态的 AI 会话,其中涉及到图片上传给大模型的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 IndexedDB 数据库,但在服务端数据库中这个方案并不可行。因为在 Postgres 中直接存储文件类二进制数据会大大浪费宝贵的数据库存储空间,并拖慢计算性能。 -这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传/知识库功能所依赖的大容量静态文件存储方案。 +这块最佳实践是使用文件存储服务(S3)来存储图片文件,同时 S3 也是文件上传 / 知识库功能所依赖的大容量静态文件存储方案。 在本文档库中,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 diff --git a/docs/self-hosting/server-database/docker-compose.mdx b/docs/self-hosting/server-database/docker-compose.mdx index e6f1e004a3ccc..8a15f917874da 100644 --- a/docs/self-hosting/server-database/docker-compose.mdx +++ b/docs/self-hosting/server-database/docker-compose.mdx @@ -6,7 +6,7 @@ description: >- tags: - Docker Compose - LobeChat - - Docker Containers + - Docker Container - Deployment Guide --- @@ -15,135 +15,433 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
+ + **Note on Docker Deployment Limitations** + The Docker and Docker Compose deployment options do not support injecting the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` through environment variables, which prevents enabling the Clerk authentication service. Recommended alternatives include: + + - Hosting deployment via Vercel + + - Running a local image build process + + +## Quick Start + - This article assumes you are familiar with the basic principles and processes of deploying the - LobeChat server database version (hereinafter referred to as DB version), so it only includes core - environment variable configurations. If you are not familiar with the deployment principles of - LobeChat DB version, please refer to [Deploying with a Server - Database](/docs/self-hosting/server-database). + **System Compatibility Notes** + + - One-click deployment is supported in Unix environments (Linux/macOS). + + - Windows users must run through [WSL 2](https://aka.ms/wsl). + + - The one-click startup script is only for initial deployment; for subsequent deployments, please refer to the [Custom Deployment](#custom-deployment) section. + + - Port occupation check: Ensure that ports `3210`, `8000`, `9000`, and `9001` are available. - - Due to the inability to expose `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` using Docker environment variables, you cannot use Clerk as a login authentication service when deploying LobeChat with Docker / Docker Compose. +Execute the following commands to set up the deployment environment; the directory `lobe-chat-db` will be used to store your configuration files and subsequent database files. + +```sh +mkdir lobe-chat-db && cd lobe-chat-db +``` + +Fetch and execute the deployment script: + +```sh +bash <(curl -fsSL https://lobe.li/setup.sh) -l en +``` + +The script supports the following deployment modes; please choose the appropriate mode based on your needs and read the rest of the documentation. -If you need Clerk as a login authentication service, consider deploying with Vercel or building your own image. +- [Local Mode (default)](#local-mode): Accessible only locally, not supporting LAN/public access; suitable for initial experiences. +- [Port Mode](#port-mode): Supports LAN/public `http` access; suitable for no domain or private network use. +- [Domain Mode](#domain-mode): Supports LAN/public `http/https` access with reverse proxy; suitable for personal or team use. + + In the script's options prompt `(Option1/Option2)[Option1]`: `(Option1 / Option2)` indicates selectable options, while `[Option1]` indicates the default option; simply press enter to choose the default. -In general, to fully run the LobeChat database version, you need at least the following four services: +### Local Mode -- The LobeChat database version itself -- A PostgreSQL database with the PGVector plugin -- An object storage service that supports S3 protocol -- An SSO login authentication service supported by LobeChat + + ### Complete Remaining Configuration in Interactive Script -These services can be combined through self-built or online cloud services to meet different levels of deployment needs. + Continue pressing enter to use the default configuration. -In this article, we provide a Docker Compose configuration entirely based on open-source self-built services. You can use this configuration file directly to start the LobeChat database version or modify it to suit your needs. + ### Check Configuration Generation Report -We default to using [MinIO](https://github.com/minio/minio) as the local S3 object storage service and [Casdoor](https://github.com/casdoor/casdoor) as the local authentication service. + After the script finishes running, you need to check the configuration generation report, which includes the accounts and initial login passwords for the Casdoor administrator and user. -## Quick Start + + Please log in to LobeChat using the user account; the administrator account is only for managing Casdoor. + -To facilitate a quick start, this section uses the `docker-compose/local` directory's `docker-compose.yml` configuration file. The started LobeChat application runs at `http://localhost:3210` and can be run locally. + ```log + The results of the secure key generation are as follows: + LobeChat: + - URL: http://localhost:3210 + - Username: user + - Password: c66f8c + Casdoor: + - URL: http://localhost:8000 + - Username: admin + - Password: c66f8c + Minio: + - URL: http://localhost:9000 + - Username: admin + - Password: 8c82ea41 + ``` - - For a quick start, this `docker-compose.yml` contains a large number of sensitive Secret/Password - fields, suitable only for quick demonstrations or personal local use. Do not use it directly in a - production environment! Otherwise, you will be responsible for any security issues encountered! - + ### Start Docker + + ```sh + docker compose up -d + ``` + + ### Check Logs + + ```sh + docker logs -f lobe-chat + ``` + + If you see the following logs in the container, it means the startup was successful: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### Access Application + + Visit your LobeChat service at [http://localhost:3210](http://localhost:3210). The account credentials for the application can be found in the report from step `2`. + + +### Port Mode - ### One-click Startup Script + ### Complete Remaining Configuration in Interactive Script + + In port mode, you need to complete the following based on the script prompts: + + - Server IP address settings: for LAN/public access. + - Regenerate secure keys: We highly recommend regenerating the secure keys; if you lack the key generation library required by the script, we suggest referring to the [Custom Deployment](#custom-deployment) section for key modifications. + + ### Check Configuration Generation Report + + After the script finishes running, please check the configuration generation report for the Casdoor administrator account, user account, and their initial login passwords. + + + Please log in to LobeChat using the user account; the administrator account is only for managing Casdoor. + + + ```log + The results of the secure key generation are as follows: + LobeChat: + - URL: http://your_server_ip:3210 + - Username: user + - Password: 837e26 + Casdoor: + - URL: http://your_server_ip:8000 + - Username: admin + - Password: 837e26 + Minio: + - URL: http://your_server_ip:9000 + - Username: admin + - Password: dbac8440 + ``` + + ### Start Docker + + ```sh + docker compose up -d + ``` + + ### Check Logs + + ```sh + docker logs -f lobe-chat + ``` + + If you see the following logs in the container, it means the startup was successful: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://your_server_ip:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### Access Application + + You can access your LobeChat service at `http://your_server_ip:3210`. The account credentials for the application can be found in the report from step `2`. + + + If your service can accessed via the public network, + we strongly recommend disabling the registration, + refer to the [documentation](https://lobehub.com/docs/self-hosting/advanced/auth/next-auth/casdoor) + for more information. + + -Create a new directory named `lobe-chat-db` to store your configuration files and subsequent database files. +### Domain Mode -```sh -mkdir lobe-chat-db -cd lobe-chat-db -``` + + ### Complete Reverse Proxy Configuration + + In domain mode, you need to complete the reverse proxy configuration and ensure that the LAN/public can access the following services. Please use a reverse proxy to map the following service ports to the domain names: + + | Domain | Proxy Port | Required | + | ---------------------- | ---------- | -------- | + | `lobe.example.com` | `3210` | Yes | + | `auth.example.com` | `8000` | Yes | + | `minio.example.com` | `9000` | Yes | + | `minio-ui.example.com` | `9001` | | + + + If you are using panel software like [aaPanel](https://www.bt.cn/) for reverse proxy configuration, + ensure it does not intercept requests to the `.well-known` path to facilitate the proper functioning of Casdoor's OAuth2 configuration. + Below is a whitelist configuration for the Nginx server block concerning paths for Casdoor reverse proxy: + + ```nginx + location /.well-known/openid-configuration { + proxy_pass http://localhost:8000; # Forward to localhost:8000 + proxy_set_header Host $host; # Keep the original host header + proxy_set_header X-Real-IP $remote_addr; # Keep the client's real IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Keep the forwarded IP + proxy_set_header X-Forwarded-Proto $scheme; # Keep the request protocol + } + ``` + + ⚠️ If you are using such panel software, + please do not enable any form of caching in the reverse proxy settings of such panel software to avoid affecting the normal operation of the service. + Read more at https://github.com/lobehub/lobe-chat/discussions/5986 + + + ### Complete Remaining Configuration in Interactive Script + + In domain mode, you need to complete the following configurations based on script prompts: + + - Domain setup for the LobeChat service: `lobe.example.com` + - Domain setup for the Minio service: `minio.example.com` + - Domain setup for the Casdoor service: `auth.example.com` + - Choose the access protocol: `http` or `https` + - Regenerate secure keys: We highly recommend regenerating the secure keys; if you lack the key generation library required by the script, we suggest referring to the [Custom Deployment](#custom-deployment) section for key modifications. + + + The following issues may impede access to your service: + + - The domain configuration here must match the reverse proxy configuration in step `1`. + + - If you are using Cloudflare for domain resolution and have activated `full proxy`, please use the `https` protocol. + + - If you have used the HTTPS protocol, ensure that your domain certificate is correctly configured; one-click deployment does not support self-signed certificates by default. + + + ### Check Configuration Generation Report + + After the script finishes running, you need to check the configuration generation report, which includes the initial login password for the Casdoor administrator. + + + Please log in to LobeChat using the user account; the administrator account is only for managing Casdoor. + + + ```log + The results of the secure key generation are as follows: + LobeChat: + - URL: https://lobe.example.com + - Username: user + - Password: 837e26 + Casdoor: + - URL: https://auth.example.com + - Username: admin + - Password: 837e26 + Minio: + - URL: https://minio.example.com + - Username: admin + - Password: dbac8440 + ``` + + ### Start Docker + + ```sh + docker compose up -d + ``` + + ### Check Logs + + ```sh + docker logs -f lobe-chat + ``` + + If you see the following logs in the container, it indicates a successful startup: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: https://localhost:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### Access Application + + You can access your LobeChat service via `https://lobe.example.com`. The account credentials for the application can be found in the report from step `3`. + + + If your service can accessed via the public network, + we strongly recommend disabling the registration, + refer to the [documentation](https://lobehub.com/docs/self-hosting/advanced/auth/next-auth/casdoor) + for more information. + + -We provide a one-click startup script `setup.sh`, which can automatically use the default configuration and start the service: +## Custom Deployment + +This section mainly introduces the configurations that need to be modified to customize the deployment of the LobeChat service in different network environments. Before starting, you can download the [Docker Compose configuration file](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml) and the [environment variable configuration file](https://raw.githubusercontent.com/lobehub/lobe-chat/refs/heads/main/docker-compose/local/.env.example). ```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f +curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml +curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.en_US.example +mv .env.en_US.example .env ``` -### Start Docker + + This section does not cover all complete variables; remaining variables can be referenced in [Deploying with the Server Database](/en/docs/self-hosting/server-database). + -```sh -docker compose up -d +### Prerequisites + +Generally, to fully run the LobeChat database version, you will need at least the following four services: + +- The LobeChat database version itself +- PostgreSQL database with PGVector plugin +- Object storage service that supports S3 protocol +- An SSO authentication service supported by LobeChat + +These services can be combined through self-hosting or online cloud services to meet various deployment needs. In this article, we provide a Docker Compose configuration entirely based on open-source self-hosted services, which can be used directly to start the LobeChat database version or modified to suit your requirements. + +We use [MinIO](https://github.com/minio/minio) as the local S3 object storage service and [Casdoor](https://github.com/casdoor/casdoor) as the local authentication service by default. + + + If your network topology is complex, please make sure these services can communicate properly within your network environment. + + +### Necessary Configuration + +Now, we will introduce the necessary configurations for running these services: + +1. Casdoor + +- LobeChat requires communication with Casdoor, so you need to configure Casdoor's Issuer. + +```env +AUTH_CASDOOR_ISSUER=https://auth.example.com ``` -The default login account is the default account of Casdoor, with the username `admin` and password `123`. +This configuration will affect LobeChat's login authentication service, and you need to ensure that the URL of the Casdoor service is correct. You can find common manifestations and solutions for errors in this configuration in the [FAQ](#faq). -### Check Logs +- Additionally, you need to allow the callback URL in Casdoor to point to the LobeChat address: + +Please add a line in the `Authentication -> Application` -> `` -> `Redirect URI` in Casdoor's web panel: -```sh -docker logs -f lobe-chat +``` +https://auth.example.com/api/auth/callback/casdoor ``` -If you see the following logs in the container, it means the startup was successful: +- Casdoor needs to provide the Origin information for access in the environment variables: -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms +```env +origin=https://auth.example.com ``` - +2. MinIO + +- LobeChat needs to provide a public access URL for object files for the LLM service provider, hence you need to configure MinIO's Endpoint. + +```env +S3_PUBLIC_DOMAIN=https://minio.example.com +S3_ENDPOINT=https://minio.example.com +``` + +3. PostgreSQL -At this point, you have successfully deployed the LobeChat database version, and you can access your LobeChat service at `http://localhost:3210`. +This configuration is found in the `docker-compose.yml` file, and you will need to configure the database name and password: -If you encounter problems, try checking the Docker logs and console logs for troubleshooting. +```yaml +services: + lobe: + environment: + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' +``` -## Publishing to Production (IP Mode) +## FAQ -The following assumes that the machine IP running the LobeChat service on the LAN/public network is `your_server_ip`. +#### Unable to Log In Properly -To access via the local network IP, you first need to run the local startup: +Check for the following errors based on the container logs: ```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -docker compose up -d +docker logs -f lobe-chat ``` -Next, you need to modify the downloaded `docker-compose.yml` file, performing a global replacement to change `localhost` to `your_server_ip`, and then restart: +- r3: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code) -```sh -sed -i 's/localhost/your_server_ip/g' docker-compose.yml -docker compose up -d +```log +lobe-chat | [auth][error] r3: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code) ``` -### Configuring Casdoor +Cause: This issue is typically caused by improper reverse proxy configuration; you need to ensure your reverse proxy configuration does not intercept the Casdoor OAuth2 configuration requests. -1. After starting with the `setup.sh` script, the default port for Casdoor WebUI is `8000`. You can access it via `http://your_server_ip:8000`, with the default username `admin` and password `123`. +Solutions: -2. In `Identity -> Applications`, add a new line: +- Please refer to the reverse proxy configuration notes in the [Domain Mode](#domain-mode) section. - ``` - http://your_server_ip:3210/api/auth/callback/casdoor - ``` +- A direct troubleshooting method is to access `https://auth.example.com/.well-known/openid-configuration` directly; if: + - Non-JSON format data is returned, it indicates your reverse proxy configuration is incorrect. + - If the returned JSON format data contains an `"issuer": "URL"` field that does not match your configured `https://auth.example.com`, it indicates your environment variable configuration is incorrect. -3. Most other configurations can remain default; you can modify the default configurations in `Identity -> Applications`. +- TypeError: fetch failed -### Configuring MinIO S3 +```log +lobe-chat | [auth][error] TypeError: fetch failed +``` -1. After starting with the `setup.sh` script, the default port for MinIO WebUI is `9001`. You can access it via `http://your_server_ip:9001`, with the default username `YOUR_MINIO_USER` and password `YOUR_MINIO_PASSWORD`. +Cause: LobeChat cannot access the authentication service. -2. Most configurations can remain default. If you wish to allow users to change their avatars, you need to create a bucket named `casdoor` in `buckets`, select custom policy, and copy and paste the following content (if you have changed the bucket name, please find and replace): +Solutions: + +- Check whether your authentication service is running properly and whether LobeChat's network can reach the authentication service. + +- A straightforward troubleshooting method is to use the `curl` command in the LobeChat container terminal to access your authentication service at `https://auth.example.com/.well-known/openid-configuration`. If JSON format data is returned, it indicates your authentication service is functioning correctly. + +````markdown +## Extended Configuration + +To enhance your LobeChat service, you can perform the following extended configurations according to your needs. + +### Use MinIO to Store Casdoor Avatars + +Allow users to change their avatars in Casdoor. + +1. First, create a bucket named `casdoor` in `buckets`, select a custom policy, and copy and paste the content below (if you modify the bucket name, please find and replace accordingly). ```json { @@ -180,66 +478,103 @@ docker compose up -d ], "Version": "2012-10-17" } - ``` +```` -3. Create a new access key and store the generated `Access Key` and `Secret Key`. +2. Create a new access key and store the generated `Access Key` and `Secret Key`. -4. In Casdoor's `Identity -> Providers`, associate the MinIO S3 service. Here is a sample configuration: +3. In Casdoor's `Authentication -> Providers`, associate the MinIO S3 service. Below is an example configuration: ![casdoor](https://github.com/user-attachments/assets/71035610-0706-434e-9488-ab5819b55330) - The Client ID and Client Secret should be the `Access Key` and `Secret Key` from the previous step, and `192.168.31.251` should be replaced with `your_server_ip`. + Here, the client ID and client secret correspond to the `Access Key` and `Secret Key` from the previous step; replace `192.168.31.251` with `your_server_ip`. + +4. In Casdoor's `Authentication -> Apps`, add a provider to the `app-built-in` application, select `minio`, and save and exit. -5. In Casdoor's `Identity -> Applications`, add the provider to the `app-built-in` application, select `minio`, save and exit. +5. You can attempt to upload a file in Casdoor's `Authentication -> Resources` to test if the configuration is correct. -6. You can try uploading a file in Casdoor's `Identity -> Resources` to test if the configuration is correct. +### Migrating from `logto` to `Casdoor` in Production Deployment -## Publishing to Production (Domain Name Mode) +This is applicable for users who have been using `logto` as their login and authentication service in a production environment. - For deployments with a domain name, we recommend using [Logto](https://logto.io/) as the login - authentication service. The remainder of this article will use it as an example. If you use other - authentication services like Casdoor, the process should be similar, but note that different - authentication services may have different port configurations. + Due to significant instability when using [Logto](https://logto.io/) + as a login and authentication service, the following tutorial is based on deploying with an IP mode, implementing a domain release solution using Casdoor as the authentication service provider. + The remainder of this article will illustrate using this as an example. If you are using other login authentication services like Logto, the process should be similar, but be aware that port configurations may differ among different services. -In the following text, we assume that in addition to the above services, you are also running a layer of Nginx for reverse proxy and SSL configuration. +In the following, it is assumed that in addition to the above services, you are also running an **Nginx** layer for reverse proxy and SSL configuration. -The domain and associated service port descriptions are as follows: +The domain and corresponding service port descriptions are as follows: -- `lobe.example.com`: Your LobeChat service domain, which needs to reverse proxy to the LobeChat service port, defaulting to `3210`. -- `lobe-auth-api.example.com`: Your Logto service domain, which needs to reverse proxy to the Logto API service port, defaulting to `3001`. -- `lobe-auth-ui.example.com`: Your Logto UI domain, which needs to reverse proxy to the Logto WebUI service port, defaulting to `3002`. -- `lobe-s3-api.example.com`: Your MinIO API domain, which needs to reverse proxy to the MinIO API service port, defaulting to `9000`. -- `lobe-s3-ui.example.com`: Optional, your MinIO UI domain, which needs to reverse proxy to the MinIO WebUI service port, defaulting to `9001`. +- `lobe.example.com`: This is your LobeChat service domain, which needs to reverse proxy to the LobeChat service port, default is `3210`. +- `auth.example.com`: This is your Logto UI domain, which needs to reverse proxy to the Logto WebUI service port, default is `8000`. +- `minio.example.com`: This is your MinIO API domain, which needs to reverse proxy to the MinIO API service port, default is `9000`. +- `minio-ui.example.com`: Optional, this is your MinIO UI domain, which needs to reverse proxy to the MinIO WebUI service port, default is `9001`. -And the service ports that do not require reverse proxy: +#### Configuration File -- `postgresql`: Your PostgreSQL database service port, defaulting to `5432`. +```sh +bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN +docker compose up -d +``` - - Please note that CORS cross-domain is configured internally in MinIO / Logto services. Do not configure CORS additionally in your reverse proxy, as this will cause errors. +Make sure to save the newly generated password at this time! -For MinIO not on port 443, the Host must be `$http_host` (with port number), otherwise a 403 error will occur: `proxy_set_header Host $http_host`. +After running, you will get three files: -If you need to configure an SSL certificate, please configure it uniformly in the outer Nginx reverse proxy and not in MinIO. +- init\_data.json +- docker-compose.yml +- .env - +Next, modify the configuration files to achieve domain release. -### Configuration Files +1. Modify the `docker-compose.yml` file. + 1. Change the `MINIO_API_CORS_ALLOW_ORIGIN` field of `minio`. + ```yaml + 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' + ``` + 2. Modify the `origin` field of `casdoor`. + ```yaml + origin: 'https://auth.example.com' + ``` + 3. Modify the `environment` field of `lobe`. + ```yaml + # - 'APP_URL=http://localhost:3210' + - 'APP_URL=https://lobe.example.com' + + - 'NEXT_AUTH_SSO_PROVIDERS=casdoor' + - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=' + - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg' + # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth' + - 'AUTH_URL=https://lobe.example.com/api/auth' + + # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}' + - 'AUTH_CASDOOR_ISSUER=https://auth.example.com' + + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' + # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}' + - 'S3_ENDPOINT=https://minio.example.com' + + - 'S3_BUCKET=${MINIO_LOBE_BUCKET}' + # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}' + - 'S3_PUBLIC_DOMAIN=https://minio.example.com' + + - 'S3_ENABLE_PATH_STYLE=1' + - 'LLM_VISION_IMAGE_USE_BASE64=1' + ``` +2. Modify the `.env` file. + + + For security reasons, modify the ROOT USER field in the `.env` file. + ```sh -curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/logto/docker-compose.yml > docker-compose.yml -curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/logto/.env.example > .env +# MinIO S3 configuration +MINIO_ROOT_USER=XXXX +MINIO_ROOT_PASSWORD=XXXX ``` -The configuration files include both `.env` and `docker-compose.yml`, where the `.env` file is used to configure the environment variables for LobeChat, and the `docker-compose.yml` file is used to configure the Postgres, MinIO, and Logto services. - -Generally, you should only modify sensitive information such as domain names and account passwords, while keeping other configuration items at their default values. - -Refer to the appendix for example configurations. - -### Postgres Database Configuration +#### Postgres Database Configuration You can check the logs with the following command: @@ -248,13 +583,11 @@ docker logs -f lobe-chat ``` - In our official Docker image, database schema migration is automatically executed before starting - the image. Our official image promises stability in the automatic creation of tables from "empty - database -> complete tables." Therefore, we recommend that your database instance use an empty - table instance to avoid the hassle of manual table structure maintenance or migration. + In our official Docker images, automatic migration of the database schema is performed before starting the images. + Our official images guarantee the stability of "empty database -> complete tables" for automatic table creation. Therefore, we recommend your database instance use an empty table instance to avoid the trouble of manually maintaining table structure or migrations. -If you encounter issues when creating tables, you can try the following command to force remove the database container and restart: +If you encounter issues during table creation, you can try the following command to forcibly remove the database container and restart: ```sh docker compose down # Stop the service @@ -262,109 +595,59 @@ sudo rm -rf ./data # Remove mounted database data docker compose up -d # Restart ``` -### Login Authentication Service Configuration - -This article uses Logto as an example to explain the configuration process. If you are using other authentication service providers, please refer to their documentation for configuration. +#### Login Authentication Service Configuration - - Please remember to configure the CORS cross-domain settings for the corresponding login authentication service provider to ensure LobeChat can access the authentication service properly. - -In this article, you need to allow cross-domain requests from `https://lobe.example.com`. - - +You first need to access the WebUI for configuration: -You first need to visit the WebUI for configuration: +- If you have set up the reverse proxy as mentioned before, open `https://auth.example.com` +- Otherwise, after port mapping, open `http://localhost:8000` -- If you have configured the reverse proxy as mentioned earlier, open `https://lobe-auth-ui.example.com`. -- Otherwise, open `http://localhost:3002` after performing port mapping. +Log in to the admin account: -1. Register a new account; the first registered account will automatically become an administrator. +- The default username is admin. +- The default password is the random password generated when downloading the config file. If forgotten, you can find it in the `init_data.json` file. -2. In `Applications`, create a `Next.js (App Router)` application with any name. +After logging in, perform the following actions: -3. Set `Redirect URI` to `https://lobe.example.com/api/auth/callback/logto`, and `Post sign-out redirect URI` to `https://lobe.example.com/`. +1. In `User Management -> Organizations`, add a new organization with the name and display name `Lobe Users`. Keep the rest as default. +2. In `Authentication -> Apps`, add a new application. -4. Set `CORS allowed origins` to `https://lobe.example.com`. +- Name and display name should be `LobeChat`. +- Organization should be `Lobe Users`. +- Add a line in Redirect URLs as `https://lobe.example.com/api/auth/callback/casdoor`. +- Disable all login methods except password. +- Fill in the client ID and client secret in the `.env` file under `AUTH_CASDOOR_ID` and `AUTH_CASDOOR_SECRET`. +- (Optional) Design the appearance of the login and registration pages by mimicking the `built-in` application configuration. +- Save and exit. - Configuring Logto - -5. Obtain `App ID` and `App secrets`, and fill them into your `.env` file under `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET`. - -6. Set `AUTH_LOGTO_ISSUER` in your `.env` file to `https://lobe-auth-api.example.com/oidc`. - - Configuring Logto Environment Variables - -7. Optionally, in the left panel under `Sign-in experience`, you can disable `Enable user registration` in `Sign-up and sign-in - Advanced Options` to prevent users from registering on their own. If you disable user registration, you will need to manually add users in the left panel under `User Management`. - - Disable User Registration - -8. Restart the LobeChat service: - - ```sh - docker compose up -d - ``` - - - Please note that the administrator account is not the same as a registered user. Do not log in to - LobeChat with your administrator account, as this will only result in an error. + + Following the steps above ensures that not all users are administrators by default, leading to an unsafe situation. -### S3 Object Storage Service Configuration +#### S3 Object Storage Service Configuration -This article uses MinIO as an example to explain the configuration process. If you are using other S3 service providers, please refer to their documentation for configuration. +This article uses MinIO as an example to explain the configuration process. If you are using another S3 service provider, please refer to their documentation for configuration. - Please remember to configure the CORS cross-domain settings for the corresponding S3 service provider to ensure LobeChat can access the S3 service properly. + Please remember to configure the corresponding S3 service provider's CORS settings to ensure that LobeChat can access the S3 service correctly. -In this article, you need to allow cross-domain requests from `https://lobe.example.com`. This can be configured in MinIO WebUI under `Configuration - API - Cors Allow Origin`, or in the Docker Compose under `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN`. - -If you use the second method (which is also the default method) for configuration, you will not be able to configure it in MinIO WebUI anymore. + In this document, you need to allow cross-origin requests from `https://lobe.example.com`. This can either be configured in MinIO WebUI under `Configuration - API - Cors Allow Origin`, or in the Docker Compose configuration under `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN`. + If you use the second method (which is also the default), you will no longer be able to configure it in the MinIO WebUI. -You first need to visit the WebUI for configuration: - -- If you have configured the reverse proxy as mentioned earlier, open `https://lobe-s3-ui.example.com`. -- Otherwise, open `http://localhost:9001` after performing port mapping. - -1. Enter your set `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD` on the login page, then click login. - -2. In the left panel under Administer / Buckets, click `Create Bucket`, enter `lobe` (which corresponds to your `S3_BUCKET` environment variable), and then click `Create`. - - Create MinIO Bucket - -3. Select your bucket, click Summary - Access Policy, edit, choose `Custom`, input the content from `minio-bucket-config.json` (see appendix), and save (assuming your bucket name is `lobe`): +You first need to access the WebUI for configuration: - Select MinIO Bucket Policy +- If you have set up the reverse proxy as mentioned before, open `https://minio-ui.example.com` +- Otherwise, after port mapping, open `http://localhost:9001` - Configure MinIO Bucket Policy +1. Enter the `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD` you set in the login interface, then click login. -4. In the left panel under User / Access Keys, click `Create New Access Key`, without any extra modifications, and fill the generated `Access Key` and `Secret Key` into your `.env` file under `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. +2. In the left panel under User / Access Keys, click `Create New Access Key`, no additional modifications needed, and fill the generated `Access Key` and `Secret Key` into your `.env` file under `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. - Create MinIO Access Key + Create MinIO Access Key -5. Restart the LobeChat service: +3. Restart the LobeChat service: ```sh docker compose up -d @@ -372,76 +655,65 @@ You first need to visit the WebUI for configuration: At this point, you have successfully deployed the LobeChat database version, and you can access your LobeChat service at `https://lobe.example.com`. -## Appendix +#### Configuration Files -For convenience, here is a summary of the example configuration files needed for deploying the server database in domain name mode (for local quick start, local IP access, etc., please directly use the `setup.sh` script to generate and modify it yourself): +For convenience, here is a summary of example configuration files required for the production deployment using the Casdoor authentication scheme: -### `.env` +- `.env` ```sh -# Required: LobeChat domain for tRPC calls -# Ensure this domain is whitelisted in your NextAuth providers and S3 service CORS settings -APP_URL=https://lobe.example.com/ - -# Postgres related environment variables -# Required: Secret key for encrypting sensitive information. Generate with: openssl rand -base64 32 -KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ= -# Required: Postgres database connection string -# Format: postgresql://username:password@host:port/dbname -# If using Docker, you can use the container name as the host -DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe - -# NEXT_AUTH related environment variables -# Supports auth0, Azure AD, GitHub, Authentik, Zitadel, Logto, etc. -# For supported providers, see: https://lobehub.com/docs/self-hosting/advanced/auth#next-auth -# If you have ACCESS_CODE, please remove it. We use NEXT_AUTH as the sole authentication source -# Required: NextAuth secret key. Generate with: openssl rand -base64 32 -NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg -# Required: Specify the authentication provider (e.g., Logto) -NEXT_AUTH_SSO_PROVIDERS=logto -# Required: NextAuth URL for callbacks -NEXTAUTH_URL=https://lobe.example.com/api/auth - -# NextAuth providers configuration (example using Logto) -# For other providers, see: https://lobehub.com/docs/self-hosting/environment-variables/auth -AUTH_LOGTO_ID=YOUR_LOGTO_ID -AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET -AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc - -# Proxy settings (if needed, e.g., when using GitHub as an auth provider) +# Proxy, if you need it # HTTP_PROXY=http://localhost:7890 # HTTPS_PROXY=http://localhost:7890 -# S3 related environment variables (example using MinIO) -# Required: S3 Access Key ID (for MinIO, invalid until manually created in MinIO UI) -S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID -# Required: S3 Secret Access Key (for MinIO, invalid until manually created in MinIO UI) -S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY -# Required: S3 Endpoint for server/client connections to S3 API -S3_ENDPOINT=https://lobe-s3-api.example.com -# Required: S3 Bucket (invalid until manually created in MinIO UI) -S3_BUCKET=lobe -# Required: S3 Public Domain for client access to unstructured data -S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com -# Optional: S3 Enable Path Style -# Use 0 for mainstream S3 cloud providers; use 1 for self-hosted MinIO -# See: https://lobehub.com/docs/self-hosting/advanced/s3#s-3-enable-path-style -S3_ENABLE_PATH_STYLE=1 - -# Other basic environment variables (as needed) -# See: https://lobehub.com/docs/self-hosting/environment-variables/basic -# Note: For server versions, the API must support embedding models (OpenAI text-embedding-3-small) for file processing -# You don't need to specify this model in OPENAI_MODEL_LIST +# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. # OPENAI_API_KEY=sk-xxxx # OPENAI_PROXY_URL=https://api.openai.com/v1 # OPENAI_MODEL_LIST=... + +# =========================== +# ====== Preset config ====== +# =========================== +# if no special requirements, no need to change +LOBE_PORT=3210 +CASDOOR_PORT=8000 +MINIO_PORT=9000 + +# Postgres related, which are the necessary environment variables for DB +LOBE_DB_NAME=lobechat +POSTGRES_PASSWORD=uWNZugjBqixf8dxC + +# Casdoor secret +AUTH_CASDOOR_ID=943e627d79d5dd8a22a1 +AUTH_CASDOOR_SECRET=6ec24ac304e92e160ef0d0656ecd86de8cb563f1 + +# MinIO S3 configuration +MINIO_ROOT_USER=Joe +MINIO_ROOT_PASSWORD=Crj1570768 + +# Configure the bucket information of MinIO +MINIO_LOBE_BUCKET=lobe +S3_ACCESS_KEY_ID=dB6Uq9CYZPdWSZouPyEd +S3_SECRET_ACCESS_KEY=aPBW8CVULkh8bw1GatlT0GjLihcXHLNwRml4pieS ``` -### `docker-compose.yml` +- `docker-compose.yml` ```yaml name: lobe-chat-database services: + network-service: + image: alpine + container_name: lobe-network + ports: + - '${MINIO_PORT}:${MINIO_PORT}' # MinIO API + - '9001:9001' # MinIO Console + - '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor + - '${LOBE_PORT}:3210' # LobeChat + command: tail -f /dev/null + networks: + - lobe-network + postgresql: image: pgvector/pgvector:pg16 container_name: lobe-postgres @@ -450,57 +722,87 @@ services: volumes: - './data:/var/lib/postgresql/data' environment: - - 'POSTGRES_DB=lobe' - - 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC' + - 'POSTGRES_DB=${LOBE_DB_NAME}' + - 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}' healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 5s timeout: 5s retries: 5 restart: always + networks: + - lobe-network minio: image: minio/minio container_name: lobe-minio - ports: - - '9000:9000' - - '9001:9001' + network_mode: 'service:network-service' volumes: - './s3_data:/etc/minio/data' environment: - - 'MINIO_ROOT_USER=YOUR_MINIO_USER' - - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD' - - 'MINIO_DOMAIN=lobe-s3-api.example.com' - - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat's domain name. + - 'MINIO_ROOT_USER=${MINIO_ROOT_USER}' + - 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}' + # - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:${LOBE_PORT}' + - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' restart: always command: > - server /etc/minio/data --address ":9000" --console-address ":9001" + server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001" - logto: - image: svhd/logto - container_name: lobe-logto - ports: - - '3001:3001' - - '3002:3002' + casdoor: + image: casbin/casdoor + container_name: lobe-casdoor + entrypoint: /bin/sh -c './server --createDatabase=true' + network_mode: 'service:network-service' depends_on: postgresql: condition: service_healthy environment: - - 'TRUST_PROXY_HEADER=1' - - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto' - - 'ENDPOINT=https://lobe-auth-api.example.com' - - 'ADMIN_ENDPOINT=https://lobe-auth-ui.example.com' - entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start'] + RUNNING_IN_DOCKER: 'true' + driverName: 'postgres' + dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor' + # origin: 'http://localhost:${CASDOOR_PORT}' + origin: 'https://auth.example.com' + runmode: 'dev' + volumes: + - ./init_data.json:/init_data.json lobe: image: lobehub/lobe-chat-database - container_name: lobe-chat - ports: - - '3210:3210' + container_name: lobe-chat-database + network_mode: 'service:network-service' depends_on: - - postgresql - - minio - - logto + postgresql: + condition: service_healthy + network-service: + condition: service_started + minio: + condition: service_started + casdoor: + condition: service_started + + environment: + # - 'APP_URL=http://localhost:3210' + - 'APP_URL=https://lobe.example.com' + + - 'NEXT_AUTH_SSO_PROVIDERS=casdoor' + - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=' + - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg' + # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth' + - 'AUTH_URL=https://lobe.example.com/api/auth' + + # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}' + - 'AUTH_CASDOOR_ISSUER=https://auth.example.com' + + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' + # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}' + - 'S3_ENDPOINT=https://minio.example.com' + + - 'S3_BUCKET=${MINIO_LOBE_BUCKET}' + # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}' + - 'S3_PUBLIC_DOMAIN=https://minio.example.com' + + - 'S3_ENABLE_PATH_STYLE=1' + - 'LLM_VISION_IMAGE_USE_BASE64=1' env_file: - .env restart: always @@ -510,45 +812,10 @@ volumes: driver: local s3_data: driver: local -``` -### `minio-bucket-config.json` - -```json -{ - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:GetBucketLocation"], - "Resource": ["arn:aws:s3:::lobe"] - }, - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:ListBucket"], - "Resource": ["arn:aws:s3:::lobe"], - "Condition": { - "StringEquals": { - "s3:prefix": ["files/*"] - } - } - }, - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:PutObject", "s3:DeleteObject", "s3:GetObject"], - "Resource": ["arn:aws:s3:::lobe/files/**"] - } - ], - "Version": "2012-10-17" -} +networks: + lobe-network: + driver: bridge ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database diff --git a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx index 9f28b74ac0130..8cde5595d8a42 100644 --- a/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +++ b/docs/self-hosting/server-database/docker-compose.zh-CN.mdx @@ -13,26 +13,317 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
+ + **Docker 部署限制说明** + Docker 及 Docker Compose 部署方案不支持通过环境变量注入 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, + 因此无法启用 Clerk 身份验证服务。建议替代方案: + + - 采用 Vercel 托管部署 + + - 执行本地镜像构建流程 + + +## 快速启动 + - 本文已经假定你了解了 LobeChat 服务端数据库版本(下简称 DB - 版)的部署基本原理和流程,因此只包含核心环境变量配置的内容。如果你还不了解 LobeChat DB - 版的部署原理,请先查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。 + **系统兼容性说明** + + - 支持 Unix 环境(Linux/macOS)的一键部署 + + - Windows 用户需通过 [WSL 2](https://aka.ms/wsl) 运行 + + - 一键启动脚本为首次部署专用,非首次部署请参考 [自定义部署](#自定义部署) 章节 + + - 端口占用检查:确保 `3210`、`8000`、`9000`、`9001` 端口可用 - - 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose - 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。 +执行以下命令初始化部署环境,目录 `lobe-chat-db` 将用于存放你的配置文件和后续的数据库文件。 + +```sh +mkdir lobe-chat-db && cd lobe-chat-db +``` -如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 +获取并执行部署脚本: +```sh +bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN +``` + +脚本支持以下部署模式,请根据你的需求选择相应的模式,并继续阅读文档的剩余部分。 + +- [本地模式(默认)](#本地模式):仅能在本地访问,不支持局域网 / 公网访问,适用于初次体验; +- [端口模式](#端口模式):支持局域网 / 公网的 `http` 访问,适用于无域名或内部办公场景使用; +- [域名模式](#域名模式):支持局域网 / 公网在使用反向代理下的 `http/https` 访问,适用于个人或团队日常使用; + + + 在脚本的选项提示 `(选项1/选项2)[选项1]` 中:`(选项1 / 选项2)` 代表可以选择的选项,`[选项1]`代表默认选项,直接回车即可选择默认选项。 +### 本地模式 + + + ### 在交互式脚本中完成剩余配置 + + 持续回车采用默认配置。 + + ### 查看配置生成报告 + + 你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的帐号、用户账号和它们的初始登录密码。 + + + 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。 + + + ```log + 安全密钥生成结果如下: + LobeChat: + - URL: http://localhost:3210 + - Username: user + - Password: c66f8c + Casdoor: + - URL: http://localhost:8000 + - Username: admin + - Password: c66f8c + Minio: + - URL: http://localhost:9000 + - Username: admin + - Password: 8c82ea41 + ``` + + ### 启动 Docker + + ```sh + docker compose up -d + ``` + + ### 检查日志 + + ```sh + docker logs -f lobe-chat + ``` + + 如果你在容器中看到了以下日志,则说明已经启动成功: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### 访问应用 + + 通过 [http://localhost:3210](http://localhost:3210) 访问你的 LobeChat 服务。 + 应用的账号密码在步骤`2`的报告中。 + + +### 端口模式 + + + ### 在交互式脚本中完成剩余配置 + + 在端口模式中,你需要根据脚本提示完成: + + - 服务器 IP 地址设置:以便局域网 / 公网访问。 + - 安全密钥重新生成:我们强烈建议你重新生成安全密钥,如果你缺少脚本所需的密钥生成库,我们建议你参考 [自定义部署](#自定义部署) 章节对密钥进行修改。 + + ### 查看配置生成报告 + + 你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的帐号、用户账号和它们的初始登录密码。 + + + 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。 + + + ```log + 安全密钥生成结果如下: + LobeChat: + - URL: http://your_server_ip:3210 + - Username: user + - Password: 837e26 + Casdoor: + - URL: http://your_server_ip:8000 + - Username: admin + - Password: 837e26 + Minio: + - URL: http://your_server_ip:9000 + - Username: admin + - Password: dbac8440 + ``` + + ### 启动 Docker + + ```sh + docker compose up -d + ``` + + ### 检查日志 + + ```sh + docker logs -f lobe-chat + ``` + + 如果你在容器中看到了以下日志,则说明已经启动成功: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://your_server_ip:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### 访问应用 + + 你可以通过 `http://your_server_ip:3210` 访问你的 LobeChat 服务。 + 应用的账号密码在步骤`2`的报告中。 + + + 请注意,如果你的服务能够被公网访问,我们强烈建议你参考 [文档](https://lobehub.com/docs/self-hosting/advanced/auth/next-auth/casdoor) 关闭注册功能。 + + + +### 域名模式 + + + ### 完成反向代理配置 + + 在域名模式中,你需要完成反向代理配置,并确保局域网 / 公网能访问到以下服务。请使用反向代理将以下服务端口映射到域名: + + | 域名 | 反代端口 | 是否必选 | + | ---------------------- | ------ | ---- | + | `lobe.example.com` | `3210` | 必选 | + | `auth.example.com` | `8000` | 必选 | + | `minio.example.com` | `9000` | 必选 | + | `minio-ui.example.com` | `9001` | | + + + 如果你使用如 [宝塔面板](https://www.bt.cn/) 等面板软件进行反向代理配置, + 你需要确保其对 `.well-known` 路径的请求不进行拦截,以确保 Casdoor 的 OAuth2 配置能够正常工作。 + 这里提供一份针对 Casdoor 服务的 Nginx server 块的路径白名单配置: + + ```nginx + location /.well-known/openid-configuration { + proxy_pass http://localhost:8000; # 转发到 localhost:8000 + proxy_set_header Host $host; # 保留原始主机头 + proxy_set_header X-Real-IP $remote_addr; # 保留客户端真实IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 保留转发的IP + proxy_set_header X-Forwarded-Proto $scheme; # 保留请求协议 + } + ``` + + ⚠️ 请不要在此类面板软件的反向代理设置中开启任何形式的缓存,以免影响服务的正常运行。 + 详情请见 [https://github.com/lobehub/lobe-chat/discussions/5986](https://github.com/lobehub/lobe-chat/discussions/5986) + + + ### 在交互式脚本中完成剩余配置 + + 在域名模式中,你需要根据脚本提示完成: + + - LobeChat 服务的域名设置:`lobe.example.com` + - Minio 服务的域名设置:`minio.example.com` + - Casdoor 服务的域名设置:`auth.example.com` + - 选择访问协议:`http` 或 `https` + - 安全密钥重新生成:我们强烈建议你重新生成安全密钥,如果你缺少脚本所需的密钥生成库,我们建议你参考 [自定义部署](#自定义部署) 章节对密钥进行修改。 + + + 以下问题可能导致你的服务无法正常访问: + + - 此处的域名配置需要与步骤`1`中的反向代理配置保持一致。 + + - 如果你使用 Cloudflare 的域名解析服务并开启了 `全程代理`,请使用 `https` 协议。 + + - 如果你使用了 HTTPS 协议,请确保你的域名证书已经正确配置,一键部署默认不支持自签发证书。 + + + ### 查看配置生成报告 + + 你需要在脚本运行结束后查看配置生成报告,包括 Casdoor 管理员的初始登录密码。 + + + 请使用用户账号登录 LobeChat,管理员账号仅用于管理 Casdoor。 + + + ```log + 安全密钥生成结果如下: + LobeChat: + - URL: https://lobe.example.com + - Username: user + - Password: 837e26 + Casdoor: + - URL: https://auth.example.com + - Username: admin + - Password: 837e26 + Minio: + - URL: https://minio.example.com + - Username: admin + - Password: dbac8440 + ``` + + ### 启动 Docker + + ```sh + docker compose up -d + ``` + + ### 检查日志 + + ```sh + docker logs -f lobe-chat + ``` + + 如果你在容器中看到了以下日志,则说明已经启动成功: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: https://localhost:3210 + - Network: http://0.0.0.0:3210 + ✓ Starting... + ✓ Ready in 95ms + ``` + + ### 访问应用 + + 你可以通过 `https://lobe.example.com` 访问你的 LobeChat 服务。应用的账号密码在步骤`3`的报告中。 + + + 请注意,如果你的服务能够被公网访问,我们强烈建议你参考 [文档](https://lobehub.com/docs/self-hosting/advanced/auth/next-auth/casdoor) 关闭注册功能。 + + + +## 自定义部署 + +该章节主要为你介绍在不同的网络环境下自定义部署 LobeChat 服务必须要修改的配置。 +在开始前,你可以先下载 [Docker Compose 配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml) 以及 [环境变量配置文件](https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.zh-CN.example)。 + +```sh +curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/docker-compose.yml +curl -O https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/.env.zh-CN.example +mv .env.zh-CN.example .env +``` + + + 本章节并不包含所有完整变量,剩余的变量可以查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database) 。 + + +### 预备知识 + 一般来讲,想要完整的运行 LobeChat 数据库版本,你需要至少拥有如下四个服务 - LobeChat 数据库版本自身 @@ -41,105 +332,112 @@ tags: - 受 LobeChat 支持的 SSO 登录鉴权服务 这些服务可以通过自建或者在线云服务组合搭配,以满足不同层次的部署需求。 - 本文中,我们提供了完全基于开源自建服务的 Docker Compose 配置,你可以直接使用这份配置文件来启动 LobeChat 数据库版本,也可以对之进行修改以适应你的需求。 我们默认使用 [MinIO](https://github.com/minio/minio) 作为本地 S3 对象存储服务,使用 [Casdoor](https://github.com/casdoor/casdoor) 作为本地鉴权服务。 -## 快速启动 - -为方便快速上手,这一章使用 `docker-compose/local` 目录中的 `docker-compose.yml` 配置文件,启动后的 LobeChat 应用运行在 `http://localhost:3210`,可在本地运行。 - - 为了快速上手,此 `docker-compose.yml` 内置了大量的 Secret/Password - 的敏感字段配置,仅适用于快速演示或个人本地使用。请勿直接用于线上生产环境!否则遇到安全问题请自行负责! + 如果你的网络拓扑较为复杂,请先确保在你的网络环境中这些服务能够正常通讯。 - - ### 一键启动脚本 +### 必要配置 -新建一个 `lobe-chat-db` 目录,用于存放你的配置文件和后续的数据库文件。 +以下我们将介绍运行这些服务的必要配置: -```sh -mkdir lobe-chat-db -cd lobe-chat-db +1. Casdoor + +- LobeChat 需要与 Casdoor 通讯,因此你需要配置 Casdoor 的 Issuer 。 + +```env +AUTH_CASDOOR_ISSUER=https://auth.example.com ``` -我们提供了一个一键启动脚本 `setup.sh`,可以自动使用默认配置并启动服务: +该配置会影响 LobeChat 的登录鉴权服务,你需要确保 Casdoor 服务的地址正确。 +你可以在 [常见问题](#常见问题) 中找到该配置错误的常见现象及解决方案。 -```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN +- 同时,你也需要在 Casdoor 中允许回调地址为 LobeChat 的地址: + +请在 Casdoor 的 Web 面板的 `身份认证 -> 应用` -> `<应用ID,默认为 app-built-in>` -> `重定向URL` 中添加一行: + +``` +https://auth.example.com/api/auth/callback/casdoor ``` -### 启动 Docker +- Casdoor 需要在环境变量中提供访问的 Origin 信息: -```sh -docker compose up -d +```env +origin=https://auth.example.com +``` + +2. MinIO + +- LobeChat 需要为 LLM 服务提供商提供文件对象的公网访问地址,因此你需要配置 MinIO 的 Endpoint 。 + +```env +S3_PUBLIC_DOMAIN=https://minio.example.com +S3_ENDPOINT=https://minio.example.com ``` -默认登录账号即 Casdoor 的默认账号,账号名 `admin`,密码 `123` +3. PostgreSQL -### 检查日志 +该配置位于 `docker-compose.yml` 文件中,你需要配置数据库的名称和密码: + +```yaml +services: + lobe: + environment: + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' +``` + +## 常见问题 + +#### 无法正常登陆 + +请根据容器日志检查是否存在以下错误 ```sh docker logs -f lobe-chat ``` -如果你在容器中看到了以下日志,则说明已经启动成功: +- r3: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code) ```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms +lobe-chat | [auth][error] r3: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code) ``` - - -至此,你已经成功部署了 LobeChat 数据库版本,你可以通过 `http://localhost:3210` 访问你的 LobeChat 服务。 +成因:该问题一般是由于你的反向代理配置不正确导致的,你需要确保你的反向代理配置不会拦截 Casdoor 的 OAuth2 配置请求。 -如果你遇到问题,请尝试查看 Docker 日志和控制台日志进行排查。 +解决方案: -## 发布到生产(IP 模式) +- 请参考 [域名模式](#域名模式) 章节中的反向代理配置注意事项。 -下文假设局域网 / 公网需要运行 LobeChat 服务的机器 IP 为 `your_server_ip`。 +- 一个直接的排查方式,你可以直接访问 `https://auth.example.com/.well-known/openid-configuration`,如果 + - 返回了非 JSON 格式的数据,则说明你的反向代理配置错误。 + - 如果返回的 JSON 格式数据中的 `"issuer": "URL"` 字段不是你配置的 `https://auth.example.com`,则说明你的环境变量配置错误。 -想要通过局域网 IP 访问,你需要首先按照本地启动运行: +- TypeError: fetch failed -```sh -bash <(curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/local/setup.sh) -f -l zh_CN -docker compose up -d +```log +lobe-chat | [auth][error] TypeError: fetch failed ``` -接着,你需要修改下载下来的 `docker-compose.yml` 文件,执行一次全文替换,将 `localhost` 替换为 `your_server_ip`,随后重新启动: - -```sh -sed -i 's/localhost/your_server_ip/g' docker-compose.yml -docker compose up -d -``` +成因:LobeChat 无法访问鉴权服务。 -### 配置 Casdoor +解决方案: -1. 使用 `setup.sh` 脚本启动后,Casdoor WebUI 默认端口为 `8000`,你可以通过 `http://your_server_ip:8000` 访问,默认用户名 `admin`,密码 `123` +- 请检查你的鉴权服务是否正常运行,以及 LobeChat 所在的网络是否能够访问到鉴权服务。 -2. 在 `身份认证 -> 应用` 中添加一行 +- 一个直接的排查方式,你可以在 LobeChat 容器的终端中,使用 `curl` 命令访问你的鉴权服务 `https://auth.example.com/.well-known/openid-configuration`,如果返回了 JSON 格式的数据,则说明你的鉴权服务正常运行。 - ``` - http://your_server_ip:3210/api/auth/callback/casdoor - ``` +## 拓展配置 -3. 其他配置大多保持默认即可,你也可以在 `身份认证 -> 应用` 中修改默认配置 +为了完善你的 LobeChat 服务,你可以根据你的需求进行以下拓展配置。 -### 配置 MinIO S3 +### 使用 MinIO 存储 Casdoor 头像 -1. 使用 `setup.sh` 脚本启动后,MinIO WebUI 默认端口为 `9001`,你可以通过 `http://your_server_ip:9001` 访问,默认用户名 `YOUR_MINIO_USER`,密码 `YOUR_MINIO_PASSWORD` +允许用户在 Casdoor 中更换头像 -2. 大多数配置保持默认即可,如果你希望能允许用户更换头像功能,你需要首先在 `buckets` 中创建一个名为 `casdoor` 的桶,选择自定义策略,复制并粘贴如下内容(如果你修改了桶名,请自行查找替换) +1. 你需要首先在 `buckets` 中创建一个名为 `casdoor` 的桶,选择自定义策略,复制并粘贴如下内容(如果你修改了桶名,请自行查找替换) ```json { @@ -178,63 +476,103 @@ docker compose up -d } ``` -3. 创建一个新的访问密钥,将生成的 `Access Key` 和 `Secret Key` 存储之 +2. 创建一个新的访问密钥,将生成的 `Access Key` 和 `Secret Key` 存储之 -4. 在 Casdoor 的 `身份认证 -> 提供商` 中关联 MinIO S3 服务,以下是一个示例配置: +3. 在 Casdoor 的 `身份认证 -> 提供商` 中关联 MinIO S3 服务,以下是一个示例配置: ![casdoor](https://github.com/user-attachments/assets/71035610-0706-434e-9488-ab5819b55330) 其中,客户端 ID、客户端密钥为上一步创建的访问密钥中的 `Access Key` 和 `Secret Key`,`192.168.31.251` 应当被替换为 `your_server_ip`。 -5. 在 Casdoor 的 `身份认证 -> 应用` 中,对 `app-built-in` 应用添加提供商,选择 `minio`,保存并退出 +4. 在 Casdoor 的 `身份认证 -> 应用` 中,对 `app-built-in` 应用添加提供商,选择 `minio`,保存并退出 -6. 你可以在 Casdoor 的 `身份认证 -> 资源` 中,尝试上传文件以测试配置是否正确 +5. 你可以在 Casdoor 的 `身份认证 -> 资源` 中,尝试上传文件以测试配置是否正确 -## 发布到生产(域名模式) +### 生产部署下从 `logto` 迁移至 `Casdoor` + +适用于已经在生产环境下使用 `logto` 作为登录鉴权服务的用户 - 对于拥有域名的部署,我们推荐使用 [Logto](https://logto.io/) - 作为登录鉴权服务。本文剩余部分也将以其为例进行说明。如果你使用其他诸如 Casdoor + 由于使用[Logto](https://logto.io/) + 作为登录鉴权服务存在比较大的不稳定性。 + 因此,下文基于发布到 IP 模式的教程,实现了使用 Casdoor 作为鉴权服务提供商的域名发布方案。 + 本文剩余部分也将以其为例进行说明。如果你使用其他诸如 Logto 等其他登录鉴权服务,流程应当相近,但请注意不同的登录鉴权服务的端口配置可能有所差异。 -在下文中,我们假设在上述服务之外,你还运行了一层 Nginx 来进行反向代理、配置 SSL。 +在下文中,我们假设在上述服务之外,你还运行了一层 **Nginx** 来进行反向代理、配置 SSL。 域名和配套服务端口说明如下: - `lobe.example.com`:为你的 LobeChat 服务端域名,需要反向代理到 LobeChat 服务端口,默认为 `3210` -- `lobe-auth-api.example.com`:为你的 Logto 服务端域名,需要反向代理到 Logto API 服务端口,默认为 `3001` -- `lobe-auth-ui.example.com`:为你的 Logto UI 域名,需要反向代理到 Logto WebUI 服务端口,默认为 `3002` -- `lobe-s3-api.example.com`:为你的 MinIO API 域名,需要反向代理到 MinIO API 服务端口,默认为 `9000` -- `lobe-s3-ui.example.com`:可选,为你的 MinIO UI 域名,需要反向代理到 MinIO WebUI 服务端口,默认为 `9001` +- `auth.example.com`:为你的 Logto UI 域名,需要反向代理到 Logto WebUI 服务端口,默认为 `8000` +- `minio.example.com`:为你的 MinIO API 域名,需要反向代理到 MinIO API 服务端口,默认为 `9000` +- `minio-ui.example.com`:可选,为你的 MinIO UI 域名,需要反向代理到 MinIO WebUI 服务端口,默认为 `9001` -以及不进行反向代理的服务端口: +#### 配置文件 -- `postgresql`:你的 PostgreSQL 数据库服务端口,默认为 `5432` +```sh +bash <(curl -fsSL https://lobe.li/setup.sh) -l zh_CN +docker compose up -d +``` - - 请务必注意,CORS 跨域是在 MinIO / Logto 服务端内部配置的,请勿在你的反向代理中额外配置 CORS,这会导致错误。 +注意保存此时生成的新密码! -对于 minio 非 443 端口时,Host 必须是 `$http_host`(带端口号),否则会 403 错误:`proxy_set_header Host $http_host`。 +运行后会获得三个文件 -如果你需要配置 SSL 证书,请统一在外层的 Nginx 反向代理中配置,而不是在 MinIO 中配置。 +- init\_data.json +- docker-compose.yml +- .env - +接下来,修改配置文件以实现域名发布 -### 配置文件 +1. 修改 `docker-compose.yml` 文件 + 1. 修改 `minio`的`MINIO_API_CORS_ALLOW_ORIGIN`字段。 + ```yaml + 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' + ``` + 2. 修改`casdoor`的`origin`字段。 + ```yaml + origin: 'https://auth.example.com' + ``` + 3. 修改`lobe`的`environment`字段。 + ```yaml + # - 'APP_URL=http://localhost:3210' + - 'APP_URL=https://lobe.example.com' + + - 'NEXT_AUTH_SSO_PROVIDERS=casdoor' + - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=' + - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg' + # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth' + - 'AUTH_URL=https://lobe.example.com/api/auth' + + # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}' + - 'AUTH_CASDOOR_ISSUER=https://auth.example.com' + + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' + # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}' + - 'S3_ENDPOINT=https://minio.example.com' + + - 'S3_BUCKET=${MINIO_LOBE_BUCKET}' + # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}' + - 'S3_PUBLIC_DOMAIN=https://minio.example.com' + + - 'S3_ENABLE_PATH_STYLE=1' + - 'LLM_VISION_IMAGE_USE_BASE64=1' + ``` +2. 修改 `.env` 文件 + + + 为了安全起见,修改 `.env` 文件中的 ROOT USER 的字段 + ```sh -curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/logto/docker-compose.yml > docker-compose.yml -curl -fsSL https://raw.githubusercontent.com/lobehub/lobe-chat/HEAD/docker-compose/production/logto/.env.zh-CN.example > .env +# MinIO S3 configuration +MINIO_ROOT_USER=XXXX +MINIO_ROOT_PASSWORD=XXXX ``` -配置文件包括 `.env` 和 `docker-compose.yml` 两个文件,其中 `.env` 文件用于配置 LobeChat 的环境变量,`docker-compose.yml` 文件用于配置 Postgres、MinIO 和 Logto 服务。 - -一般情况下,你只应修改其中的域名和账号密码等敏感信息,其他配置项请按照默认值进行配置。 - -它们的示例配置请参见本文附录。 - -### Postgres 数据库配置 +#### Postgres 数据库配置 你可以使用下述指令检查日志: @@ -257,108 +595,59 @@ sudo rm -rf ./data # 移除挂载的数据库数据 docker compose up -d # 重新启动 ``` -### 登录鉴权服务配置 - -本文以 Logto 为例,解释配置过程,如果你使用的是其他登录鉴权服务商,请参照其文档进行配置。 - - - 请记得注意配置对应登录鉴权服务提供商的 CORS 跨域配置,以确保 LobeChat 能够正常访问登录鉴权服务。 - -在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。 - - +#### 登录鉴权服务配置 你需要首先访问 WebUI 来进行配置: -- 如果你按照前文配置了反向代理,打开 `https://lobe-auth-ui.example.com` -- 否则,请在进行端口映射后,打开 `http://localhost:3002` - -1. 注册一个新账户,首个注册的账户将自动成为管理员 - -2. 在 `Applications` 里创建一个 `Next.js (App Router)` 应用,名称随意 - -3. 配置 `Redirect URI` 为 `https://lobe.example.com/api/auth/callback/logto`,`Post sign-out redirect URI` 为 `https://lobe.example.com/` - -4. 配置 `CORS allowed origins` 为 `https://lobe.example.com` - - 配置 Logto +- 如果你按照前文配置了反向代理,打开 `https://auth.example.com` +- 否则,请在进行端口映射后,打开 `http://localhost:8000` -5. 获取 `App ID` 和 `App secrets`,填入你的 `.env` 文件中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET` 中 +登录管理员账户 -6. 配置你的 `.env` 文件中 `AUTH_LOGTO_ISSUER` 为 `https://lobe-auth-api.example.com/oidc` +- 默认用户名为 admin +- 默认密码为 下载配置文件时生成的随机密码。如忘记可到 `init_data.json` 文件中找回 - 配置 Logto 环境变量 +登入后执行如下操作 -7. 可选,在左侧 `Sign-in experience` 面板的 `Sign-up and sign-in - Advanced Options` 中关闭 `Enable user registration`,禁止用户自行注册。如果你禁止了用户自行注册,那么你只能在左侧 `User Management` 里手动添加用户。 +1. 在 `用户管理 -> 组织` 中,添加一个新的组织。名称与显示名称为 `Lobe Users`。其余保持默认即可。 +2. 在 `身份认证 -> 应用` 中,添加一个新的应用。 - 关闭用户注册 +- 名称与显示名称为 `LobeChat`。 +- 组织为 `Lobe Users`。 +- 重定向 URLS 中添加一行 为 `https://lobe.example.com/api/auth/callback/casdoor`。 +- 关闭除密码外的登录方式 。 +- 将客户端 ID 和客户端密钥分别填入 `.env`中的 `AUTH_CASDOOR_ID` 和 `AUTH_CASDOOR_SECRET` 中。 +- (可选) 仿照`built-in`应用的配置,来设计登录和注册的页面外观。 +- 保存并退出。 -8. 重启 LobeChat 服务: - - ```sh - docker compose up -d - ``` - - - 请注意,管理员账户不等同于注册用户,不要用你的管理员账户登录 LobeChat,那样只会报错。 + + 通过上述步骤,可以避免默认情况下所有用户均为管理员导致的不安全的情况。 -### S3 对象存储服务配置 +#### S3 对象存储服务配置 本文以 MinIO 为例,解释配置过程,如果你使用的是其他 S3 服务商,请参照其文档进行配置。 请记得注意配置对应 S3 服务商的 CORS 跨域配置,以确保 LobeChat 能够正常访问 S3 服务。 -在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。这既可以在 MinIO WebUI 的 `Configuration - API - Cors Allow Origin` 中配置,也可以在 Docker Compose 中的 `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN` 中配置。 - -如果你使用第二种方法(这也是默认的方法)进行配置,你将无法再在 MinIO WebUI 中配置。 + 在本文中,你需要允许 `https://lobe.example.com` 的跨域请求。这既可以在 MinIO WebUI 的 `Configuration - API - Cors Allow Origin` 中配置,也可以在 Docker Compose 中的 `minio - environment - MINIO_API_CORS_ALLOW_ORIGIN` 中配置。 + 如果你使用第二种方法(这也是默认的方法)进行配置,你将无法再在 MinIO WebUI 中配置。 你需要首先访问 WebUI 来进行配置: -- 如果你按照前文配置了反向代理,打开 `https://lobe-s3-ui.example.com` +- 如果你按照前文配置了反向代理,打开 `https://minio-ui.example.com` - 否则,请在进行端口映射后,打开 `http://localhost:9001` 1. 在登录界面输入你设置的 `MINIO_ROOT_USER` 和 `MINIO_ROOT_PASSWORD`,然后点击登录 -2. 在左侧面板 Administer / Buckets 中点击 `Create Bucket`,输入 `lobe`(对应你的 `S3_BUCKET` 环境变量),然后点击 `Create` - - 创建 MinIO 桶 - -3. 选中你的桶,点击 Summary - Access Policy,编辑,选择 `Custom`,输入 `minio-bucket-config.json` 中的内容(见附录)并保存(同样默认你的桶名为 `lobe`): - - 选中 MinIO 桶策略 - - 配置 MinIO 桶策略 +2. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中 -4. 在左侧面板 User / Access Keys 处,点击 `Create New Access Key`,无需额外修改,将生成的 `Access Key` 和 `Secret Key` 填入你的 `.env` 文件中的 `S3_ACCESS_KEY_ID` 和 `S3_SECRET_ACCESS_KEY` 中 + 创建 MinIO 访问密钥 - 创建 MinIO 访问密钥 - -5. 重启 LobeChat 服务: +3. 重启 LobeChat 服务: ```sh docker compose up -d @@ -366,75 +655,68 @@ docker compose up -d # 重新启动 至此,你已经成功部署了 LobeChat 数据库版本,你可以通过 `https://lobe.example.com` 访问你的 LobeChat 服务。 -## 附录 +#### 配置文件 -为方便一键复制,在此汇总域名方式下生产部署配置服务端数据库所需要的示例配置文件(对于本地快速启动、局域网 IP 访问等场景,请直接使用 `setup.sh` 脚本生成后自行修改): +为方便一键复制,在此汇总基于 casdoor 鉴权方案的域名方式下生产部署配置服务端数据库所需要的示例配置文件。 -### `.env` +- `.env` ```sh -# 必填,LobeChat 域名,用于 tRPC 调用 -# 请保证此域名在你的 NextAuth 鉴权服务提供商、S3 服务商的 CORS 白名单中 -APP_URL=https://lobe.example.com/ - -# Postgres 相关,也即 DB 必需的环境变量 -# 必填,用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 -KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ= -# 必填,Postgres 数据库连接字符串,用于连接到数据库 -# 格式:postgresql://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器且位于同一 docker-compose 文件中,亦可使用容器名作为 host -DATABASE_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobe - -# NEXT_AUTH 相关,也即鉴权服务必需的环境变量 -# 可以使用 auth0、Azure AD、GitHub、Authentik、Zitadel、Logto 等,如有其他接入诉求欢迎提 PR -# 目前支持的鉴权服务提供商请参考:https://lobehub.com/zh/docs/self-hosting/advanced/auth#next-auth -# 如果你有 ACCESS_CODE,请务必清空,我们以 NEXT_AUTH 作为唯一鉴权来源 -# 必填,用于 NextAuth 的密钥,可以使用 openssl rand -base64 32 生成 -NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg -# 必填,指定鉴权服务提供商,这里以 Logto 为例 -NEXT_AUTH_SSO_PROVIDERS=logto -# 必填,NextAuth 的 URL,用于 NextAuth 的回调 -NEXTAUTH_URL=https://lobe.example.com/api/auth - -# NextAuth 鉴权服务提供商部分,以 Logto 为例 -# 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth -AUTH_LOGTO_ID=YOUR_LOGTO_ID -AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET -AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc - -# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商) +# Proxy, if you need it # HTTP_PROXY=http://localhost:7890 # HTTPS_PROXY=http://localhost:7890 -# S3 相关,也即非结构化数据(文件、图片等)存储必需的环境变量 -# 这里以 MinIO 为例 -# 必填,S3 的 Access Key ID,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的 -S3_ACCESS_KEY_ID=YOUR_S3_ACCESS_KEY_ID -# 必填,S3 的 Secret Access Key,对于 MinIO 来说,直到在 MinIO UI 中手动创建之前都是无效的 -S3_SECRET_ACCESS_KEY=YOUR_S3_SECRET_ACCESS_KEY -# 必填,S3 的 Endpoint,用于服务端/客户端连接到 S3 API -S3_ENDPOINT=https://lobe-s3-api.example.com -# 必填,S3 的 Bucket,直到在 MinIO UI 中手动创建之前都是无效的 -S3_BUCKET=lobe -# 必填,S3 的 Public Domain,用于客户端通过公开连接访问非结构化数据 -S3_PUBLIC_DOMAIN=https://lobe-s3-api.example.com -# 选填,S3 的 Enable Path Style -# 对于主流 S3 Cloud 服务商,一般填 0 即可;对于自部署的 MinIO,请填 1 -# 请参考:https://lobehub.com/zh/docs/self-hosting/advanced/s3#s-3-enable-path-style -S3_ENABLE_PATH_STYLE=1 - -# 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE -# 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic -# 请注意,对于服务端版本,其 API 必须支持嵌入(OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型 + +# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. # OPENAI_API_KEY=sk-xxxx # OPENAI_PROXY_URL=https://api.openai.com/v1 # OPENAI_MODEL_LIST=... + + +# =========================== +# ====== Preset config ====== +# =========================== +# if no special requirements, no need to change +LOBE_PORT=3210 +CASDOOR_PORT=8000 +MINIO_PORT=9000 + +# Postgres related, which are the necessary environment variables for DB +LOBE_DB_NAME=lobechat +POSTGRES_PASSWORD=uWNZugjBqixf8dxC + +# Casdoor secret +AUTH_CASDOOR_ID=943e627d79d5dd8a22a1 +AUTH_CASDOOR_SECRET=6ec24ac304e92e160ef0d0656ecd86de8cb563f1 + +# MinIO S3 configuration +MINIO_ROOT_USER=Joe +MINIO_ROOT_PASSWORD=Crj1570768 + +# Configure the bucket information of MinIO +MINIO_LOBE_BUCKET=lobe +S3_ACCESS_KEY_ID=dB6Uq9CYZPdWSZouPyEd +S3_SECRET_ACCESS_KEY=aPBW8CVULkh8bw1GatlT0GjLihcXHLNwRml4pieS + ``` -### `docker-compose.yml` +- `docker-compose.yml` ```yaml name: lobe-chat-database services: + network-service: + image: alpine + container_name: lobe-network + ports: + - '${MINIO_PORT}:${MINIO_PORT}' # MinIO API + - '9001:9001' # MinIO Console + - '${CASDOOR_PORT}:${CASDOOR_PORT}' # Casdoor + - '${LOBE_PORT}:3210' # LobeChat + command: tail -f /dev/null + networks: + - lobe-network + postgresql: image: pgvector/pgvector:pg16 container_name: lobe-postgres @@ -443,57 +725,88 @@ services: volumes: - './data:/var/lib/postgresql/data' environment: - - 'POSTGRES_DB=lobe' - - 'POSTGRES_PASSWORD=uWNZugjBqixf8dxC' + - 'POSTGRES_DB=${LOBE_DB_NAME}' + - 'POSTGRES_PASSWORD=${POSTGRES_PASSWORD}' healthcheck: test: ['CMD-SHELL', 'pg_isready -U postgres'] interval: 5s timeout: 5s retries: 5 restart: always + networks: + - lobe-network minio: image: minio/minio container_name: lobe-minio - ports: - - '9000:9000' - - '9001:9001' + network_mode: 'service:network-service' volumes: - './s3_data:/etc/minio/data' environment: - - 'MINIO_ROOT_USER=YOUR_MINIO_USER' - - 'MINIO_ROOT_PASSWORD=YOUR_MINIO_PASSWORD' - - 'MINIO_DOMAIN=lobe-s3-api.example.com' - - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' # Your LobeChat's domain name. + - 'MINIO_ROOT_USER=${MINIO_ROOT_USER}' + - 'MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}' + # - 'MINIO_API_CORS_ALLOW_ORIGIN=http://localhost:${LOBE_PORT}' + - 'MINIO_API_CORS_ALLOW_ORIGIN=https://lobe.example.com' restart: always command: > - server /etc/minio/data --address ":9000" --console-address ":9001" + server /etc/minio/data --address ":${MINIO_PORT}" --console-address ":9001" - logto: - image: svhd/logto - container_name: lobe-logto - ports: - - '3001:3001' - - '3002:3002' + + casdoor: + image: casbin/casdoor + container_name: lobe-casdoor + entrypoint: /bin/sh -c './server --createDatabase=true' + network_mode: 'service:network-service' depends_on: postgresql: condition: service_healthy environment: - - 'TRUST_PROXY_HEADER=1' - - 'DB_URL=postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/logto' - - 'ENDPOINT=https://lobe-auth-api.example.com' - - 'ADMIN_ENDPOINT=https://lobe-auth-ui.example.com' - entrypoint: ['sh', '-c', 'npm run cli db seed -- --swe && npm start'] + RUNNING_IN_DOCKER: 'true' + driverName: 'postgres' + dataSourceName: 'user=postgres password=${POSTGRES_PASSWORD} host=postgresql port=5432 sslmode=disable dbname=casdoor' + # origin: 'http://localhost:${CASDOOR_PORT}' + origin: 'https://auth.example.com' + runmode: 'dev' + volumes: + - ./init_data.json:/init_data.json lobe: image: lobehub/lobe-chat-database - container_name: lobe-chat - ports: - - '3210:3210' + container_name: lobe-chat-database + network_mode: 'service:network-service' depends_on: - - postgresql - - minio - - logto + postgresql: + condition: service_healthy + network-service: + condition: service_started + minio: + condition: service_started + casdoor: + condition: service_started + + environment: + # - 'APP_URL=http://localhost:3210' + - 'APP_URL=https://lobe.example.com' + + - 'NEXT_AUTH_SSO_PROVIDERS=casdoor' + - 'KEY_VAULTS_SECRET=Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=' + - 'NEXT_AUTH_SECRET=NX2kaPE923dt6BL2U8e9oSre5RfoT7hg' + # - 'AUTH_URL=http://localhost:${LOBE_PORT}/api/auth' + - 'AUTH_URL=https://lobe.example.com/api/auth' + + # - 'AUTH_CASDOOR_ISSUER=http://localhost:${CASDOOR_PORT}' + - 'AUTH_CASDOOR_ISSUER=https://auth.example.com' + + - 'DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@postgresql:5432/${LOBE_DB_NAME}' + # - 'S3_ENDPOINT=http://localhost:${MINIO_PORT}' + - 'S3_ENDPOINT=https://minio.example.com' + + - 'S3_BUCKET=${MINIO_LOBE_BUCKET}' + # - 'S3_PUBLIC_DOMAIN=http://localhost:${MINIO_PORT}' + - 'S3_PUBLIC_DOMAIN=https://minio.example.com' + + - 'S3_ENABLE_PATH_STYLE=1' + - 'LLM_VISION_IMAGE_USE_BASE64=1' env_file: - .env restart: always @@ -503,45 +816,10 @@ volumes: driver: local s3_data: driver: local -``` -### `minio-bucket-config.json` - -```json -{ - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:GetBucketLocation"], - "Resource": ["arn:aws:s3:::lobe"] - }, - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:ListBucket"], - "Resource": ["arn:aws:s3:::lobe"], - "Condition": { - "StringEquals": { - "s3:prefix": ["files/*"] - } - } - }, - { - "Effect": "Allow", - "Principal": { - "AWS": ["*"] - }, - "Action": ["s3:PutObject", "s3:DeleteObject", "s3:GetObject"], - "Resource": ["arn:aws:s3:::lobe/files/**"] - } - ], - "Version": "2012-10-17" -} +networks: + lobe-network: + driver: bridge ``` [docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database diff --git a/docs/self-hosting/server-database/docker.mdx b/docs/self-hosting/server-database/docker.mdx index 91ddbd013bad4..f4f38a7fe3c35 100644 --- a/docs/self-hosting/server-database/docker.mdx +++ b/docs/self-hosting/server-database/docker.mdx @@ -15,10 +15,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -32,8 +31,7 @@ tags: Due to the inability to expose `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` using Docker environment variables, you cannot use Clerk as an authentication service when deploying LobeChat using Docker / Docker Compose. -If you do need Clerk as an authentication service, you might consider deploying using Vercel or building your own image. - + If you do need Clerk as an authentication service, you might consider deploying using Vercel or building your own image. ## Deploying on a Linux Server @@ -41,89 +39,87 @@ If you do need Clerk as an authentication service, you might consider deploying Here is the process for deploying the LobeChat server database version on a Linux server: - -### Create a Postgres Database Instance - -Please create a Postgres database instance with the PGVector plugin according to your needs, for example: - -```sh -docker network create pg - -docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 -``` - -The above command will create a PG instance named `my-postgres` on the network `pg`, where `pgvector/pgvector:pg16` is a Postgres 16 image with the pgvector plugin installed by default. - - - The pgvector plugin provides vector search capabilities for Postgres, which is an important - component for LobeChat to implement RAG. - - - - The above command does not specify a persistent storage location for the pg instance, so it is - only for testing/demonstration purposes. Please configure persistent storage for production - environments. - - -### Create a file named `lobe-chat.env` to store environment variables: - -```shell -# Website domain -APP_URL=https://your-prod-domain.com - -# DB required environment variables -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -# Postgres database connection string -# Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name -DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres - -# NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR -NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 -NEXT_AUTH_SSO_PROVIDERS=auth0 -NEXTAUTH_URL=https://your-prod-domain.com/api/auth -AUTH_AUTH0_ID=xxxxxx -AUTH_AUTH0_SECRET=cSX_xxxxx -AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com - -# S3 related -S3_ACCESS_KEY_ID=xxxxxxxxxx -S3_SECRET_ACCESS_KEY=xxxxxxxxxx -S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com -S3_BUCKET=lobechat -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com - -# Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. -# OPENAI_API_KEY=sk-xxxx -# OPENAI_PROXY_URL=https://api.openai.com/v1 -# OPENAI_MODEL_LIST=... -``` - -### Start the lobe-chat-database Docker image - -```sh -docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database -``` - -You can use the following command to check the logs: - -```sh -docker logs -f lobe-chat-database -``` - -If you see the following logs in the container, it means it has started successfully: - -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms -``` - + ### Create a Postgres Database Instance + + Please create a Postgres database instance with the PGVector plugin according to your needs, for example: + + ```sh + docker network create pg + + docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 + ``` + + The above command will create a PG instance named `my-postgres` on the network `pg`, where `pgvector/pgvector:pg16` is a Postgres 16 image with the pgvector plugin installed by default. + + + The pgvector plugin provides vector search capabilities for Postgres, which is an important + component for LobeChat to implement RAG. + + + + The above command does not specify a persistent storage location for the pg instance, so it is + only for testing/demonstration purposes. Please configure persistent storage for production + environments. + + + ### Create a file named `lobe-chat.env` to store environment variables: + + ```shell + # Website domain + APP_URL=https://your-prod-domain.com + + # DB required environment variables + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + # Postgres database connection string + # Format: postgres://username:password@host:port/dbname; if your pg instance is a Docker container, use the container name + DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres + + # NEXT_AUTH related, can use auth0, Azure AD, GitHub, Authentik, zitadel, etc. If you have other access requirements, feel free to submit a PR + NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 + NEXT_AUTH_SSO_PROVIDERS=auth0 + NEXTAUTH_URL=https://your-prod-domain.com/api/auth + AUTH_AUTH0_ID=xxxxxx + AUTH_AUTH0_SECRET=cSX_xxxxx + AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com + + # S3 related + S3_ACCESS_KEY_ID=xxxxxxxxxx + S3_SECRET_ACCESS_KEY=xxxxxxxxxx + S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com + S3_BUCKET=lobechat + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + + # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE. + # OPENAI_API_KEY=sk-xxxx + # OPENAI_PROXY_URL=https://api.openai.com/v1 + # OPENAI_MODEL_LIST=... + ``` + + ### Start the lobe-chat-database Docker image + + ```sh + docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database + ``` + + You can use the following command to check the logs: + + ```sh + docker logs -f lobe-chat-database + ``` + + If you see the following logs in the container, it means it has started successfully: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` diff --git a/docs/self-hosting/server-database/docker.zh-CN.mdx b/docs/self-hosting/server-database/docker.zh-CN.mdx index d6e9d3103a671..a930d2750d6c0 100644 --- a/docs/self-hosting/server-database/docker.zh-CN.mdx +++ b/docs/self-hosting/server-database/docker.zh-CN.mdx @@ -13,10 +13,9 @@ tags:
[![][docker-release-shield]][docker-release-link] -[![][docker-size-shield]][docker-size-link] - -[![][docker-pulls-shield]][docker-pulls-link] + [![][docker-size-shield]][docker-size-link] + [![][docker-pulls-shield]][docker-pulls-link]
@@ -31,8 +30,7 @@ tags: 由于无法使用 Docker 环境变量暴露 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,使用 Docker / Docker Compose 部署 LobeChat 时,你不能使用 Clerk 作为登录鉴权服务。 -如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 - + 如果你确实需要 Clerk 作为登录鉴权服务,你可以考虑使用 Vercel 部署或者自行构建镜像。 ## 在 Linux 服务器上部署 @@ -40,92 +38,90 @@ tags: 以下是在 Linux 服务器上部署 LobeChat DB 版的流程: - -### 创建 Postgres 数据库实例 - -请按照你自己的诉求创建一个带有 PGVector 插件的 Postgres 数据库实例,例如: - -```sh -docker network create pg - -docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 -``` - -上述指令会创建一个名为 `my-postgres`,并且网络为 `pg` 的 PG 实例,其中 `pgvector/pgvector:pg16` 是一个 Postgres 16 的镜像,且默认安装了 pgvector 插件。 - - - pgvector 插件为 Postgres 提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 - - - - 以上指令得到的 pg - 实例并没有指定持久化存储位置,因此仅用于测试/演示,生产环境请自行配置持久化存储。 - - -### 创建名为 `lobe-chat.env` 文件用于存放环境变量: - -```shell -# 网站域名 -APP_URL=https://your-prod-domain.com - -# DB 必须的环境变量 -# 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 -KEY_VAULTS_SECRET='jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=' -# Postgres 数据库连接字符串 -# 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名 -DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres - -# NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR -NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 -NEXT_AUTH_SSO_PROVIDERS=auth0 -NEXTAUTH_URL=https://your-prod-domain.com/api/auth -AUTH_AUTH0_ID=xxxxxx -AUTH_AUTH0_SECRET=cSX_xxxxx -AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com - -# S3 相关 -S3_ACCESS_KEY_ID=xxxxxxxxxx -S3_SECRET_ACCESS_KEY=xxxxxxxxxx -# 用于 S3 API 访问的域名 -S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com -S3_BUCKET=lobechat -# 用于外网访问 S3 的公共域名,需配置 CORS -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -# S3_REGION=ap-chengdu # 如果需要指定地域 - -# 其他环境变量,视需求而定 -# OPENAI_API_KEY=sk-xxxx -# OPENAI_PROXY_URL=https://api.openai.com/v1 -# OPENAI_MODEL_LIST=... -# ... -``` - -### 启动 lobe-chat-database docker 镜像 - -```sh -docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database -``` - -你可以使用下述指令检查日志: - -```sh -docker logs -f lobe-chat-database -``` - -如果你在容器中看到了以下日志,则说明已经启动成功: - -```log -[Database] Start to migration... -✅ database migration pass. -------------------------------------- - ▲ Next.js 14.x.x - - Local: http://localhost:3210 - - Network: http://0.0.0.0:3210 - - ✓ Starting... - ✓ Ready in 95ms -``` - + ### 创建 Postgres 数据库实例 + + 请按照你自己的诉求创建一个带有 PGVector 插件的 Postgres 数据库实例,例如: + + ```sh + docker network create pg + + docker run --name my-postgres --network pg -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d pgvector/pgvector:pg16 + ``` + + 上述指令会创建一个名为 `my-postgres`,并且网络为 `pg` 的 PG 实例,其中 `pgvector/pgvector:pg16` 是一个 Postgres 16 的镜像,且默认安装了 pgvector 插件。 + + + pgvector 插件为 Postgres 提供了向量搜索的能力,是 LobeChat 实现 RAG 的重要构件之一。 + + + + 以上指令得到的 pg + 实例并没有指定持久化存储位置,因此仅用于测试 / 演示,生产环境请自行配置持久化存储。 + + + ### 创建名为 `lobe-chat.env` 文件用于存放环境变量: + + ```shell + # 网站域名 + APP_URL=https://your-prod-domain.com + + # DB 必须的环境变量 + # 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成 + KEY_VAULTS_SECRET='jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=' + # Postgres 数据库连接字符串 + # 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名 + DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres + + # NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR + NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 + NEXT_AUTH_SSO_PROVIDERS=auth0 + NEXTAUTH_URL=https://your-prod-domain.com/api/auth + AUTH_AUTH0_ID=xxxxxx + AUTH_AUTH0_SECRET=cSX_xxxxx + AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com + + # S3 相关 + S3_ACCESS_KEY_ID=xxxxxxxxxx + S3_SECRET_ACCESS_KEY=xxxxxxxxxx + # 用于 S3 API 访问的域名 + S3_ENDPOINT=https://xxxxxxxxxx.r2.cloudflarestorage.com + S3_BUCKET=lobechat + # 用于外网访问 S3 的公共域名,需配置 CORS + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + # S3_REGION=ap-chengdu # 如果需要指定地域 + + # 其他环境变量,视需求而定 + # OPENAI_API_KEY=sk-xxxx + # OPENAI_PROXY_URL=https://api.openai.com/v1 + # OPENAI_MODEL_LIST=... + # ... + ``` + + ### 启动 lobe-chat-database docker 镜像 + + ```sh + docker run -it -d -p 3210:3210 --network pg --env-file lobe-chat.env --name lobe-chat-database lobehub/lobe-chat-database + ``` + + 你可以使用下述指令检查日志: + + ```sh + docker logs -f lobe-chat-database + ``` + + 如果你在容器中看到了以下日志,则说明已经启动成功: + + ```log + [Database] Start to migration... + ✅ database migration pass. + ------------------------------------- + ▲ Next.js 14.x.x + - Local: http://localhost:3210 + - Network: http://0.0.0.0:3210 + + ✓ Starting... + ✓ Ready in 95ms + ``` diff --git a/docs/self-hosting/server-database/dokploy.mdx b/docs/self-hosting/server-database/dokploy.mdx index 67d80cb25f918..849e403ad201d 100644 --- a/docs/self-hosting/server-database/dokploy.mdx +++ b/docs/self-hosting/server-database/dokploy.mdx @@ -11,14 +11,19 @@ tags: --- # Deploying Server Database Version on Dokploy. + This article will detail how to deploy the server database version of LobeChat. + ## 1. Preparation Work + ### Deploy Dokploy and configure related settings. + ```shell curl -sSL https://dokploy.com/install.sh | sh ``` + 1. Connect your GitHub to Dokploy in the Settings / Git section according to the prompt. - + ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) 2. Enter the Projects interface to create a Project. @@ -26,7 +31,9 @@ curl -sSL https://dokploy.com/install.sh | sh ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) ### Configure S3 Storage Service + In the server-side database, we need to configure the S3 storage service to store files. For detailed configuration instructions, please refer to the section [Configure S3 Storage Service](https://lobehub.com/docs/self-hosting/server-database/vercel#3-configure-s-3-storage-service) in the Vercel deployment guide。After the configuration is complete, you will obtain the following environment variables: + ```shell S3_ACCESS_KEY_ID= S3_SECRET_ACCESS_KEY= @@ -35,28 +42,36 @@ S3_BUCKET= S3_PUBLIC_DOMAIN= S3_ENABLE_PATH_STYLE= ``` + ### Configure the Clerk authentication service. + Obtain the three environment variables: `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, `CLERK_SECRET_KEY`, and `CLERK_WEBHOOK_SECRET`. For detailed configuration steps for Clerk, please refer to the section [Configure Authentication Service](https://lobehub.com/docs/self-hosting/server-database/vercel#2-configure-authentication-service) in the Vercel deployment guide. + ```shell NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx ``` + ## 2. Deploying the database on Dokploy + Enter the previously created Project, click on Create Service, and select Database. In the Database interface, choose PostgreSQL, then set the database name, user, and password. In the Docker image field, enter `pgvector/pgvector:pg17`, and finally click Create to create the database. ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) Enter the created database and set an unused port in External Credentials to allow external access; otherwise, LobeChat will not be able to connect to the database. You can view the Postgres database connection URL in External Host, as shown below: + ```shell postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres ``` + Finally, click Deploy to deploy the database. ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) ## Deploy LobeChat on Dokploy. + Click "Create Service", select "Application", and create the LobeChat application. ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) @@ -106,6 +121,7 @@ OPENAI_API_KEY= OPENAI_MODEL_LIST= OPENAI_PROXY_URL= ``` + After adding the environment variables and saving, click Deploy to initiate the deployment. You can check the deployment progress and log information under Deployments. ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) @@ -115,6 +131,7 @@ After a successful deployment, bind your own domain to your LobeChat application ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) ## Check if LobeChat is working properly. + Go to your LobeChat website, and if you click on the login button in the upper left corner and the login pop-up appears normally, it means you have configured it successfully. Enjoy it to the fullest! ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) diff --git a/docs/self-hosting/server-database/dokploy.zh-CN.mdx b/docs/self-hosting/server-database/dokploy.zh-CN.mdx index 3c7a2b8cbfeec..61c0055e27e3e 100644 --- a/docs/self-hosting/server-database/dokploy.zh-CN.mdx +++ b/docs/self-hosting/server-database/dokploy.zh-CN.mdx @@ -10,67 +10,82 @@ tags: - 身份验证服务 - 环境变量配置 --- - -# 在 Dokploy 上部署服务端数据库版 -本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。 -## 一、准备工作 -### 部署 Dokploy 并进行相关设置 -```shell -curl -sSL https://dokploy.com/install.sh | sh -``` -1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy - -![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) - -2. 进入 Projects 界面创建一个 Project - -![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) - -### 配置 S3 存储服务 -在服务端数据库中我们需要配置 S3 存储服务来存储文件,详细配置教程请参考 使用 Vercel 部署中 [配置S3储存服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#%E4%B8%89%E3%80%81-%E9%85%8D%E7%BD%AE-s-3-%E5%AD%98%E5%82%A8%E6%9C%8D%E5%8A%A1)。配置完成后你将获得以下环境变量: -```shell + +# 在 Dokploy 上部署服务端数据库版 + +本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。 + +## 一、准备工作 + +### 部署 Dokploy 并进行相关设置 + +```shell +curl -sSL https://dokploy.com/install.sh | sh +``` + +1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy + +![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996) + +2. 进入 Projects 界面创建一个 Project + +![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e) + +### 配置 S3 存储服务 + +在服务端数据库中我们需要配置 S3 存储服务来存储文件,详细配置教程请参考 使用 Vercel 部署中 [配置 S3 储存服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#%E4%B8%89%E3%80%81-%E9%85%8D%E7%BD%AE-s-3-%E5%AD%98%E5%82%A8%E6%9C%8D%E5%8A%A1)。配置完成后你将获得以下环境变量: + +```shell S3_ACCESS_KEY_ID= S3_SECRET_ACCESS_KEY= S3_ENDPOINT= S3_BUCKET= S3_PUBLIC_DOMAIN= -S3_ENABLE_PATH_STYLE= -``` -### 配置 Clerk 身份验证服务 -获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务) -```shell +S3_ENABLE_PATH_STYLE= +``` + +### 配置 Clerk 身份验证服务 + +获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk 的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务) + +```shell NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` -## 二、在 Dokploy 上部署数据库 -进入前面创建的Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。 - -![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) - +CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx +``` + +## 二、在 Dokploy 上部署数据库 + +进入前面创建的 Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。 + +![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f) + 进入创建的数据库,在 External Credentials 设置一个未被占用的端口,使其能能通过外部访问,否则 LobeChat 将无法连接到该数据库。 -你可以在 External Host 查看 Postgres 数据库连接 URL ,如下: -```shell -postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres -``` -最后点击 Deploy 部署数据库 - -![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) - -## 在 Dokploy 上部署 LobeChat -点击 Create Service 选择 Application,创建 LobeChat 应用 - -![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) - -进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存 - -![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305) - -切换到 Environment ,在其中填入环境变量,点击保存。 - -![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91) - -```shell +你可以在 External Host 查看 Postgres 数据库连接 URL ,如下: + +```shell +postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres +``` + +最后点击 Deploy 部署数据库 + +![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e) + +## 在 Dokploy 上部署 LobeChat + +点击 Create Service 选择 Application,创建 LobeChat 应用 + +![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c) + +进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存 + +![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305) + +切换到 Environment ,在其中填入环境变量,点击保存。 + +![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91) + +```shell # 构建所必需的环境变量 NIXPACKS_PKGS="pnpm bun" NIXPACKS_INSTALL_CMD="pnpm install" @@ -105,18 +120,19 @@ S3_ENABLE_PATH_STYLE= # OpenAI 相关配置 OPENAI_API_KEY= OPENAI_MODEL_LIST= -OPENAI_PROXY_URL= -``` -添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息 - -![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) - -部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。 - -![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) - -## 验证 LobeChat 是否正常工作 -进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ - -![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) - +OPENAI_PROXY_URL= +``` + +添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息 + +![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec) + +部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。 + +![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7) + +## 验证 LobeChat 是否正常工作 + +进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ + +![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26) diff --git a/docs/self-hosting/server-database/repocloud.mdx b/docs/self-hosting/server-database/repocloud.mdx index 55e04e33ed776..ee95f9601f366 100644 --- a/docs/self-hosting/server-database/repocloud.mdx +++ b/docs/self-hosting/server-database/repocloud.mdx @@ -17,19 +17,17 @@ If you want to deploy LobeChat Database Edition on RepoCloud, you can follow the ## RepoCloud Deployment Process + ### Prepare your OpenAI API Key -### Prepare your OpenAI API Key + Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. -Go to [OpenAI API Key](https://platform.openai.com/account/api-keys) to get your OpenAI API Key. + ### One-click to deploy -### One-click to deploy + [![Deploy to RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) -[![Deploy to RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) + ### Once deployed, you can start using it -### Once deployed, you can start using it - -### Bind a custom domain (optional) - -You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly. + ### Bind a custom domain (optional) + You can use the subdomain provided by RepoCloud, or choose to bind a custom domain. Currently, the domains provided by RepoCloud have not been contaminated, and most regions can connect directly. diff --git a/docs/self-hosting/server-database/repocloud.zh-CN.mdx b/docs/self-hosting/server-database/repocloud.zh-CN.mdx index ae397c86216fd..dd9bfbc7304c0 100644 --- a/docs/self-hosting/server-database/repocloud.zh-CN.mdx +++ b/docs/self-hosting/server-database/repocloud.zh-CN.mdx @@ -11,24 +11,22 @@ tags: # 在 RepoCloud 上部署 LobeChat 数据库版 -如果您想在RepoCloud上部署LobeChat数据库版,可以按照以下步骤进行操作: +如果您想在 RepoCloud 上部署 LobeChat 数据库版,可以按照以下步骤进行操作: -## RepoCloud部署流程 +## RepoCloud 部署流程 + ### 准备您的 OpenAI API 密钥 -### 准备您的 OpenAI API 密钥 + 请访问 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。 -请访问 [OpenAI API密钥](https://platform.openai.com/account/api-keys) 获取您的OpenAI API密钥。 + ### 一键部署 -### 一键部署 + [![部署到 RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) -[![部署到RepoCloud](https://d16t0pc4846x52.cloudfront.net/deploy.svg)](https://repocloud.io/details/?app_id=248) + ### 部署完成后,您可以开始使用 -### 部署完成后,您可以开始使用 - -### 绑定自定义域名(可选) - -您可以使用RepoCloud提供的子域名,或选择绑定自定义域名。目前,RepoCloud提供的域名尚未被污染,大多数地区可以直接连接。 + ### 绑定自定义域名(可选) + 您可以使用 RepoCloud 提供的子域名,或选择绑定自定义域名。目前,RepoCloud 提供的域名尚未被污染,大多数地区可以直接连接。 diff --git a/docs/self-hosting/server-database/vercel.mdx b/docs/self-hosting/server-database/vercel.mdx index 909b2448885f6..29a50560399bf 100644 --- a/docs/self-hosting/server-database/vercel.mdx +++ b/docs/self-hosting/server-database/vercel.mdx @@ -15,107 +15,90 @@ tags: This article will detail how to deploy the server database version of LobeChat on Vercel, including: 1) database configuration; 2) identity authentication service configuration; 3) steps for setting up the S3 storage service. + Before proceeding, please make sure of the following: -Before proceeding, please make sure of the following: - -- Export all data, as after deploying the server-side database, existing user data cannot be automatically migrated and can only be manually imported after backup! -- The `ACCESS_CODE` in the environment variables is either unset or cleared! -- When configuring the environment variables required for the server-side database, make sure to fill in all of them before deployment, otherwise you may encounter database migration issues! - + - Export all data, as after deploying the server-side database, existing user data cannot be automatically migrated and can only be manually imported after backup! + - The `ACCESS_CODE` in the environment variables is either unset or cleared! + - When configuring the environment variables required for the server-side database, make sure to fill in all of them before deployment, otherwise you may encounter database migration issues! ## 1. Configure the Database + ### Prepare the Server Database Instance and Obtain the Connection URL -### Prepare the Server Database Instance and Obtain the Connection URL - -Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods: - -- `A.` Use Serverless Postgres instances like Vercel / Neon; -- `B.` Use self-deployed Postgres instances like Docker. - -The configuration for both methods is slightly different, and will be distinguished in the next step. + Before deployment, make sure you have prepared a Postgres database instance. You can choose one of the following methods: -### Add Environment Variables in Vercel + - `A.` Use Serverless Postgres instances like Vercel / Neon; + - `B.` Use self-deployed Postgres instances like Docker. -In Vercel's deployment environment variables, add `DATABASE_URL` and other environment variables, and fill in the Postgres database connection URL prepared in the previous step. The typical format for the database connection URL is `postgres://username:password@host:port/database`. - - - - - - - Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to - the `Node Postgres` Tab. - + The configuration for both methods is slightly different, and will be distinguished in the next step. -Variables to be filled for Serverless Postgres are as follows: + ### Add Environment Variables in Vercel -```shell -# Serverless Postgres DB Url -DATABASE_URL= + In Vercel's deployment environment variables, add `DATABASE_URL` and other environment variables, and fill in the Postgres database connection URL prepared in the previous step. The typical format for the database connection URL is `postgres://username:password@host:port/database`. -# Specify service mode as server, otherwise it will not enter the server-side database -NEXT_PUBLIC_SERVICE_MODE=server -``` + + + + Please confirm the `Postgres` type provided by your vendor. If it is `Node Postgres`, switch to + the `Node Postgres` Tab. + -An example of filling in Vercel is as follows: + Variables to be filled for Serverless Postgres are as follows: -{'Add + ```shell + # Serverless Postgres DB Url + DATABASE_URL= - + # Specify service mode as server, otherwise it will not enter the server-side database + NEXT_PUBLIC_SERVICE_MODE=server + ``` - - Variables to be filled for Node Postgres are as follows: + An example of filling in Vercel is as follows: -```shell -# Node Postgres DB Url -DATABASE_URL= + {'Add + -# Specify Postgres database driver as node -DATABASE_DRIVER=node + + Variables to be filled for Node Postgres are as follows: -# Specify service mode as server, otherwise it will not enter the server-side database -NEXT_PUBLIC_SERVICE_MODE=server -``` + ```shell + # Node Postgres DB Url + DATABASE_URL= -An example of filling in Vercel is as follows: + # Specify Postgres database driver as node + DATABASE_DRIVER=node -{'Add + # Specify service mode as server, otherwise it will not enter the server-side database + NEXT_PUBLIC_SERVICE_MODE=server + ``` - + An example of filling in Vercel is as follows: - + {'Add + + - If you wish to enable SSL when connecting to the database, please refer to the [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for setup instructions. + - + ### Add the `KEY_VAULTS_SECRET` Environment Variable -### Add the `KEY_VAULTS_SECRET` Environment Variable + After adding the `DATABASE_URL` environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. You can generate a random 32-character string as the key using `openssl rand -base64 32`. -After adding the DATABASE_URL environment variable for the database, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information such as apikeys stored by users. You can generate a random 32-character string as the key using `openssl rand -base64 32`. + ```shell + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + ``` -```shell -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -``` + Make sure to add this to the Vercel environment variables as well. -Make sure to add this to the Vercel environment variables as well. - -### Add the `APP_URL` Environment Variable - -Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application. + ### Add the `APP_URL` Environment Variable + Finally, you need to add the `APP_URL` environment variable, which specifies the URL address of the LobeChat application. ## 2. Configure Authentication Service @@ -123,87 +106,63 @@ Finally, you need to add the `APP_URL` environment variable, which specifies the The server-side database needs to be paired with a user authentication service to function properly. Therefore, the corresponding authentication service needs to be configured. + ### Prepare Clerk Authentication Service -### Prepare Clerk Authentication Service - -Go to [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key. + Go to [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) to register and create an application to obtain the corresponding Public Key and Secret Key. - If you are not familiar with Clerk, you can refer to [Authentication Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk. + -
- -### Add Public and Private Key Environment Variables in Vercel + ### Add Public and Private Key Environment Variables in Vercel -In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables. + In Vercel's deployment environment variables, add the `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY` environment variables. You can click on "API Keys" in the menu, then copy the corresponding values and paste them into Vercel's environment variables. -{'Find + {'Find -The environment variables required for this step are as follows: + The environment variables required for this step are as follows: -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -Add the above variables to Vercel: + Add the above variables to Vercel: -{'Add + {'Add -### Create and Configure Webhook in Clerk + ### Create and Configure Webhook in Clerk -Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store data in the database when there are changes in the user's lifecycle (create, update, delete). We achieve this requirement through the Webhook provided by Clerk. + Since we let Clerk fully handle user authentication and management, we need Clerk to notify our application and store data in the database when there are changes in the user's lifecycle (create, update, delete). We achieve this requirement through the Webhook provided by Clerk. -We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes. + We need to add an endpoint in Clerk's Webhooks to inform Clerk to send notifications to this endpoint when a user's information changes. -{'Add + {'Add -Fill in the endpoint with the URL of your Vercel project, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. + Fill in the endpoint with the URL of your Vercel project, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, subscribe to events by checking the three user events (`user.created`, `user.deleted`, `user.updated`), and click create. - The `https://` in the URL is essential to maintain the integrity of the URL. + -
- -{'Configure - -### Add Webhook Secret to Vercel Environment Variables + {'Configure -After creation, you can find the secret of this Webhook in the bottom right corner: + ### Add Webhook Secret to Vercel Environment Variables -{'View + After creation, you can find the secret of this Webhook in the bottom right corner: -The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: + {'View -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + The environment variable corresponding to this secret is `CLERK_WEBHOOK_SECRET`: -Add it to Vercel's environment variables: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` -{'Add + Add it to Vercel's environment variables: + {'Add By completing these steps, you have successfully configured the Clerk authentication service. Next, we will configure the S3 storage service. @@ -213,155 +172,121 @@ By completing these steps, you have successfully configured the Clerk authentica In the server-side database, we need to configure the S3 storage service to store files. - -In this article, S3 refers to a compatible S3 storage solution, which supports object storage systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud OSS, etc., all of which support S3-compatible APIs. - + In this article, S3 refers to a compatible S3 storage solution, which supports object storage systems that comply with the Amazon S3 API. Common examples include Cloudflare R2, Alibaba Cloud OSS, etc., all of which support S3-compatible APIs. + ### Configure and Obtain S3 Bucket -### Configure and Obtain S3 Bucket + You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following steps will use Cloudflare R2 as an example to explain the creation process. -You need to go to your S3 service provider (such as AWS S3, Cloudflare R2, etc.) and create a new storage bucket. The following steps will use Cloudflare R2 as an example to explain the creation process. + The interface of Cloudflare R2 is shown below: -The interface of Cloudflare R2 is shown below: + {'Cloudflare -{'Cloudflare + When creating a storage bucket, specify its name and then click create. -When creating a storage bucket, specify its name and then click create. + {'Create -{'Create + ### Obtain Environment Variables for the Bucket -### Obtain Environment Variables for the Bucket + In the settings of the R2 storage bucket, you can view the bucket configuration information: -In the settings of the R2 storage bucket, you can view the bucket configuration information: + {'View -{'View + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + # Storage bucket name + S3_BUCKET=lobechat + # Storage bucket request endpoint (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the S3 API token application page) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Public access domain for the storage bucket + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -```shell -# Storage bucket name -S3_BUCKET=lobechat -# Storage bucket request endpoint (note that the path in this link includes the bucket name, which must be removed, or use the link provided on the S3 API token application page) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Public access domain for the storage bucket -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + + `S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible + - - `S3_ENDPOINT` must have its path removed, otherwise uploaded files will not be accessible - + ### Obtain S3 Key Environment Variables -### Obtain S3 Key Environment Variables + You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details: -You need to obtain the access key for S3 so that the LobeChat server has permission to access the S3 storage service. In R2, you can configure the access key in the account details: + {'View -{'View + Click the button in the upper right corner to create an API token and enter the create API Token page. -Click the button in the upper right corner to create an API token and enter the create API Token page. + {'Create -{'Create + Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create. -Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Object Read and Write`, then click create. + {'Configure -{'Configure + After creation, you can see the corresponding S3 API token. -After creation, you can see the corresponding S3 API token. + {'Copy -{'Copy + The corresponding environment variables are: -The corresponding environment variables are: + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` + ### Adding Corresponding Environment Variables in Vercel -### Adding Corresponding Environment Variables in Vercel + The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent: -The steps to obtain the required environment variables may vary for different S3 service providers, but the obtained environment variables should be consistent: + + The `https://` in the URL is essential and must be maintained for the completeness of the URL. + - - The `https://` in the URL is essential and must be maintained for the completeness of the URL. - + ```shell + # S3 Keys + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -```shell -# S3 Keys -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + # Bucket name + S3_BUCKET=lobechat + # Bucket request endpoint + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # Public domain for bucket access + S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com -# Bucket name -S3_BUCKET=lobechat -# Bucket request endpoint -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# Public domain for bucket access -S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com - -# Bucket region, such as us-west-1, generally not required, but some providers may need to configure -# S3_REGION=us-west-1 -``` - -Then, insert the above environment variables into Vercel's environment variables: + # Bucket region, such as us-west-1, generally not required, but some providers may need to configure + # S3_REGION=us-west-1 + ``` -{'Adding + Then, insert the above environment variables into Vercel's environment variables: -### Configuring Cross-Origin Resource Sharing (CORS) + {'Adding -Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. + ### Configuring Cross-Origin Resource Sharing (CORS) -In R2, you can find the CORS configuration in the bucket settings: + Since S3 storage services are often on a separate domain, cross-origin access needs to be configured. -{'Cloudflare + In R2, you can find the CORS configuration in the bucket settings: -Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`): + {'Cloudflare -{'Configuring + Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`): -Example configuration: + {'Configuring -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + Example configuration: -After configuring, click save. + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + After configuring, click save. ## Four, Deployment and Verification @@ -371,27 +296,17 @@ After completing the steps above, the configuration of the server-side database ### Redeploy the latest commit -After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete. - -{'Redeploy + After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete. -### Check if the features are working properly + {'Redeploy -If you click on the login button in the top left corner and the login popup appears normally, then you have successfully configured it. Enjoy using it\~ + ### Check if the features are working properly -{'User + If you click on the login button in the top left corner and the login popup appears normally, then you have successfully configured it. Enjoy using it\~ -{'Login + {'User + {'Login ## Appendix diff --git a/docs/self-hosting/server-database/vercel.zh-CN.mdx b/docs/self-hosting/server-database/vercel.zh-CN.mdx index bbcc7a86531b1..22502646ba35e 100644 --- a/docs/self-hosting/server-database/vercel.zh-CN.mdx +++ b/docs/self-hosting/server-database/vercel.zh-CN.mdx @@ -17,37 +17,34 @@ tags: 本文将详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括: 1)数据库配置;2)身份验证服务配置;3) S3 存储服务的设置步骤。 - 进行后续操作前,请务必确认以下事项: - - 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入! - - 环境变量中的`ACCESS_CODE`未设置或已清除! - - 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题! + 进行后续操作前,请务必确认以下事项: + + - 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入! + - 环境变量中的`ACCESS_CODE`未设置或已清除! + - 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题! ## 一、 配置数据库 + ### 准备服务端数据库实例,获取连接 URL -### 准备服务端数据库实例,获取连接 URL - -在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式: + 在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式: -- `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例; -- `B.` 使用 Docker 等自部署 Postgres 实例。 + - `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例; + - `B.` 使用 Docker 等自部署 Postgres 实例。 -两者的配置方式略有不同,在下一步会有所区分。 + 两者的配置方式略有不同,在下一步会有所区分。 -### 在 Vercel 中添加环境变量 + ### 在 Vercel 中添加环境变量 -在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 + 在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。 - - 请确认您的供应商所提供的 `Postgres` 类型,若为 `Node Postgres`,请切换到 `Node Postgres` Tab 。 - - +
Serverless Postgres 需要填写的变量如下: @@ -61,9 +58,8 @@ tags: 在 Vercel 中填写的示例如下: - {'添加 - - + {'添加 + Node Postgres 需要填写的变量如下: @@ -81,31 +77,28 @@ tags: 在 Vercel 中填写的示例如下: - {'添加 + {'添加 + + - + + 如果希望连接数据库时启用 SSL + ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 + - + ### 添加 `KEY_VAULTS_SECRET` 环境变量 - - 如果希望连接数据库时启用 SSL - ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置 - - -### 添加 `KEY_VAULTS_SECRET` 环境变量 - -在完成数据库 DATABASE_URL 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。 - -```shell -KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= -``` + 在完成数据库 `DATABASE_URL` 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。 -同样需要将其添加到 Vercel 环境变量中。 + ```shell + KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= + ``` -### 添加 `APP_URL` 环境变量 + 同样需要将其添加到 Vercel 环境变量中。 -该部分最后需要添加 APP_URL 环境变量,用于指定LobeChat 应用的 URL 地址。 + ### 添加 `APP_URL` 环境变量 + 该部分最后需要添加 `APP_URL` 环境变量,用于指定 LobeChat 应用的 URL 地址。 ## 二、 配置身份验证服务 @@ -113,81 +106,61 @@ KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= 服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。 + ### 准备 Clerk 身份验证服务 -### 准备 Clerk 身份验证服务 + 前往 [Clerk](https://clerk.com?utm_source=lobehub\&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 -前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。 + + 如果对 Clerk 不太了解,可以查阅 + [身份验证服务 - Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。 + - - 如果对 Clerk 不太了解,可以查阅 - [身份验证服务-Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。 - + ### 在 Vercel 中添加公、私钥环境变量 -### 在 Vercel 中添加公、私钥环境变量 + 在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。 -在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。 + {'在 -{'在 + 此步骤所需的环境变量如下: -此步骤所需的环境变量如下: + ```shell + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx + CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx + ``` -```shell -NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx -CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx -``` - -添加上述变量到 Vercel 中: - -{'在 + 添加上述变量到 Vercel 中: -### 在 Clerk 中创建并配置 Webhook + {'在 -由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 + ### 在 Clerk 中创建并配置 Webhook -我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 + 由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。 -{'Clerk + 我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。 -在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 + {'Clerk -URL的`https://`不可缺失,须保持URL的完整性 + 在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。 -{'添加 + URL 的`https://`不可缺失,须保持 URL 的完整性 -### 将 Webhook 秘钥添加到 Vercel 环境变量 + {'添加 -创建完毕后,可以在右下角找到该 Webhook 的秘钥: + ### 将 Webhook 秘钥添加到 Vercel 环境变量 -{'查看 + 创建完毕后,可以在右下角找到该 Webhook 的秘钥: -这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: + {'查看 -```shell -CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx -``` + 这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`: -将其添加到 Vercel 的环境变量中: + ```shell + CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx + ``` -{'在 + 将其添加到 Vercel 的环境变量中: + {'在 这样,你已经成功配置了 Clerk 身份验证服务。接下来我们将配置 S3 存储服务。 @@ -197,149 +170,118 @@ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx 在服务端数据库中我们需要配置 S3 存储服务来存储文件。 - 在本文,S3所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare + 在本文,S3 所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare R2 、阿里云 OSS 等均支持 S3 兼容 API。 + ### 配置并获取 S3 存储桶 - ### 配置并获取 S3 存储桶 + 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 - 你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。 + 下图是 Cloudflare R2 的界面: - 下图是 Cloudflare R2 的界面: + {'Cloudflare - {'Cloudflare + 创建存储桶时将指定其名称,然后点击创建。 - 创建存储桶时将指定其名称,然后点击创建。 - {'R2 + {'R2 - ### 获取存储桶相关环境变量 + ### 获取存储桶相关环境变量 - 在 R2 存储桶的设置中,可以看到桶配置的信息: + 在 R2 存储桶的设置中,可以看到桶配置的信息: - {'查看存储桶的相关信息'} + {'查看存储桶的相关信息'} -其对应的环境变量为: + 其对应的环境变量为: -```shell -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com -``` + ```shell + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接) + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com + ``` -`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 + `S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件 - ### 获取 S3 密钥环境变量 + ### 获取 S3 密钥环境变量 - 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: + 你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥: - {'查看存储桶的访问秘钥'} + {'查看存储桶的访问秘钥'} - 点击右上角按钮创建 API token,进入创建 API Token 页面 + 点击右上角按钮创建 API token,进入创建 API Token 页面 - {'创建对应 + {'创建对应 - 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 + 鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`对象读与写`,然后点击创建。 - {'配置 + {'配置 - 创建完成后,就可以看到对应的 S3 API token + 创建完成后,就可以看到对应的 S3 API token - {'复制 + {'复制 - 其对应的环境变量为: + 其对应的环境变量为: -```shell -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -``` - -### 在 Vercel 中添加对应的环境变量 + ```shell + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + ``` - 不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的: + ### 在 Vercel 中添加对应的环境变量 -URL的`https://`不可缺失,须保持URL的完整性 + 不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的: -```shell -# S3 秘钥 -S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 -S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 + URL 的`https://`不可缺失,须保持 URL 的完整性 -# 存储桶的名称 -S3_BUCKET=lobechat -# 存储桶的请求端点 -S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com -# 存储桶对外的访问域名 -S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com + ```shell + # S3 秘钥 + S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6 + S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2 -# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置 -# S3_REGION=us-west-1 -``` + # 存储桶的名称 + S3_BUCKET=lobechat + # 存储桶的请求端点 + S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com + # 存储桶对外的访问域名 + S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com -然后将上述环境变量填入 Vercel 的环境变量中: + # 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置 + # S3_REGION=us-west-1 + ``` - {'在 + 然后将上述环境变量填入 Vercel 的环境变量中: - ### 配置跨域 + {'在 - 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 + ### 配置跨域 - 在 R2 中,你可以在存储桶的设置中找到跨域配置: + 由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。 - {'Cloudflare + 在 R2 中,你可以在存储桶的设置中找到跨域配置: - 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: + {'Cloudflare - {'配置允许你的站点域名'} + 添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求: -示例配置如下: + {'配置允许你的站点域名'} -```json -[ - { - "AllowedOrigins": ["https://your-project.vercel.app"], - "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], - "AllowedHeaders": ["*"] - } -] -``` + 示例配置如下: -配置后点击保存即可。 + ```json + [ + { + "AllowedOrigins": ["https://your-project.vercel.app"], + "AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"], + "AllowedHeaders": ["*"] + } + ] + ``` + 配置后点击保存即可。 ## 四、部署并验证 @@ -349,27 +291,17 @@ S3_PUBLIC_DOMAIN=https://s3-dev.your-domain.com ### 重新部署最新的 commit -配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。 - -{'重新部署最新的 + 配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。 -### 检查功能是否正常 + {'重新部署最新的 -如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ + ### 检查功能是否正常 -{'用户登录弹窗'} + 如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~ -{'登录成功状态'} + {'用户登录弹窗'} + {'登录成功状态'} ## 附录 diff --git a/docs/self-hosting/server-database/zeabur.mdx b/docs/self-hosting/server-database/zeabur.mdx index e5e4fa411adb4..5f9dc5503c191 100644 --- a/docs/self-hosting/server-database/zeabur.mdx +++ b/docs/self-hosting/server-database/zeabur.mdx @@ -32,47 +32,45 @@ The template on Zeabur includes 4 services: Here is the process for deploying the LobeChat server database version on Zeabur: + ### Go to the template page on Zeabur -### Go to the template page on Zeabur + Go to the [LobeChat Database template page](https://zeabur.com/templates/RRSPSD) on Zeabur and click on the "Deploy" button. -Go to the [LobeChat Database template page](https://zeabur.com/templates/RRSPSD) on Zeabur and click on the "Deploy" button. + ### Fill in the required environment variables -### Fill in the required environment variables + After you click on the "Deploy" button, you will see a modal pop-up where you can fill in the required environment variables. -After you click on the "Deploy" button, you will see a modal pop-up where you can fill in the required environment variables. + Here are the environment variables you need to fill in: -Here are the environment variables you need to fill in: + - OpenAI API key: Your OpenAI API key to get responses from OpenAI. -- OpenAI API key: Your OpenAI API key to get responses from OpenAI. + - LobeChat Domain: A free subdomain with `.zeabur.app` suffix. -- LobeChat Domain: A free subdomain with `.zeabur.app` suffix. + - MinIO Public Domain: A free subdomain with `.zeabur.app` suffix for yout MinIO web port to enable public access for the uploaded files. -- MinIO Public Domain: A free subdomain with `.zeabur.app` suffix for yout MinIO web port to enable public access for the uploaded files. + - Logto Console Domain: A free subdomain with `.zeabur.app` suffix for your Logto console. -- Logto Console Domain: A free subdomain with `.zeabur.app` suffix for your Logto console. + - Logto API Domain: A free subdomain with `.zeabur.app` suffix for your Logto api. -- Logto API Domain: A free subdomain with `.zeabur.app` suffix for your Logto api. + ### Select a region and deploy -### Select a region and deploy + After you fill all the required environment variables, select a region where you want to deploy your LobeChat Database and click on the "Deploy" button. -After you fill all the required environment variables, select a region where you want to deploy your LobeChat Database and click on the "Deploy" button. + You will see another modal pop-up where you can see the deployment progress. -You will see another modal pop-up where you can see the deployment progress. + ### Configure Logto -### Configure Logto + After the deployment is done, you need to configure your Logto service to enable authrization. -After the deployment is done, you need to configure your Logto service to enable authrization. + Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs. You can check [this document](../advanced/auth.mdx) for a more detailed guide. -Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs. You can check [this document](../advanced/auth.mdx) for a more detailed guide. + Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables). -Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables). + For detailed configuration of Logto, refer to [this document](/docs/self-hosting/advanced/auth/next-auth/logto). -For detailed configuration of Logto, refer to [this document](/docs/self-hosting/advanced/auth/next-auth/logto). + ### Access your LobeChat Instance -### Access your LobeChat Instance - -Press on the `LobeChat-Database` and you can see the public domain you just created, click on it to access your LobeChat Database. - -You can also bind a custom domain for your services if you want, here is a guide on how to [bind a custom domain on Zeabur](https://zeabur.com/docs/deploy/domain-binding). + Press on the `LobeChat-Database` and you can see the public domain you just created, click on it to access your LobeChat Database. + You can also bind a custom domain for your services if you want, here is a guide on how to [bind a custom domain on Zeabur](https://zeabur.com/docs/deploy/domain-binding). diff --git a/docs/self-hosting/server-database/zeabur.zh-CN.mdx b/docs/self-hosting/server-database/zeabur.zh-CN.mdx index b1c572c4ef52c..a1d7fab2ae83a 100644 --- a/docs/self-hosting/server-database/zeabur.zh-CN.mdx +++ b/docs/self-hosting/server-database/zeabur.zh-CN.mdx @@ -29,41 +29,39 @@ tags: 这里是在 Zeabur 上部署 LobeChat 服务器数据库版的流程: + ### 前往 Zeabur 上的模板页面 -### 前往 Zeabur 上的模板页面 + 前往 [Zeabur 上的 LobeChat 数据库模板页面](https://zeabur.com/templates/RRSPSD) 并点击 "Deploy" 按钮。 -前往 [Zeabur 上的 LobeChat 数据库模板页面](https://zeabur.com/templates/RRSPSD) 并点击 "Deploy" 按钮。 + ### 填写必要的环境变量 -### 填写必要的环境变量 + 在你点击 “部署 “按钮后,你会看到一个模态弹窗,你可以在这里填写必要的环境变量。 -在你点击“部署“按钮后,你会看到一个模态弹窗,你可以在这里填写必要的环境变量。 + 以下是你需要填写的环境变量: -以下是你需要填写的环境变量: + - OpenAI API key: 你的 OpenAI API key 用于获取模型的访问权限。 + - LobeChat Domain: 一个免费的 `.zeabur.app` 后缀的域名。 + - MinIO Public Domain: 一个免费的 `.zeabur.app` 后缀的域名为了暴露 MinIO 服务以公开访问资源。 + - Logto Console Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的控制台。 + - Logto API Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的 API。 -- OpenAI API key: 你的 OpenAI API key 用于获取模型的访问权限。 -- LobeChat Domain: 一个免费的 `.zeabur.app` 后缀的域名。 -- MinIO Public Domain: 一个免费的 `.zeabur.app` 后缀的域名为了暴露 MinIO 服务以公开访问资源。 -- Logto Console Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的控制台。 -- Logto API Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的 API。 + ### 选择一个区域并部署 -### 选择一个区域并部署 + 在你填写完所有必要的环境变量后,选择一个你想要部署 LobeChat 数据库的区域并点击 “部署” 按钮。 -在你填写完所有必要的环境变量后,选择一个你想要部署 LobeChat 数据库的区域并点击“部署”按钮。 + 你会看到另一个模态弹窗,你可以在这里看到部署的进度。 -你会看到另一个模态弹窗,你可以在这里看到部署的进度。 + ### 配置 Logto -### 配置 Logto + 当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。你需要再进一步配置你的 Logto 服务。 -当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。你需要再进一步配置你的 Logto 服务。 + 使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。 -使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。 + Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。 -Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。 + ### 访问你的 LobeChat -### 访问你的 LobeChat - -按下 `LobeChat-Database` 你会看到你刚刚创建的公共域名,点击它以访问你的 LobeChat 数据库。 - -你可以选择绑定一个自定义域名,这里有一个关于如何在 Zeabur 上[绑定自定义域名](https://zeabur.com/docs/deploy/domain-binding)的指南。 + 按下 `LobeChat-Database` 你会看到你刚刚创建的公共域名,点击它以访问你的 LobeChat 数据库。 + 你可以选择绑定一个自定义域名,这里有一个关于如何在 Zeabur 上[绑定自定义域名](https://zeabur.com/docs/deploy/domain-binding)的指南。 diff --git a/docs/self-hosting/start.mdx b/docs/self-hosting/start.mdx index c1af7e400f8e9..4f5aa21e8a69f 100644 --- a/docs/self-hosting/start.mdx +++ b/docs/self-hosting/start.mdx @@ -35,8 +35,5 @@ You can follow the guide below for quick deployment of LobeChat: For users who are already familiar with LobeChat or need cross-device synchronization, you can deploy a version with a server-side database to access a more complete and powerful LobeChat. - + diff --git a/docs/self-hosting/start.zh-CN.mdx b/docs/self-hosting/start.zh-CN.mdx index 914a06aca81e2..9643918dd81bf 100644 --- a/docs/self-hosting/start.zh-CN.mdx +++ b/docs/self-hosting/start.zh-CN.mdx @@ -11,15 +11,17 @@ tags: - Vercel - 阿里云计算巢 - 个性化 + - 腾讯云 + - 腾讯轻量云 --- # 构建属于自己的 Lobe Chat -LobeChat 支持多种部署平台,包括 Vercel、Docker、 Docker Compose 和 阿里云计算巢 等,你可以选择适合自己的部署平台进行部署,构建属于自己的 Lobe Chat。 +LobeChat 支持多种部署平台,包括 Vercel、Docker、 Docker Compose 、阿里云计算巢 和腾讯轻量云 等,你可以选择适合自己的部署平台进行部署,构建属于自己的 Lobe Chat。 ## 快速部署 -对于第一次了解 LobeChat 的用户,我们推荐使用客户端数据库的模式快速部署,该模式的优势是一行指令/一个按钮即可快捷完成部署,便于你快速上手与体验 LobeChat。 +对于第一次了解 LobeChat 的用户,我们推荐使用客户端数据库的模式快速部署,该模式的优势是一行指令 / 一个按钮即可快捷完成部署,便于你快速上手与体验 LobeChat。 你可以通过以下指南快速部署 LobeChat: diff --git a/docs/usage/agents/agent-organization.mdx b/docs/usage/agents/agent-organization.mdx index 477dcccec2264..3ecdeff625d75 100644 --- a/docs/usage/agents/agent-organization.mdx +++ b/docs/usage/agents/agent-organization.mdx @@ -14,11 +14,7 @@ tags: # Assistant Organization Guide -{'Assistant +{'Assistant LobeChat provides a rich variety of AI assistant resources. Users can easily add various assistants through the assistant market, offering a wide range of application scenarios for AI applications. @@ -30,39 +26,27 @@ Firstly, LobeChat's AI assistants support organization through grouping. You can ### Assistant Settings -{'Assistant +{'Assistant - In the menu of an individual assistant, selecting the `Move to Group` option can quickly categorize the assistant into the specified group. - If you don't find the group you want, you can choose `Add Group` to quickly create a new group. ### Group Settings -{'Group +{'Group - In the group menu, you can quickly create a new assistant under that group. - Clicking the `Group Management` button allows you to `rename`, `delete`, `sort`, and perform other operations on all groups. ## Assistant Search -{'Assistant +{'Assistant - At the top of the assistant list, you can use the assistant search function to easily locate the assistant you need using keywords. ## Assistant Pinning -{'Assistant +{'Assistant - In the assistant menu, you can use the `Pin` function to pin the assistant to the top. - After pinning an assistant, a pinned area will appear at the top of the assistant list, displaying all pinned assistants. diff --git a/docs/usage/agents/agent-organization.zh-CN.mdx b/docs/usage/agents/agent-organization.zh-CN.mdx index 5ce6aa52e4e60..5bff869c49e5e 100644 --- a/docs/usage/agents/agent-organization.zh-CN.mdx +++ b/docs/usage/agents/agent-organization.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 助手组织指南 -{'助手组织'} +{'助手组织'} LobeChat 提供了丰富的 AI 助手资源,用户可以通过助手市场方便地添加各类助手,为 AI 应用提供了广泛的应用场景。 @@ -28,39 +24,27 @@ LobeChat 提供了丰富的 AI 助手资源,用户可以通过助手市场方 ### 助手设置 -{'助手分组'} +{'助手分组'} - 在单个助手的菜单中,选择`移动到分组`选项可以快速将该助手归类到指定分组。 - 如果没有你想要的分组,可以选择`添加分组`,快速创建一个新的分组。 ### 分组设置 -{'分组菜单'} +{'分组菜单'} - 在分组菜单中,可以快速在该分组下新建助手 - 点击`分组管理`按钮可以对所有分组进行`重命名`、`删除`、`排序`等操作。 ## 助手搜索 -{'助手搜索'} +{'助手搜索'} - 在助手列表的顶部,您可以通过助手搜索功能,方便地使用关键词定位到您所需的助手。 ## 助手固定 -{'助手固定'} +{'助手固定'} - 在助手菜单中,你可以使用`固定`功能将该助手固定在顶部。 - 固定助手后,助手列表的上方将出现一个固定区域,显示所有已固定的助手列表。 diff --git a/docs/usage/agents/concepts.mdx b/docs/usage/agents/concepts.mdx index 3589579784516..61cba73950938 100644 --- a/docs/usage/agents/concepts.mdx +++ b/docs/usage/agents/concepts.mdx @@ -21,8 +21,8 @@ In the official ChatGPT application, there is only the concept of "topics." As s {'ChatGPT However, in our usage, we have found that this model has many issues. For example, the information indexing of historical conversations is too scattered. Additionally, when dealing with repetitive tasks, it is difficult to have a stable entry point. For instance, if I want ChatGPT to help me translate a document, in this model, I would need to constantly create new topics and then set up the translation prompt I had previously created. When there are high-frequency tasks, this will result in a very inefficient interaction format. @@ -34,8 +34,8 @@ Therefore, in LobeChat, we have introduced the concept of **Agents**. An agent i {'Topics At the same time, we have integrated topics into each agent. The benefit of this approach is that each agent has an independent topic list. You can choose the corresponding agent based on the current task and quickly switch between historical conversation records. This method is more in line with users' habits in common chat software, improving interaction efficiency. diff --git a/docs/usage/agents/concepts.zh-CN.mdx b/docs/usage/agents/concepts.zh-CN.mdx index d76dcad0f2dd5..cfee63f897629 100644 --- a/docs/usage/agents/concepts.zh-CN.mdx +++ b/docs/usage/agents/concepts.zh-CN.mdx @@ -18,8 +18,8 @@ tags: {'ChatGPT 但在我们的使用过程中其实会发现这种模式存在很多问题,比如历史对话的信息索引过于分散问题,同时当处理一些重复任务时很难有一个稳定的入口,比如我希望有一个稳定的入口可以让 ChatGPT 帮助我翻译文档,在这个模式下,我需要不断新建新的话题同时再设置我之前创建好的翻译 Prompt 设定,当有高频任务存在时,这将是一个效率很低的交互形式。 @@ -31,8 +31,8 @@ tags: {'「话题」与「助手」'} 与此同时,我们将话题索引到每个助手内部。这样做的好处是,每个助手都有一个独立的话题列表,你可以根据当前任务选择对应的助手,并快速切换历史对话记录。这种方式更符合用户对常见聊天软件的使用习惯,提高了交互的效率。 diff --git a/docs/usage/agents/custom-agent.mdx b/docs/usage/agents/custom-agent.mdx index c34eac5a68fe8..34a36e2e9ef7c 100644 --- a/docs/usage/agents/custom-agent.mdx +++ b/docs/usage/agents/custom-agent.mdx @@ -24,8 +24,8 @@ If you are a beginner in Prompt writing, you might want to browse the assistant {'Add ## `B` Create a custom assistant diff --git a/docs/usage/agents/custom-agent.zh-CN.mdx b/docs/usage/agents/custom-agent.zh-CN.mdx index 2011e0708e7b2..62b6dc7a2a50f 100644 --- a/docs/usage/agents/custom-agent.zh-CN.mdx +++ b/docs/usage/agents/custom-agent.zh-CN.mdx @@ -22,8 +22,8 @@ tags: {'通过角色市场添加'} ## `B` 通过新建自定义助手 diff --git a/docs/usage/agents/model.mdx b/docs/usage/agents/model.mdx index b5131fb0cad61..e8056cbbae7c6 100644 --- a/docs/usage/agents/model.mdx +++ b/docs/usage/agents/model.mdx @@ -43,10 +43,10 @@ This parameter controls the randomness of the model's output. The higher the val ### `top_p` -Top_p is also a sampling parameter, but it differs from temperature in its sampling method. Before outputting, the model generates a bunch of tokens, and these tokens are ranked based on their quality. In the top-p sampling mode, the candidate word list is dynamic, and tokens are selected from the tokens based on a percentage. Top_p introduces randomness in token selection, allowing other high-scoring tokens to have a chance of being selected, rather than always choosing the highest-scoring one. +`top_p` is also a sampling parameter, but it differs from temperature in its sampling method. Before outputting, the model generates a bunch of tokens, and these tokens are ranked based on their quality. In the top-p sampling mode, the candidate word list is dynamic, and tokens are selected from the tokens based on a percentage. Top\_p introduces randomness in token selection, allowing other high-scoring tokens to have a chance of being selected, rather than always choosing the highest-scoring one. - Top\_p is similar to randomness, and it is generally not recommended to change it together with + `top_p` is similar to randomness, and it is generally not recommended to change it together with the randomness of temperature. @@ -75,5 +75,21 @@ It is a mechanism that penalizes frequently occurring new vocabulary in the text - `-2.0` When the morning news started broadcasting, I found that my TV now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now now **(The highest frequency word is "now", accounting for 44.79%)** - `-1.0` He always watches the news in the early morning, in front of the TV watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch watch **(The highest frequency word is "watch", accounting for 57.69%)** - `0.0` When the morning sun poured into the small diner, a tired postman appeared at the door, carrying a bag of letters in his hands. The owner warmly prepared a breakfast for him, and he started sorting the mail while enjoying his breakfast. **(The highest frequency word is "of", accounting for 8.45%)** -- `1.0` A girl in deep sleep was woken up by a warm ray of sunshine, she saw the first ray of morning light, surrounded by birdsong and flowers, everything was full of vitality. \_ (The highest frequency word is "of", accounting for 5.45%) -- `2.0` Every morning, he would sit on the balcony to have breakfast. Under the soft setting sun, everything looked very peaceful. However, one day, when he was about to pick up his breakfast, an optimistic little bird flew by, bringing him a good mood for the day. \_ (The highest frequency word is "of", accounting for 4.94%) +- `1.0` A girl in deep sleep was woken up by a warm ray of sunshine, she saw the first ray of morning light, surrounded by birdsong and flowers, everything was full of vitality. (The highest frequency word is "of", accounting for 5.45%) +- `2.0` Every morning, he would sit on the balcony to have breakfast. Under the soft setting sun, everything looked very peaceful. However, one day, when he was about to pick up his breakfast, an optimistic little bird flew by, bringing him a good mood for the day. (The highest frequency word is "of", accounting for 4.94%) + +
+ +### `reasoning_effort` + +The `reasoning_effort` parameter controls the strength of the reasoning process. This setting affects the depth of reasoning the model performs when generating a response. The available values are **`low`**, **`medium`**, and **`high`**, with the following meanings: + +- **low**: Lower reasoning effort, resulting in faster response times. Suitable for scenarios where quick responses are needed, but it may sacrifice some reasoning accuracy. +- **medium** (default): Balances reasoning accuracy and response speed, suitable for most scenarios. +- **high**: Higher reasoning effort, producing more detailed and complex responses, but slower response times and greater token consumption. + +By adjusting the `reasoning_effort` parameter, you can find an appropriate balance between response speed and reasoning depth based on your needs. For example, in conversational scenarios, if fast responses are a priority, you can choose low reasoning effort; if more complex analysis or reasoning is needed, you can opt for high reasoning effort. + + + This parameter is only applicable to reasoning models, such as OpenAI's `o1`, `o1-mini`, `o3-mini`, etc. + diff --git a/docs/usage/agents/model.zh-CN.mdx b/docs/usage/agents/model.zh-CN.mdx index 95264e4f4e910..578dd4096ce5a 100644 --- a/docs/usage/agents/model.zh-CN.mdx +++ b/docs/usage/agents/model.zh-CN.mdx @@ -41,9 +41,9 @@ LLM 看似很神奇,但本质还是一个概率问题,神经网络根据输 ### `top_p` -核采样 top_p 也是采样参数,跟 temperature 不一样的采样方式。模型在输出之前,会生成一堆 token,这些 token 根据质量高低排名,核采样模式中候选词列表是动态的,从 tokens 里按百分比选择候选词。 top_p 为选择 token 引入了随机性,让其他高分的 token 有被选择的机会,不会总是选最高分的。 +核采样 `top_p` 也是采样参数,跟 temperature 不一样的采样方式。模型在输出之前,会生成一堆 token,这些 token 根据质量高低排名,核采样模式中候选词列表是动态的,从 tokens 里按百分比选择候选词。 top\_p 为选择 token 引入了随机性,让其他高分的 token 有被选择的机会,不会总是选最高分的。 -top\_p 与随机性类似,一般来说不建议和随机性 temperature 一起更改 +`top_p` 与随机性类似,一般来说不建议和随机性 temperature 一起更改
@@ -67,8 +67,24 @@ Presence Penalty 参数可以看作是对生成文本中重复内容的一种惩 是一种机制,通过对文本中频繁出现的新词汇施加惩罚,以减少模型重复同一词语的可能性,值越大,越有可能降低重复字词。 -- `-2.0` 当早间新闻开始播出,我发现我家电视现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在 _(频率最高的词是 “现在”,占比 44.79%)_ -- `-1.0` 他总是在清晨看新闻,在电视前看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看 _(频率最高的词是 “看”,占比 57.69%)_ +- `-2.0` 当早间新闻开始播出,我发现我家电视现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在现在 *(频率最高的词是 “现在”,占比 44.79%)* +- `-1.0` 他总是在清晨看新闻,在电视前看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看看 *(频率最高的词是 “看”,占比 57.69%)* - `0.0` 当清晨的阳光洒进小餐馆时,一名疲倦的邮递员出现在门口,他的手中提着一袋信件。店主热情地为他准备了一份早餐,他在享用早餐的同时开始整理邮件。**(频率最高的词是 “的”,占比 8.45%)** -- `1.0` 一个深度睡眠的女孩被一阵温暖的阳光唤醒,她看到了早晨的第一缕阳光,周围是鸟语花香,一切都充满了生机。_(频率最高的词是 “的”,占比 5.45%)_ -- `2.0` 每天早上,他都会在阳台上坐着吃早餐。在柔和的夕阳照耀下,一切看起来都非常宁静。然而有一天,当他准备端起早餐的时候,一只乐观的小鸟飞过,给他带来了一天的好心情。 _(频率最高的词是 “的”,占比 4.94%)_ +- `1.0` 一个深度睡眠的女孩被一阵温暖的阳光唤醒,她看到了早晨的第一缕阳光,周围是鸟语花香,一切都充满了生机。*(频率最高的词是 “的”,占比 5.45%)* +- `2.0` 每天早上,他都会在阳台上坐着吃早餐。在柔和的夕阳照耀下,一切看起来都非常宁静。然而有一天,当他准备端起早餐的时候,一只乐观的小鸟飞过,给他带来了一天的好心情。 *(频率最高的词是 “的”,占比 4.94%)* + +
+ +### `reasoning_effort` + +`reasoning_effort` 参数用于控制推理过程的强度。此参数的设置会影响模型在生成回答时的推理深度。可选值包括 **`low`**、**`medium`** 和 **`high`**,具体含义如下: + +- **low(低)**:推理强度较低,生成速度较快,适用于需要快速响应的场景,但可能牺牲一定的推理精度。 +- **medium(中,默认值)**:平衡推理精度与响应速度,适用于大多数场景。 +- **high(高)**:推理强度较高,生成更为详细和复杂的回答,但响应时间较长,且消耗更多的 Token。 + +通过调整 `reasoning_effort` 参数,可以根据需求在生成速度与推理深度之间找到适合的平衡。例如,在对话场景中,如果更关注快速响应,可以选择低推理强度;如果需要更复杂的分析或推理,可以选择高推理强度。 + + + 该参数仅适用于推理模型,如 OpenAI 的 `o1`、`o1-mini`、`o3-mini` 等。 + diff --git a/docs/usage/agents/prompt.mdx b/docs/usage/agents/prompt.mdx index 6d38cf6b787e0..9a9e09413b45a 100644 --- a/docs/usage/agents/prompt.mdx +++ b/docs/usage/agents/prompt.mdx @@ -30,7 +30,7 @@ Generative AI is very useful, but it requires human guidance. In most cases, gen Let's look at a basic discussion prompt example: -> _"What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?"_ +> *"What are the most urgent environmental issues facing our planet, and what actions can individuals take to help address these issues?"* We can convert it into a simple prompt for the assistant to answer the following questions: placed at the front. @@ -54,17 +54,16 @@ The second prompt generates longer output and better structure. The use of the t There are several ways to improve the quality and effectiveness of prompts: -- **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations. -- **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic. -- **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results. - + - **Be Clear About Your Needs:** The model's output will strive to meet your needs, so if your needs are not clear, the output may not meet expectations. + - **Use Correct Grammar and Spelling:** The model will try to mimic your language style, so if your language style is problematic, the output may also be problematic. + - **Provide Sufficient Contextual Information:** The model will generate output based on the contextual information you provide, so if the information is insufficient, it may not produce the desired results. After formulating effective prompts for discussing issues, you now need to refine the generated results. This may involve adjusting the output to fit constraints such as word count or combining concepts from different generated results. A simple method of iteration is to generate multiple outputs and review them to understand the concepts and structures being used. Once the outputs have been evaluated, you can select the most suitable ones and combine them into a coherent response. Another iterative method is to start small and **gradually expand**. This requires more than one prompt: an initial prompt for drafting the initial one or two paragraphs, followed by additional prompts to expand on the content already written. Here is a potential philosophical discussion prompt: -> _"Is mathematics an invention or a discovery? Use careful reasoning to explain your answer."_ +> *"Is mathematics an invention or a discovery? Use careful reasoning to explain your answer."* Add it to a simple prompt as follows: diff --git a/docs/usage/agents/prompt.zh-CN.mdx b/docs/usage/agents/prompt.zh-CN.mdx index 31578925bf490..5c2e7de6cf4eb 100644 --- a/docs/usage/agents/prompt.zh-CN.mdx +++ b/docs/usage/agents/prompt.zh-CN.mdx @@ -24,7 +24,7 @@ tags: 让我们看一个基本的讨论问题的例子: -> _"我们星球面临的最紧迫的环境问题是什么,个人可以采取哪些措施来帮助解决这些问题?"_ +> *"我们星球面临的最紧迫的环境问题是什么,个人可以采取哪些措施来帮助解决这些问题?"* 我们可以将其转化为简单的助手提示,将回答以下问题:放在前面。 @@ -50,17 +50,16 @@ tags: 提升 prompt 质量和效果的方法主要有以下几点: -- **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。 -- **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。 -- **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。 - + - **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。 + - **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。 + - **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。 在为讨论问题制定有效的提示后,您现在需要细化生成的结果。这可能涉及到调整输出以符合诸如字数等限制,或将不同生成的结果的概念组合在一起。 迭代的一个简单方法是生成多个输出并查看它们,以了解正在使用的概念和结构。一旦评估了输出,您就可以选择最合适的输出并将它们组合成一个连贯的回答。另一种迭代的方法是逐步开始,然后**逐步扩展**。这需要不止一个提示:一个起始提示,用于撰写最初的一两段,然后是其他提示,以扩展已经写过的内容。以下是一个潜在的哲学讨论问题: -> _"数学是发明还是发现?用仔细的推理来解释你的答案。"_ +> *"数学是发明还是发现?用仔细的推理来解释你的答案。"* 将其添加到一个简单的提示中,如下所示: diff --git a/docs/usage/agents/topics.mdx b/docs/usage/agents/topics.mdx index 1c8f2965faa24..88048a8dfc9cd 100644 --- a/docs/usage/agents/topics.mdx +++ b/docs/usage/agents/topics.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' +} /> - **Save Topic:** During a conversation, if you want to save the current context and start a new topic, you can click the save button next to the send button. diff --git a/docs/usage/agents/topics.zh-CN.mdx b/docs/usage/agents/topics.zh-CN.mdx index 2a903387f9e33..bdf15271bf5fd 100644 --- a/docs/usage/agents/topics.zh-CN.mdx +++ b/docs/usage/agents/topics.zh-CN.mdx @@ -17,8 +17,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' - } +'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/279602496-fd72037a-735e-4cc2-aa56-2994bceaba81.png' +} /> - **保存话题:** 在聊天过程中,如果想要保存当前上下文并开启新的话题,可以点击发送按钮旁边的保存按钮。 diff --git a/docs/usage/features/agent-market.mdx b/docs/usage/features/agent-market.mdx index fca028fb494e6..803769058dc84 100644 --- a/docs/usage/features/agent-market.mdx +++ b/docs/usage/features/agent-market.mdx @@ -19,8 +19,8 @@ tags: borderless cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' - } +'https://github.com/user-attachments/assets/b3ab6e35-4fbc-468d-af10-e3e0c687350f' +} /> In LobeChat's Assistant Market, creators can discover a vibrant and innovative community that brings together numerous carefully designed assistants. These assistants not only play a crucial role in work scenarios but also provide great convenience in the learning process. Our market is not just a showcase platform, but also a collaborative space. Here, everyone can contribute their wisdom and share their personally developed assistants. diff --git a/docs/usage/features/agent-market.zh-CN.mdx b/docs/usage/features/agent-market.zh-CN.mdx index 91d6927109bb3..38f113643abb5 100644 --- a/docs/usage/features/agent-market.zh-CN.mdx +++ b/docs/usage/features/agent-market.zh-CN.mdx @@ -18,8 +18,8 @@ tags: alt={'助手市场'} cover src={ - 'https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/268670869-f1ffbf66-42b6-42cf-a937-9ce1f8328514.png' - } +'https://github.com/user-attachments/assets/b3ab6e35-4fbc-468d-af10-e3e0c687350f' +} /> 在 LobeChat 的助手市场中,创作者们可以发现一个充满活力和创新的社区,它汇聚了众多精心设计的助手,这些助手不仅在工作场景中发挥着重要作用,也在学习过程中提供了极大的便利。我们的市场不仅是一个展示平台,更是一个协作的空间。在这里,每个人都可以贡献自己的智慧,分享个人开发的助手。 diff --git a/docs/usage/features/artifacts.mdx b/docs/usage/features/artifacts.mdx new file mode 100644 index 0000000000000..dcbe9236a4cb5 --- /dev/null +++ b/docs/usage/features/artifacts.mdx @@ -0,0 +1,23 @@ +--- +title: Artifacts Support +description: >- + Discover the power of Claude Artifacts for dynamic content creation and + visualization. +tags: + - Claude Artifacts + - LobeChat + - AI Interaction + - Dynamic Content +--- + +# Artifacts Support + +{'Artifacts'} + +Experience the power of Claude Artifacts, now integrated into LobeChat. This revolutionary feature expands the boundaries of AI-human interaction, enabling real-time creation and visualization of diverse content formats. + +Create and visualize with unprecedented flexibility: + +- Generate and display dynamic SVG graphics +- Build and render interactive HTML pages in real-time +- Produce professional documents in multiple formats diff --git a/docs/usage/features/artifacts.zh-CN.mdx b/docs/usage/features/artifacts.zh-CN.mdx new file mode 100644 index 0000000000000..07b2b3e7f49f2 --- /dev/null +++ b/docs/usage/features/artifacts.zh-CN.mdx @@ -0,0 +1,22 @@ +--- +title: 支持白板 (Artifacts) +description: 体验 LobeChat 的 Claude Artifacts,实时创建和可视化内容。 +tags: + - Claude Artifacts + - LobeChat + - 实时创作 + - 动态 SVG + - 交互式 HTML +--- + +# 支持白板 (Artifacts) + +{'Artifacts'} + +体验集成于 LobeChat 的 Claude Artifacts 能力。这项革命性功能突破了 AI 人机交互的边界,让您能够实时创建和可视化各种格式的内容。 + +以前所未有的灵活度进行创作与可视化: + +- 生成并展示动态 SVG 图形 +- 实时构建与渲染交互式 HTML 页面 +- 输出多种格式的专业文档 diff --git a/docs/usage/features/auth.mdx b/docs/usage/features/auth.mdx index ba9afb9719525..4bc91b4ee6570 100644 --- a/docs/usage/features/auth.mdx +++ b/docs/usage/features/auth.mdx @@ -17,11 +17,7 @@ tags: # Support Multi-User Management -{'Identity +{'Identity In modern applications, user management and identity verification are essential functions. To meet the diverse needs of different users, LobeChat provides two main user authentication and management solutions: `next-auth` and `Clerk`. Whether you are looking for simple user registration and login or need advanced multi-factor authentication and user management, LobeChat can flexibly accommodate your requirements. diff --git a/docs/usage/features/auth.zh-CN.mdx b/docs/usage/features/auth.zh-CN.mdx index 983c0c7b4dc75..32dda43ee6648 100644 --- a/docs/usage/features/auth.zh-CN.mdx +++ b/docs/usage/features/auth.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 身份验证系统 / 多用户管理支持 -{'身份验证系统'} +{'身份验证系统'} 在现代应用中,用户管理和身份验证是至关重要的功能。为满足不同用户的多样化需求,LobeChat 提供了两种主要的用户认证和管理方案:`next-auth` 和 `Clerk`。无论您是追求简便的用户注册登录,还是需要更高级的多因素认证和用户管理,LobeChat 都可以灵活实现。 diff --git a/docs/usage/features/branching-conversations.mdx b/docs/usage/features/branching-conversations.mdx new file mode 100644 index 0000000000000..1cc5d4f135a2a --- /dev/null +++ b/docs/usage/features/branching-conversations.mdx @@ -0,0 +1,21 @@ +--- +title: Branching Conversations +description: Explore dynamic AI chats with Branching Conversations for deeper interactions. +tags: + - Branching Conversations + - AI Chat + - Dynamic Conversations +--- + +# Branching Conversations + +{'Branching + +Introducing a more natural and flexible way to chat with AI. With Branch Conversations, your discussions can flow in multiple directions, just like human conversations do. Create new conversation branches from any message, giving you the freedom to explore different paths while preserving the original context. + +Choose between two powerful modes: + +- **Continuation Mode:** Seamlessly extend your current discussion while maintaining valuable context +- **Standalone Mode:** Start fresh with a new topic based on any previous message + +This groundbreaking feature transforms linear conversations into dynamic, tree-like structures, enabling deeper exploration of ideas and more productive interactions. diff --git a/docs/usage/features/branching-conversations.zh-CN.mdx b/docs/usage/features/branching-conversations.zh-CN.mdx new file mode 100644 index 0000000000000..16caf102f55a0 --- /dev/null +++ b/docs/usage/features/branching-conversations.zh-CN.mdx @@ -0,0 +1,21 @@ +--- +title: 分支对话 +description: 探索分支对话功能,提升 AI 交流的自然性与灵活性。 +tags: + - 分支对话 + - AI 交流 + - 对话模式 +--- + +# 分支对话 + +{'Branching + +为您带来更自然、更灵活的 AI 对话方式。通过分支对话功能,您的讨论可以像人类对话一样自然延伸。在任意消息处创建新的对话分支,让您在保留原有上下文的同时,自由探索不同的对话方向。 + +两种强大模式任您选择: + +- **延续模式**:无缝延展当前讨论,保持宝贵的对话上下文 +- **独立模式**:基于任意历史消息,开启全新话题探讨 + +这项突破性功能将线性对话转变为动态的树状结构,让您能够更深入地探索想法,实现更高效的互动体验。 diff --git a/docs/usage/features/cot.mdx b/docs/usage/features/cot.mdx new file mode 100644 index 0000000000000..f901182774e11 --- /dev/null +++ b/docs/usage/features/cot.mdx @@ -0,0 +1,18 @@ +--- +title: Chain of Thought +description: >- + Explore AI's decision-making with Chain of Thought visualization for clear + insights. +tags: + - AI Reasoning + - Chain of Thought + - CoT Visualization +--- + +# Chain of Thought + +{'Chain + +Experience AI reasoning like never before. Watch as complex problems unfold step by step through our innovative Chain of Thought (CoT) visualization. This breakthrough feature provides unprecedented transparency into AI's decision-making process, allowing you to observe how conclusions are reached in real-time. + +By breaking down complex reasoning into clear, logical steps, you can better understand and validate the AI's problem-solving approach. Whether you're debugging, learning, or simply curious about AI reasoning, CoT visualization transforms abstract thinking into an engaging, interactive experience. diff --git a/docs/usage/features/cot.zh-CN.mdx b/docs/usage/features/cot.zh-CN.mdx new file mode 100644 index 0000000000000..c2890b4614a71 --- /dev/null +++ b/docs/usage/features/cot.zh-CN.mdx @@ -0,0 +1,18 @@ +--- +title: 思维链 (CoT) +description: 体验思维链 (CoT) 的 AI 推理过程,了解复杂问题的解析步骤。 +tags: + - 思维链 + - AI 推理 + - 可视化 + - 逻辑步骤 + - 决策过程 +--- + +# 思维链 (CoT) + +{'思维链 + +体验前所未有的 AI 推理过程。通过创新的思维链(CoT)可视化功能,您可以实时观察复杂问题是如何一步步被解析的。这项突破性的功能为 AI 的决策过程提供了前所未有的透明度,让您能够清晰地了解结论是如何得出的。 + +通过将复杂的推理过程分解为清晰的逻辑步骤,您可以更好地理解和验证 AI 的解题思路。无论您是在调试问题、学习知识,还是单纯对 AI 推理感兴趣,思维链可视化都能将抽象思维转化为一种引人入胜的互动体验。 diff --git a/docs/usage/features/database.mdx b/docs/usage/features/database.mdx index 83ef17bd15a5e..db0d345699038 100644 --- a/docs/usage/features/database.mdx +++ b/docs/usage/features/database.mdx @@ -16,11 +16,7 @@ tags: # Local / Cloud Database -{'Local +{'Local In modern application development, the choice of data storage solution is crucial. To meet the needs of different users, LobeChat offers flexible configurations that support both local and server-side databases. Whether you prioritize data privacy and control or seek a convenient user experience, LobeChat can provide excellent solutions for you. diff --git a/docs/usage/features/database.zh-CN.mdx b/docs/usage/features/database.zh-CN.mdx index 172afcadc6d1c..68b7dc4734acb 100644 --- a/docs/usage/features/database.zh-CN.mdx +++ b/docs/usage/features/database.zh-CN.mdx @@ -12,11 +12,7 @@ tags: # 本地 / 云端数据存储 -{'本地 +{'本地 在现代应用开发中,数据存储方案的选择至关重要。为了满足不同用户的需求,LobeChat 提供了同时支持本地数据库和服务端数据库的灵活配置。无论您是注重数据隐私与掌控,还是追求便捷的使用体验,LobeChat 都能为您提供卓越的解决方案。 diff --git a/docs/usage/features/knowledge-base.mdx b/docs/usage/features/knowledge-base.mdx new file mode 100644 index 0000000000000..151fadfd6d0e3 --- /dev/null +++ b/docs/usage/features/knowledge-base.mdx @@ -0,0 +1,24 @@ +--- +title: File Upload / Knowledge Base +description: >- + Discover LobeChat's file upload and knowledge base features for enhanced user + experience. +tags: + - File Upload + - Knowledge Base + - LobeChat + - User Management + - File Management +--- + +# File Upload / Knowledge Base + +{'File + +LobeChat supports file upload and knowledge base functionality. You can upload various types of files including documents, images, audio, and video, as well as create knowledge bases, making it convenient for users to manage and search for files. Additionally, you can utilize files and knowledge base features during conversations, enabling a richer dialogue experience. + +