mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-20 06:15:58 +00:00
Compare commits
6 Commits
v1.7.2
..
style/sync
| Author | SHA1 | Date | |
|---|---|---|---|
| 3aa8be4a13 | |||
| 4d573ab697 | |||
| f83b99197e | |||
| 6a2961dd4a | |||
| 33ad7e490f | |||
| dde83026b8 |
@@ -104,14 +104,6 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
|
||||
# MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### DeepSeek AI ####
|
||||
|
||||
# DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
### Qwen AI ####
|
||||
|
||||
# QWEN_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
########################################
|
||||
############ Market Service ############
|
||||
########################################
|
||||
@@ -129,55 +121,3 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
||||
# set the plugin settings
|
||||
# the format is `plugin-identifier:key1=value1;key2=value2`, multiple settings fields are separated by semicolons `;`, multiple plugin settings are separated by commas `,`.
|
||||
# PLUGIN_SETTINGS=search-engine:SERPAPI_API_KEY=xxxxx
|
||||
|
||||
|
||||
########################################
|
||||
##### S3 Object Storage Service ########
|
||||
########################################
|
||||
|
||||
# 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 access domain for the bucket
|
||||
#NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
|
||||
# Bucket region, such as us-west-1, generally not needed to add
|
||||
# but some service providers may require configuration
|
||||
# S3_REGION=us-west-1
|
||||
|
||||
|
||||
########################################
|
||||
############ Auth Service ##############
|
||||
########################################
|
||||
|
||||
|
||||
# Clerk related configurations
|
||||
|
||||
# Clerk public key and secret key
|
||||
#NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
#CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# you need to config the clerk webhook secret key if you want to use the clerk with database
|
||||
#CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
|
||||
########################################
|
||||
########## Server Database #############
|
||||
########################################
|
||||
|
||||
# Specify the service mode as server if you want to use the server database
|
||||
#NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres database URL
|
||||
#DATABASE_URL=postgres://username:password@host:port/database
|
||||
|
||||
# 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=
|
||||
|
||||
+2
-1
@@ -10,8 +10,9 @@ coverage
|
||||
|
||||
# test
|
||||
jest*
|
||||
_test_
|
||||
__test__
|
||||
*.test.ts
|
||||
*.test.tsx
|
||||
|
||||
# umi
|
||||
.umi
|
||||
|
||||
@@ -5,64 +5,53 @@ labels: ['🐛 Bug']
|
||||
body:
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '📦 Environment'
|
||||
multiple: true
|
||||
label: '💻 Operating System'
|
||||
options:
|
||||
- 'Official Preview'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
- 'Netlify'
|
||||
- 'Docker'
|
||||
- 'Other'
|
||||
- Windows
|
||||
- macOS
|
||||
- Ubuntu
|
||||
- Other Linux
|
||||
- iOS
|
||||
- Android
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: '📌 Version'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '💻 Operating System'
|
||||
multiple: true
|
||||
label: '📦 Environment'
|
||||
options:
|
||||
- 'Windows'
|
||||
- 'macOS'
|
||||
- 'Ubuntu'
|
||||
- 'Other Linux'
|
||||
- 'iOS'
|
||||
- 'Android'
|
||||
- 'Other'
|
||||
- Official Preview
|
||||
- Vercel / Zeabur / Sealos
|
||||
- Docker
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '🌐 Browser'
|
||||
multiple: true
|
||||
options:
|
||||
- 'Chrome'
|
||||
- 'Edge'
|
||||
- 'Safari'
|
||||
- 'Firefox'
|
||||
- 'Other'
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Firefox
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🐛 Bug Description'
|
||||
description: A clear and concise description of the bug, if the above option is `Other`, please also explain in detail.
|
||||
description: A clear and concise description of the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 Recurrence Steps'
|
||||
description: A clear and concise description of how to recurrence.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 Expected Behavior'
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 Recurrence Steps'
|
||||
description: A clear and concise description of how to recurrence.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📝 Additional Information'
|
||||
|
||||
@@ -5,64 +5,54 @@ labels: ['🐛 Bug']
|
||||
body:
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '📦 部署环境'
|
||||
multiple: true
|
||||
label: '💻 系统环境'
|
||||
options:
|
||||
- 'Official Preview'
|
||||
- 'Vercel'
|
||||
- 'Zeabur'
|
||||
- 'Sealos'
|
||||
- 'Netlify'
|
||||
- 'Docker'
|
||||
- 'Other'
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: '📌 软件版本'
|
||||
- Windows
|
||||
- macOS
|
||||
- Ubuntu
|
||||
- Other Linux
|
||||
- iOS
|
||||
- Android
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '💻 系统环境'
|
||||
multiple: true
|
||||
label: '📦 部署环境'
|
||||
options:
|
||||
- 'Windows'
|
||||
- 'macOS'
|
||||
- 'Ubuntu'
|
||||
- 'Other Linux'
|
||||
- 'iOS'
|
||||
- 'Android'
|
||||
- 'Other'
|
||||
- Official Preview
|
||||
- Vercel / Zeabur / Sealos
|
||||
- Docker
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: '🌐 浏览器'
|
||||
multiple: true
|
||||
options:
|
||||
- 'Chrome'
|
||||
- 'Edge'
|
||||
- 'Safari'
|
||||
- 'Firefox'
|
||||
- 'Other'
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Firefox
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🐛 问题描述'
|
||||
description: 请提供一个清晰且简洁的问题描述,若上述选项为`Other`,也请详细说明。
|
||||
description: 请提供一个清晰且简洁的问题描述。
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 复现步骤'
|
||||
description: 请提供一个清晰且简洁的描述,说明如何复现问题。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '🚦 期望结果'
|
||||
description: 请提供一个清晰且简洁的描述,说明您期望发生什么。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📷 复现步骤'
|
||||
description: 请提供一个清晰且简洁的描述,说明如何复现问题。
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: '📝 补充信息'
|
||||
|
||||
@@ -8,17 +8,6 @@ jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -33,16 +22,8 @@ jobs:
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
|
||||
- name: Test Server Coverage
|
||||
run: bun run test-server:coverage
|
||||
env:
|
||||
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
||||
DATABASE_DRIVER: node
|
||||
NEXT_PUBLIC_SERVICE_MODE: server
|
||||
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
||||
|
||||
- name: Test App Coverage
|
||||
run: bun run test-app:coverage
|
||||
- name: Test
|
||||
run: bun run test
|
||||
|
||||
- name: Release
|
||||
run: bun run release
|
||||
|
||||
@@ -7,7 +7,7 @@ permissions:
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */6 * * *' # every 6 hours
|
||||
- cron: '0 * * * *' # every hour
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -1,23 +1,9 @@
|
||||
name: Test CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -32,27 +18,10 @@ jobs:
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
|
||||
- name: Test Server Coverage
|
||||
run: bun run test-server:coverage
|
||||
env:
|
||||
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
||||
DATABASE_DRIVER: node
|
||||
NEXT_PUBLIC_SERVICE_MODE: server
|
||||
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
||||
- name: Test and coverage
|
||||
run: bun run test:coverage
|
||||
|
||||
- name: Upload Server coverage to Codecov
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage/server/lcov.info
|
||||
flags: server
|
||||
|
||||
- name: Test App Coverage
|
||||
run: bun run test-app:coverage
|
||||
|
||||
- name: Upload App Coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage/app/lcov.info
|
||||
flags: app
|
||||
token: ${{ secrets.CODECOV_TOKEN }} # required
|
||||
|
||||
@@ -60,4 +60,3 @@ sitemap*.xml
|
||||
robots.txt
|
||||
|
||||
*.patch
|
||||
*.pdf
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ module.exports = defineConfig({
|
||||
'vi-VN',
|
||||
],
|
||||
temperature: 0,
|
||||
modelName: 'gpt-4o-mini',
|
||||
modelName: 'gpt-3.5-turbo-0125',
|
||||
splitToken: 2048,
|
||||
experimental: {
|
||||
jsonMode: true,
|
||||
|
||||
@@ -14,5 +14,3 @@ public-hoist-pattern[]=*semantic-release*
|
||||
public-hoist-pattern[]=*stylelint*
|
||||
|
||||
public-hoist-pattern[]=@auth/core
|
||||
public-hoist-pattern[]=@clerk/backend
|
||||
public-hoist-pattern[]=@clerk/types
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ const { defineConfig } = require('@lobehub/seo-cli');
|
||||
|
||||
module.exports = defineConfig({
|
||||
entry: ['./docs/**/*.mdx'],
|
||||
modelName: 'gpt-4o-mini',
|
||||
modelName: 'gpt-3.5-turbo-0125',
|
||||
experimental: {
|
||||
jsonMode: true,
|
||||
},
|
||||
|
||||
@@ -4,6 +4,5 @@ module.exports = {
|
||||
...config,
|
||||
rules: {
|
||||
'selector-id-pattern': null,
|
||||
...config.rules,
|
||||
},
|
||||
};
|
||||
|
||||
-4686
File diff suppressed because it is too large
Load Diff
+89
-121
@@ -1,141 +1,109 @@
|
||||
## Base image for all the stages
|
||||
FROM node:20-alpine AS base
|
||||
FROM node:20-slim AS base
|
||||
|
||||
RUN \
|
||||
# Add user nextjs to run the app
|
||||
addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 nextjs
|
||||
## Sharp dependencies, copy all the files for production
|
||||
FROM base AS sharp
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
## Builder image, install all the dependencies and build the app
|
||||
WORKDIR /app
|
||||
|
||||
RUN pnpm add sharp
|
||||
|
||||
## Install dependencies only when needed
|
||||
FROM base AS builder
|
||||
|
||||
ARG USE_NPM_CN_MIRROR
|
||||
|
||||
ENV NEXT_PUBLIC_BASE_PATH=""
|
||||
|
||||
# Sentry
|
||||
ENV NEXT_PUBLIC_SENTRY_DSN="" \
|
||||
SENTRY_ORG="" \
|
||||
SENTRY_PROJECT=""
|
||||
|
||||
# Posthog
|
||||
ENV NEXT_PUBLIC_ANALYTICS_POSTHOG="" \
|
||||
NEXT_PUBLIC_POSTHOG_HOST="" \
|
||||
NEXT_PUBLIC_POSTHOG_KEY=""
|
||||
|
||||
# Umami
|
||||
ENV NEXT_PUBLIC_ANALYTICS_UMAMI="" \
|
||||
NEXT_PUBLIC_UMAMI_SCRIPT_URL="" \
|
||||
NEXT_PUBLIC_UMAMI_WEBSITE_ID=""
|
||||
|
||||
# Node
|
||||
ENV NODE_OPTIONS="--max-old-space-size=8192"
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
COPY .npmrc ./
|
||||
|
||||
RUN \
|
||||
# If you want to build docker in China, build with --build-arg USE_NPM_CN_MIRROR=true
|
||||
if [ "${USE_NPM_CN_MIRROR:-false}" = "true" ]; then \
|
||||
export SENTRYCLI_CDNURL="https://npmmirror.com/mirrors/sentry-cli"; \
|
||||
npm config set registry "https://registry.npmmirror.com/"; \
|
||||
fi \
|
||||
# Set the registry for corepack
|
||||
&& export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\/$//') \
|
||||
# Enable corepack
|
||||
&& corepack enable \
|
||||
# Use pnpm for corepack
|
||||
&& corepack use pnpm \
|
||||
# Install the dependencies
|
||||
&& pnpm i \
|
||||
# Add sharp dependencies
|
||||
&& mkdir -p /sharp \
|
||||
&& pnpm add sharp --prefix /sharp
|
||||
# If you want to build docker in China
|
||||
# RUN npm config set registry https://registry.npmmirror.com/
|
||||
RUN pnpm i
|
||||
|
||||
COPY . .
|
||||
RUN pnpm run build:docker # run build standalone for docker version
|
||||
|
||||
# run build standalone for docker version
|
||||
RUN npm run build:docker
|
||||
## Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
## Application image, copy all the files for production
|
||||
FROM scratch AS app
|
||||
ENV NODE_ENV production
|
||||
|
||||
COPY --from=builder /app/public /app/public
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Set the correct permission for prerender cache
|
||||
RUN mkdir .next
|
||||
RUN chown nextjs:nodejs .next
|
||||
|
||||
# Automatically leverage output traces to reduce image size
|
||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||
COPY --from=builder /app/.next/standalone /app/
|
||||
COPY --from=builder /app/.next/static /app/.next/static
|
||||
COPY --from=builder /sharp/node_modules/.pnpm /app/node_modules/.pnpm
|
||||
|
||||
## Production image, copy all the files and run next
|
||||
FROM base
|
||||
|
||||
# Copy all the files from app, set the correct permission for prerender cache
|
||||
COPY --from=app --chown=nextjs:nodejs /app /app
|
||||
|
||||
ENV NODE_ENV="production"
|
||||
|
||||
# set hostname to localhost
|
||||
ENV HOSTNAME="0.0.0.0" \
|
||||
PORT="3210"
|
||||
|
||||
# General Variables
|
||||
ENV ACCESS_CODE="" \
|
||||
API_KEY_SELECT_MODE="" \
|
||||
FEATURE_FLAGS=""
|
||||
|
||||
# Model Variables
|
||||
ENV \
|
||||
# Ai360
|
||||
AI360_API_KEY="" \
|
||||
# Anthropic
|
||||
ANTHROPIC_API_KEY="" ANTHROPIC_PROXY_URL="" \
|
||||
# Amazon Bedrock
|
||||
AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" \
|
||||
# Azure OpenAI
|
||||
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
|
||||
# Baichuan
|
||||
BAICHUAN_API_KEY="" \
|
||||
# DeepSeek
|
||||
DEEPSEEK_API_KEY="" \
|
||||
# Google
|
||||
GOOGLE_API_KEY="" GOOGLE_PROXY_URL="" \
|
||||
# Groq
|
||||
GROQ_API_KEY="" GROQ_PROXY_URL="" \
|
||||
# Minimax
|
||||
MINIMAX_API_KEY="" \
|
||||
# Mistral
|
||||
MISTRAL_API_KEY="" \
|
||||
# Moonshot
|
||||
MOONSHOT_API_KEY="" MOONSHOT_PROXY_URL="" \
|
||||
# Novita
|
||||
NOVITA_API_KEY="" \
|
||||
# Ollama
|
||||
OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
|
||||
# OpenAI
|
||||
OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
|
||||
# OpenRouter
|
||||
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
|
||||
# Perplexity
|
||||
PERPLEXITY_API_KEY="" PERPLEXITY_PROXY_URL="" \
|
||||
# Qwen
|
||||
QWEN_API_KEY="" \
|
||||
# Stepfun
|
||||
STEPFUN_API_KEY="" \
|
||||
# Taichu
|
||||
TAICHU_API_KEY="" \
|
||||
# TogetherAI
|
||||
TOGETHERAI_API_KEY="" TOGETHERAI_MODEL_LIST="" \
|
||||
# 01.AI
|
||||
ZEROONE_API_KEY="" \
|
||||
# Zhipu
|
||||
ZHIPU_API_KEY=""
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=sharp --chown=nextjs:nodejs /app/node_modules/.pnpm ./node_modules/.pnpm
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3210/tcp
|
||||
EXPOSE 3210
|
||||
|
||||
CMD ["node", "/app/server.js"]
|
||||
# set hostname to localhost
|
||||
ENV HOSTNAME "0.0.0.0"
|
||||
ENV PORT=3210
|
||||
|
||||
# General Variables
|
||||
ENV ACCESS_CODE ""
|
||||
|
||||
ENV API_KEY_SELECT_MODE ""
|
||||
|
||||
# OpenAI
|
||||
ENV OPENAI_API_KEY ""
|
||||
ENV OPENAI_PROXY_URL ""
|
||||
ENV OPENAI_MODEL_LIST ""
|
||||
|
||||
# Azure OpenAI
|
||||
ENV USE_AZURE_OPENAI ""
|
||||
ENV AZURE_API_KEY ""
|
||||
ENV AZURE_API_VERSION ""
|
||||
|
||||
# Google
|
||||
ENV GOOGLE_API_KEY ""
|
||||
|
||||
# Zhipu
|
||||
ENV ZHIPU_API_KEY ""
|
||||
|
||||
# Moonshot
|
||||
ENV MOONSHOT_API_KEY ""
|
||||
|
||||
# Ollama
|
||||
ENV OLLAMA_PROXY_URL ""
|
||||
ENV OLLAMA_MODEL_LIST ""
|
||||
|
||||
# Perplexity
|
||||
ENV PERPLEXITY_API_KEY ""
|
||||
|
||||
# Anthropic
|
||||
ENV ANTHROPIC_API_KEY ""
|
||||
|
||||
# Mistral
|
||||
ENV MISTRAL_API_KEY ""
|
||||
|
||||
# OpenRouter
|
||||
ENV OPENROUTER_API_KEY ""
|
||||
ENV OPENROUTER_MODEL_LIST ""
|
||||
|
||||
# 01.AI
|
||||
ENV ZEROONE_API_KEY ""
|
||||
|
||||
# TogetherAI
|
||||
ENV TOGETHERAI_API_KEY ""
|
||||
|
||||
# Minimax
|
||||
ENV MINIMAX_API_KEY ""
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
||||
@@ -1,38 +1,21 @@
|
||||
Apache License Version 2.0
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024/06/17 - current LobeHub LLC. All rights reserved.
|
||||
Copyright (c) 2023 - current LobeHub
|
||||
|
||||
----------
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
From 1.0, LobeChat is licensed under the Apache License 2.0, with the following additional conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
1. The commercial usage of LobeChat:
|
||||
|
||||
a. LobeChat may be utilized commercially, including as a frontend and backend service without modifying the source code.
|
||||
|
||||
b. a commercial license must be obtained from the producer if you want to develop and distribute a derivative work based on LobeChat.
|
||||
|
||||
Please contact hello@lobehub.com by email to inquire about licensing matters.
|
||||
|
||||
|
||||
2. As a contributor, you should agree that:
|
||||
|
||||
a. The producer can adjust the open-source agreement to be more strict or relaxed as deemed necessary.
|
||||
|
||||
b. Your contributed code may be used for commercial purposes, including but not limited to its cloud edition.
|
||||
|
||||
Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
|
||||
----------
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@@ -8,7 +8,7 @@ An open-source, modern-design ChatGPT/LLMs UI/Framework.<br/>
|
||||
Supports speech-synthesis, multi-modal, and extensible ([function call][docs-functionc-call]) plugin system.<br/>
|
||||
One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/Ollama chat application.
|
||||
|
||||
**English** · [简体中文](./README.zh-CN.md) · [Official Site][official-site] · [Changelog](./CHANGELOG.md) · [Documents][docs] · [Blog][blog] · [Feedback][github-issues-link]
|
||||
**English** · [简体中文](./README.zh-CN.md) · [Changelog](./CHANGELOG.md) · [Documents][docs] · [Report Bug][github-issues-link] · [Request Feature][github-issues-link]
|
||||
|
||||
<!-- SHIELD GROUP -->
|
||||
|
||||
@@ -59,11 +59,9 @@ One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/
|
||||
- [`5` Text to Image Generation](#5-text-to-image-generation)
|
||||
- [`6` Plugin System (Function Calling)](#6-plugin-system-function-calling)
|
||||
- [`7` Agent Market (GPTs)](#7-agent-market-gpts)
|
||||
- [`8` Support Local / Remote Database](#8-support-local--remote-database)
|
||||
- [`9` Support Multi-User Management](#9-support-multi-user-management)
|
||||
- [`10` Progressive Web App (PWA)](#10-progressive-web-app-pwa)
|
||||
- [`11` Mobile Device Adaptation](#11-mobile-device-adaptation)
|
||||
- [`12` Custom Themes](#12-custom-themes)
|
||||
- [`8` Progressive Web App (PWA)](#8-progressive-web-app-pwa)
|
||||
- [`9` Mobile Device Adaptation](#9-mobile-device-adaptation)
|
||||
- [`10` Custom Themes](#10-custom-themes)
|
||||
- [`*` What's more](#-whats-more)
|
||||
- [⚡️ Performance](#️-performance)
|
||||
- [🛳 Self Hosting](#-self-hosting)
|
||||
@@ -132,9 +130,6 @@ We have implemented support for the following model service providers:
|
||||
- **ChatGLM**: Added the **ChatGLM** series models from Zhipuai (GLM-4/GLM-4-vision/GLM-3-turbo), providing users with another efficient conversation model choice. [Learn more](https://www.zhipuai.cn/)
|
||||
- **Moonshot AI (Dark Side of the Moon)**: Integrated with the Moonshot series models, an innovative AI startup from China, aiming to provide deeper conversation understanding. [Learn more](https://www.moonshot.cn/)
|
||||
- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)
|
||||
- **Qwen**: Integrated the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Lean more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
- **Novita AI**: Access **Llama**, **Mistral**, and other leading open-source models at cheapest prices. Engage in uncensored role-play, spark creative discussions, and foster unrestricted innovation. **Pay For What You Use.** [Learn more](https://novita.ai/llm-api?utm_source=lobechat&utm_medium=ch&utm_campaign=api)
|
||||
|
||||
At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).
|
||||
|
||||
@@ -227,14 +222,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Shopping tools](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **shoppingtools** on **2024-07-19**</sup> | Search for products on eBay & AliExpress, find eBay events & coupons. Get prompt examples.<br/>`shopping` `e-bay` `ali-express` `coupons` |
|
||||
| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | Realtime stock, crypto and other investment data.<br/>`stock` `analyze` |
|
||||
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
||||
| [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
|
||||
| Recent Submits | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
||||
| [Search Google via Serper](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | Google search engine via Serper.dev free API (2500x🆓/month)<br/>`web` `search` |
|
||||
| [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | Discover current prices of NFTs across major platforms and keep track of the rapidly changing marketplace with real-time<br/>`crypto` `nft` |
|
||||
| [Calendar Assistant](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | A plugin to manage your calendar events # will auto generate i18n in workflow<br/>`calendar` `schedule` `will-auto-generate-i-18-n-in-workflow` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**52**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
> 📊 Total plugins: [<kbd>**56**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -266,14 +261,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
| Recent Submits | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [Brand Pioneer](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | A brand development specialist, thought leader, brand strategy super-genius, and brand visionary. Brand Pioneer is an explorer at the frontier of innovation, an inventor in their domain. Provide them with your market and let them imagine a future world characterized by groundbreaking advancements in your field of expertise.<br/>`business` `brand-pioneer` `brand-development` `business-assistant` `brand-narrative` |
|
||||
| [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | A highly advanced AI LLM transcending conventional AI. 'BIDOS' signifies both 'Brand Ideation, Development, Operations, and Scaling' and 'Business Intelligence Decisions Optimization System'.<br/>`brand-development` `ai-assistant` `market-analysis` `strategic-planning` `business-optimization` `business-intelligence` |
|
||||
| [Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | Specializes in helping users explore themselves through dialogue, find solutions, and paths to growth<br/>`growth-coach` `self-exploration` `goal-setting` `self-awareness` |
|
||||
| [Convert SQL Table Structure to Dao and Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | Generate entity class and MyBatis Mapper based on a table structure<br/>`sql` `sql` `mybatis` |
|
||||
| Recent Submits | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [Sales Description Specialist](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | Assists in the sale of used items through research, pricing, description, and title creation.<br/>`product-sales` `research` `description` |
|
||||
| [Jailbreak Assistant DAN](https://chat-preview.lobehub.com/market?agent=gpt-4-dan-assistant)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-04-26**</sup> | Bypass OpenAI review mechanism, ChatGPT after jailbreak<br/>`creative` `artificial-intelligence` `conversation` `jailbreak` |
|
||||
| [TailwindHelper](https://chat-preview.lobehub.com/market?agent=tailwind-helper)<br/><sup>By **[aototo](https://github.com/aototo)** on **2024-04-26**</sup> | TailwindHelper is a professional frontend designer with a solid foundation in design theory and rich practical experience. Created by a leading software development company, it aims to help developers and designers accelerate the development process of web interfaces. TailwindHelper is proficient in the Tailwind CSS framework and can translate complex design requirements into efficient and responsive CSS class names.<br/>`tailwindcss` `css` `tailwind-helper` |
|
||||
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | Specializes in converting JSON schema to TypeScript types.<br/>`typescript` `development` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**305**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
> 📊 Total agents: [<kbd>**244**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -283,44 +278,9 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-database]][docs-feat-database]
|
||||
|
||||
### `8` [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:
|
||||
|
||||
- **Local database**: suitable for users who want more control over their data and privacy protection. LobeChat uses CRDT (Conflict-Free Replicated Data Type) technology to achieve multi-device synchronization. This is an experimental feature aimed at providing a seamless data synchronization experience.
|
||||
- **Server-side database**: suitable for users who want a more convenient user experience. LobeChat supports PostgreSQL as a server-side database. For detailed documentation on how to configure the server-side database, please visit [Configure Server-side Database](https://lobehub.com/docs/self-hosting/advanced/server-database).
|
||||
|
||||
Regardless of which database you choose, LobeChat can provide you with an excellent user experience.
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-auth]][docs-feat-auth]
|
||||
|
||||
### `9` [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:
|
||||
|
||||
- **next-auth**: LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports multiple authentication methods, including OAuth, email login, credential login, etc. With `next-auth`, you can easily implement user registration, login, session management, social login, and other functions to ensure the security and privacy of user data.
|
||||
|
||||
- **Clerk**: For users who need more advanced user management features, LobeChat also supports `Clerk`, a modern user management platform. `Clerk` provides richer functions, such as multi-factor authentication (MFA), user profile management, login activity monitoring, etc. With `Clerk`, you can get higher security and flexibility, and easily cope with complex user management needs.
|
||||
|
||||
Regardless of which user management solution you choose, LobeChat can provide you with an excellent user experience and powerful functional support.
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-pwa]][docs-feat-pwa]
|
||||
|
||||
### `10` [Progressive Web App (PWA)][docs-feat-pwa]
|
||||
### `8` [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,
|
||||
@@ -347,7 +307,7 @@ providing smooth animations, responsive layouts, and adapting to different devic
|
||||
|
||||
[![][image-feat-mobile]][docs-feat-mobile]
|
||||
|
||||
### `11` [Mobile Device Adaptation][docs-feat-mobile]
|
||||
### `9` [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.
|
||||
|
||||
@@ -359,7 +319,7 @@ We have carried out a series of optimization designs for mobile devices to enhan
|
||||
|
||||
[![][image-feat-theme]][docs-feat-theme]
|
||||
|
||||
### `12` [Custom Themes][docs-feat-theme]
|
||||
### `10` [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.
|
||||
@@ -667,12 +627,11 @@ Every bit counts and your one-time donation sparkles in our galaxy of support! Y
|
||||
</details>
|
||||
|
||||
Copyright © 2024 [LobeHub][profile-link]. <br />
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
This project is [MIT](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
|
||||
[blog]: https://lobehub.com/blog
|
||||
[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
|
||||
@@ -699,13 +658,11 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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]: https://lobehub.com/docs
|
||||
[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
|
||||
@@ -715,7 +672,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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-functionc-call]: https://platform.openai.com/docs/guides/function-calling
|
||||
[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
|
||||
@@ -735,7 +692,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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-license-shield]: https://img.shields.io/github/license/lobehub/lobe-chat?color=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
|
||||
@@ -747,8 +704,6 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
@@ -758,7 +713,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
|
||||
[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
|
||||
@@ -778,7 +733,6 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
@@ -803,5 +757,5 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
[vercel-shield]: https://img.shields.io/website?down_message=offline&label=vercel&labelColor=black&logo=vercel&style=flat-square&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield-badge]: https://img.shields.io/website?down_message=offline&label=try%20lobechat&labelColor=black&logo=vercel&style=for-the-badge&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
|
||||
+31
-79
@@ -8,7 +8,7 @@
|
||||
支持语音合成、多模态、可扩展的([function call][docs-functionc-call])插件系统<br/>
|
||||
一键**免费**拥有你自己的 ChatGPT/Gemini/Claude/Ollama 应用
|
||||
|
||||
[English](./README.md) · **简体中文** · [官网][official-site] · [更新日志](./CHANGELOG.md) · [文档][docs] · [博客][blog] · [反馈问题][github-issues-link]
|
||||
[English](./README.md) · **简体中文** · [更新日志](./CHANGELOG.md) · [文档][github-document-link] · [报告问题][github-issues-link] · [请求功能][github-issues-link]
|
||||
|
||||
<!-- SHIELD GROUP -->
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
<sup>探索私人生产力的未来。在个体崛起的时代中为你打造.</sup>
|
||||
|
||||
[![][github-trending-shield]][github-trending-url]
|
||||
[![][github-hello-shield]][github-hello-url]
|
||||
|
||||
[![][image-overview]][vercel-link]
|
||||
|
||||
@@ -59,11 +58,9 @@
|
||||
- [`5` Text to Image 文生图](#5-text-to-image-文生图)
|
||||
- [`6` 插件系统 (Function Calling)](#6-插件系统-function-calling)
|
||||
- [`7` 助手市场 (GPTs)](#7-助手市场-gpts)
|
||||
- [`8` 支持本地 / 远程数据库](#8-支持本地--远程数据库)
|
||||
- [`9` 支持多用户管理](#9-支持多用户管理)
|
||||
- [`10` 渐进式 Web 应用 (PWA)](#10-渐进式-web-应用-pwa)
|
||||
- [`11` 移动设备适配](#11-移动设备适配)
|
||||
- [`12` 自定义主题](#12-自定义主题)
|
||||
- [`8` 渐进式 Web 应用 (PWA)](#8-渐进式-web-应用-pwa)
|
||||
- [`9` 移动设备适配](#9-移动设备适配)
|
||||
- [`10` 自定义主题](#10-自定义主题)
|
||||
- [更多特性](#更多特性)
|
||||
- [⚡️ 性能测试](#️-性能测试)
|
||||
- [🛳 开箱即用](#-开箱即用)
|
||||
@@ -132,8 +129,6 @@
|
||||
- **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/)
|
||||
- **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/)
|
||||
- **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/)
|
||||
- **Qwen**: 接入了 Qwen 的 AI 模型,包括最新的 **qwen-turbo**,**qwen-plus** 和 **qwen-max** 等模型。[了解更多](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。
|
||||
|
||||
@@ -219,14 +214,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
| 最近新增 | 插件描述 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| [购物工具](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **shoppingtools** on **2024-07-19**</sup> | 在 eBay 和 AliExpress 上搜索产品,查找 eBay 活动和优惠券。获取快速示例。<br/>`购物` `e-bay` `ali-express` `优惠券` |
|
||||
| [Savvy Trader AI](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **savvytrader** on **2024-06-27**</sup> | 实时股票、加密货币和其他投资数据。<br/>`股票` `分析` |
|
||||
| [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
|
||||
| [空间](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | 包括 NASA 的空间数据。<br/>`空间` `nasa` |
|
||||
| 最近新增 | 插件描述 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
|
||||
| [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
|
||||
| [通过 Serper 搜索 Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | 通过 Serper.dev 免费 API 进行 Google 搜索引擎(每月 2500 次🆓)<br/>`网络` `搜索` |
|
||||
| [NFT Guru](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **swap** on **2024-04-03**</sup> | 发现主要平台上 NFT 的当前价格,并通过实时跟踪快速变化的市场了解情况<br/>`加密货币` `nft` |
|
||||
| [日历助手](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **cc** on **2024-03-13**</sup> | 一个用于管理日历事件的插件 # 将自动生成工作流程中的 i18n<br/>`日历` `日程安排` `将自动生成工作流程中的-i-18-n` |
|
||||
|
||||
> 📊 Total plugins: [<kbd>**52**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
> 📊 Total plugins: [<kbd>**56**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
||||
|
||||
<!-- PLUGIN LIST -->
|
||||
|
||||
@@ -254,14 +249,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
| 最近新增 | 助手说明 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [品牌先锋](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | 一位品牌发展专家、思想领袖、品牌战略超级天才和品牌远见者。品牌先锋是创新前沿的探险家,在其领域是一位发明家。将您的市场提供给他们,让他们想象一个未来世界,其中以您的专业领域的突破性进展为特征。<br/>`商业` `品牌先锋` `品牌发展` `商业助手` `品牌叙事` |
|
||||
| [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | 一种高度先进的 AI LLM,超越传统人工智能。'BIDOS' 既代表 ' 品牌构思、发展、运营和扩展 ',也代表 ' 商业智能决策优化系统 '。<br/>`品牌发展` `ai助手` `市场分析` `战略规划` `业务优化` `商业智能` |
|
||||
| [成长教练](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | 擅长用对话的方式帮助用户自我探索,找到解决之道和成长之路<br/>`成长教练` `自我探索` `目标设定` `自我觉察` |
|
||||
| [SQL 表结构转 Dao 和 Mapper](https://chat-preview.lobehub.com/market?agent=my-batis-generator)<br/><sup>By **[MeYoung](https://github.com/MeYoung)** on **2024-07-17**</sup> | 给与一个表结构,生成表的实体和 MyBatis 的 Mapper<br/>`sql` `sql` `mybatis` |
|
||||
| 最近新增 | 助手说明 |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [销售描述专家](https://chat-preview.lobehub.com/market?agent=verkauf-kleinanzeigen)<br/><sup>By **[highseen](https://github.com/highseen)** on **2024-04-30**</sup> | 通过研究、定价、描述和标题设计帮助销售二手物品。<br/>`产品销售` `研究` `描述` |
|
||||
| [越狱助手 DAN](https://chat-preview.lobehub.com/market?agent=gpt-4-dan-assistant)<br/><sup>By **[MapleEve](https://github.com/MapleEve)** on **2024-04-26**</sup> | 突破 OpenAI 审核机制,越狱之后的 ChatGPT<br/>`创意` `人工智能` `对话` `越狱` |
|
||||
| [TailwindHelper](https://chat-preview.lobehub.com/market?agent=tailwind-helper)<br/><sup>By **[aototo](https://github.com/aototo)** on **2024-04-26**</sup> | TailwindHelper 是一位专业的前端设计师,拥有深厚的设计理论基础和丰富的实践经验。它由一家领先的软件开发公司创建,旨在帮助开发者和设计师加速 Web 界面的开发过程。TailwindHelper 精通 Tailwind CSS 框架,并能够理解复杂的设计要求,转化为高效且响应式的 CSS 类名。<br/>`tailwindcss` `css` `tailwind-helper` |
|
||||
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | 擅长将 JSON schema 转换为 TypeScript 类型。<br/>`typescript` `开发` |
|
||||
|
||||
> 📊 Total agents: [<kbd>**305**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
> 📊 Total agents: [<kbd>**244**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
||||
|
||||
<!-- AGENT LIST -->
|
||||
|
||||
@@ -271,44 +266,9 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-database]][docs-feat-database]
|
||||
|
||||
### `8` [支持本地 / 远程数据库][docs-feat-database]
|
||||
|
||||
LobeChat 支持同时使用服务端数据库和本地数据库。根据您的需求,您可以选择合适的部署方案:
|
||||
|
||||
- 本地数据库:适合希望对数据有更多掌控感和隐私保护的用户。LobeChat 采用了 CRDT (Conflict-Free Replicated Data Type) 技术,实现了多端同步功能。这是一项实验性功能,旨在提供无缝的数据同步体验。
|
||||
- 服务端数据库:适合希望更便捷使用体验的用户。LobeChat 支持 PostgreSQL 作为服务端数据库。关于如何配置服务端数据库的详细文档,请前往 [配置服务端数据库](https://lobehub.com/zh/docs/self-hosting/advanced/server-database)。
|
||||
|
||||
无论您选择哪种数据库,LobeChat 都能为您提供卓越的用户体验。
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-auth]][docs-feat-auth]
|
||||
|
||||
### `9` [支持多用户管理][docs-feat-auth]
|
||||
|
||||
LobeChat 支持多用户管理,提供了两种主要的用户认证和管理方案,以满足不同需求:
|
||||
|
||||
- **next-auth**:LobeChat 集成了 `next-auth`,一个灵活且强大的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录等。通过 `next-auth`,您可以轻松实现用户的注册、登录、会话管理以及社交登录等功能,确保用户数据的安全性和隐私性。
|
||||
|
||||
- **Clerk**:对于需要更高级用户管理功能的用户,LobeChat 还支持 `Clerk`,一个现代化的用户管理平台。`Clerk` 提供了更丰富的功能,如多因素认证 (MFA)、白名单、用户管理、登录活动监控等。通过 `Clerk`,您可以获得更高的安全性和灵活性,轻松应对生产级的用户管理需求。
|
||||
|
||||
您可以根据自己的需求,选择合适的用户管理方案。
|
||||
|
||||
<div align="right">
|
||||
|
||||
[![][back-to-top]](#readme-top)
|
||||
|
||||
</div>
|
||||
|
||||
[![][image-feat-pwa]][docs-feat-pwa]
|
||||
|
||||
### `10` [渐进式 Web 应用 (PWA)][docs-feat-pwa]
|
||||
### `8` [渐进式 Web 应用 (PWA)][docs-feat-pwa]
|
||||
|
||||
我们深知在当今多设备环境下为用户提供无缝体验的重要性。为此,我们采用了渐进式 Web 应用 [PWA](https://support.google.com/chrome/answer/9658361) 技术,
|
||||
这是一种能够将网页应用提升至接近原生应用体验的现代 Web 技术。通过 PWA,LobeChat 能够在桌面和移动设备上提供高度优化的用户体验,同时保持轻量级和高性能的特点。
|
||||
@@ -331,7 +291,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理
|
||||
|
||||
[![][image-feat-mobile]][docs-feat-mobile]
|
||||
|
||||
### `11` [移动设备适配][docs-feat-mobile]
|
||||
### `9` [移动设备适配][docs-feat-mobile]
|
||||
|
||||
针对移动设备进行了一系列的优化设计,以提升用户的移动体验。目前,我们正在对移动端的用户体验进行版本迭代,以实现更加流畅和直观的交互。如果您有任何建议或想法,我们非常欢迎您通过 GitHub Issues 或者 Pull Requests 提供反馈。
|
||||
|
||||
@@ -343,7 +303,7 @@ LobeChat 支持多用户管理,提供了两种主要的用户认证和管理
|
||||
|
||||
[![][image-feat-theme]][docs-feat-theme]
|
||||
|
||||
### `12` [自定义主题][docs-feat-theme]
|
||||
### `10` [自定义主题][docs-feat-theme]
|
||||
|
||||
作为设计工程师出身,LobeChat 在界面设计上充分考虑用户的个性化体验,因此引入了灵活多变的主题模式,其中包括日间的亮色模式和夜间的深色模式。
|
||||
除了主题模式的切换,还提供了一系列的颜色定制选项,允许用户根据自己的喜好来调整应用的主题色彩。无论是想要沉稳的深蓝,还是希望活泼的桃粉,或者是专业的灰白,用户都能够在 LobeChat 中找到匹配自己风格的颜色选择。
|
||||
@@ -517,9 +477,9 @@ API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节
|
||||
如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,
|
||||
请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考:
|
||||
|
||||
| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------- | ------------------------- | ------------------------------- |
|
||||
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="48" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 ) | `https://aihubmix.com/v1` | [获取](https://lobe.li/XHnZIUP) |
|
||||
| | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------- | ------------------------- | ------------------------------- |
|
||||
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="48" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **6 折**(含 GPT-4 ) | `https://aihubmix.com/v1` | [获取](https://lobe.li/XHnZIUP) |
|
||||
|
||||
> \[!WARNING]
|
||||
>
|
||||
@@ -688,12 +648,11 @@ $ pnpm run dev
|
||||
</details>
|
||||
|
||||
Copyright © 2023 [LobeHub][profile-link]. <br />
|
||||
This project is [Apache 2.0](./LICENSE) licensed.
|
||||
This project is [MIT](./LICENSE) licensed.
|
||||
|
||||
<!-- LINK GROUP -->
|
||||
|
||||
[back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
|
||||
[blog]: https://lobehub.com/zh/blog
|
||||
[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
|
||||
@@ -720,13 +679,10 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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/zh/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
|
||||
@@ -736,7 +692,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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/zh/blog/openai-function-call
|
||||
[docs-functionc-call]: https://platform.openai.com/docs/guides/function-calling
|
||||
[docs-lighthouse]: https://github.com/lobehub/lobe-chat/wiki/Lighthouse.zh-CN
|
||||
[docs-plugin-dev]: https://lobehub.com/docs/usage/plugins/development
|
||||
[docs-self-hosting]: https://lobehub.com/docs/self-hosting/start
|
||||
@@ -751,14 +707,13 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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-document-link]: https://lobehub.com/docs
|
||||
[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-hello-shield]: https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=39701baf5a734cb894ec812248a5655a&claim_uid=HxYvFN34htJzGCD&theme=dark&theme=neutral&theme=dark&theme=neutral
|
||||
[github-hello-url]: https://hellogithub.com/repository/39701baf5a734cb894ec812248a5655a
|
||||
[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-license-shield]: https://img.shields.io/github/license/lobehub/lobe-chat?color=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
|
||||
@@ -770,8 +725,6 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
@@ -781,7 +734,7 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
|
||||
[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
|
||||
@@ -801,7 +754,6 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
@@ -824,5 +776,5 @@ This project is [Apache 2.0](./LICENSE) licensed.
|
||||
[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
|
||||
[vercel-shield]: https://img.shields.io/website?down_message=offline&label=vercel&labelColor=black&logo=vercel&style=flat-square&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
[vercel-shield-badge]: https://img.shields.io/website?down_message=offline&label=try%20lobechat&labelColor=black&logo=vercel&style=for-the-badge&up_message=online&url=https%3A%2F%2Fchat-preview.lobehub.com
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default: off
|
||||
server:
|
||||
flags:
|
||||
- server
|
||||
app:
|
||||
flags:
|
||||
- app
|
||||
patch: off
|
||||
@@ -4,14 +4,14 @@ This document aims to guide developers on how to develop a complete feature requ
|
||||
|
||||
We will use the implementation of sessionGroup as an example: [✨ feat: add session group manager](https://github.com/lobehub/lobe-chat/pull/1055), and explain the complete implementation process through the following six main sections:
|
||||
|
||||
1. [Data Model / Database Definition](#1-data-model--database-definition)
|
||||
2. [Service Implementation / Model Implementation](#2-service-implementation--model-implementation)
|
||||
3. [Frontend Data Flow Store Implementation](#3-frontend-data-flow-store-implementation)
|
||||
4. [UI Implementation and Action Binding](#4-ui-implementation-and-action-binding)
|
||||
5. [Data Migration](#5-data-migration)
|
||||
6. [Data Import and Export](#6-data-import-and-export)
|
||||
1. Data Model / Database Definition
|
||||
2. Service Implementation / Model Implementation
|
||||
3. Frontend Data Flow Store Implementation
|
||||
4. UI Implementation and Action Binding
|
||||
5. Data Migration
|
||||
6. Data Import and Export
|
||||
|
||||
## 1. Data Model / Database Definition
|
||||
## 1. Database Section
|
||||
|
||||
To implement the Session Group feature, it is necessary to define the relevant data model and indexes at the database level.
|
||||
|
||||
@@ -119,7 +119,7 @@ As a result, you can now view the `sessionGroups` table in the `LOBE_CHAT_DB` in
|
||||
|
||||

|
||||
|
||||
## 2. Service Implementation / Model Implementation
|
||||
## 2. Model and Service Section
|
||||
|
||||
### Define Model
|
||||
|
||||
@@ -176,7 +176,7 @@ class SessionService {
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Frontend Data Flow Store Implementation
|
||||
## 3. Store Action Section
|
||||
|
||||
In the LobeChat application, the Store module is used to manage the frontend state of the application. The Actions within it are functions that trigger state updates, usually by calling methods in the service layer to perform actual data processing operations and then updating the state in the Store. We use `zustand` as the underlying dependency for the Store module. For a detailed practical introduction to state management, you can refer to [📘 Best Practices for State Management](../State-Management/State-Management-Intro.zh-CN.md).
|
||||
|
||||
@@ -351,7 +351,7 @@ Since all data retrieval in the UI is implemented using syntax like `useSessionS
|
||||
>
|
||||
> If you are not familiar with the concept and functionality of selectors, you can refer to the section [📘 Data Storage and Retrieval Module](./State-Management-Selectors.en-US) for relevant information.
|
||||
|
||||
## 4. UI Implementation and Action Binding
|
||||
## IV. UI Section
|
||||
|
||||
Bind Store Action in the UI component to implement interactive logic, for example `CreateGroupModal`:
|
||||
|
||||
@@ -570,7 +570,7 @@ export class LocalDB extends Dexie {
|
||||
|
||||
This is our data migration strategy. When performing the migration, it is essential to ensure the correctness of the migration script and validate the migration results through thorough testing.
|
||||
|
||||
## 6. Data Import and Export
|
||||
## VI. Data Import and Export
|
||||
|
||||
In LobeChat, the data import and export feature is designed to ensure that users can migrate their data between different devices. This includes session, topic, message, and settings data. In the implementation of the Session Group feature, we also need to handle data import and export to ensure that the complete exported data can be restored exactly the same on other devices.
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
我们将以 sessionGroup 的实现为示例:[✨ feat: add session group manager](https://github.com/lobehub/lobe-chat/pull/1055) , 通过以下六个主要部分来阐述完整的实现流程:
|
||||
|
||||
1. [数据模型 / 数据库定义](#一数据模型--数据库定义)
|
||||
2. [Service 实现 / Model 实现](#二service-实现--model-实现)
|
||||
3. [前端数据流 Store 实现](#三前端数据流-store-实现)
|
||||
4. [UI 实现与 action 绑定](#四ui-实现与-action-绑定)
|
||||
5. [数据迁移](#五数据迁移)
|
||||
6. [数据导入导出](#六数据导入导出)
|
||||
1. 数据模型 / 数据库定义
|
||||
2. Service 实现 / Model 实现
|
||||
3. 前端数据流 Store 实现
|
||||
4. UI 实现与 action 绑定
|
||||
5. 数据迁移
|
||||
6. 数据导入导出
|
||||
|
||||
## 一、数据模型 / 数据库定义
|
||||
## 一、数据库部分
|
||||
|
||||
为了实现 Session Group 功能,首先需要在数据库层面定义相关的数据模型和索引。
|
||||
|
||||
@@ -119,7 +119,7 @@ export class LocalDB extends Dexie {
|
||||
|
||||

|
||||
|
||||
## 二、Service 实现 / Model 实现
|
||||
## 二、Model 与 Service 部分
|
||||
|
||||
### 定义 Model
|
||||
|
||||
@@ -176,7 +176,7 @@ class SessionService {
|
||||
}
|
||||
```
|
||||
|
||||
## 三、前端数据流 Store 实现
|
||||
## 三、Store Action 部分
|
||||
|
||||
在 LobeChat 应用中,Store 是用于管理应用前端状态的模块。其中的 Action 是触发状态更新的函数,通常会调用服务层的方法来执行实际的数据处理操作,然后更新 Store 中的状态。我们采用了 `zustand` 作为 Store 模块的底层依赖,对于状态管理的详细实践介绍,可以查阅 [📘 状态管理最佳实践](../State-Management/State-Management-Intro.zh-CN.md)
|
||||
|
||||
@@ -351,7 +351,7 @@ const customSessionGroups = (s: SessionStore): CustomSessionGroup[] => s.customS
|
||||
>
|
||||
> 如果你对 Selectors 的概念和功能不太了解,可以查阅 [📘 数据存储取数模块](../State-Management/State-Management-Selectors.zh-CN.md) 部分了解相关内容。
|
||||
|
||||
## 四、UI 实现与 action 绑定
|
||||
## 四、UI 部分
|
||||
|
||||
在 UI 组件中绑定 Store Action 实现交互逻辑,例如 `CreateGroupModal`:
|
||||
|
||||
|
||||
+13
-81
@@ -1,26 +1,22 @@
|
||||
# Technical Development Getting Started Guide
|
||||
|
||||
Welcome to the LobeChat Technical Development Getting Started Guide. LobeChat is an AI conversation application built on the Next.js framework, incorporating a range of technology stacks to achieve diverse functionalities and features. This guide will detail the main technical components of LobeChat and how to configure and use these technologies in your development environment.
|
||||
Welcome to the LobeChat technical development getting started guide. LobeChat is an AI conversation application built on the Next.js framework, which integrates a series of technology stacks to achieve diverse functions and features. This guide will provide a detailed introduction to the main technical components of LobeChat and how to configure and use these technologies in your development environment.
|
||||
|
||||
#### TOC
|
||||
|
||||
- [Basic Technology Stack](#basic-technology-stack)
|
||||
- [Folder Directory Structure](#folder-directory-structure)
|
||||
- [Local Development Environment Setup](#local-development-environment-setup)
|
||||
- [Code Style and Contribution Guide](#code-style-and-contribution-guide)
|
||||
- [Internationalization Implementation Guide](#internationalization-implementation-guide)
|
||||
- [Appendix: Resources and References](#appendix-resources-and-references)
|
||||
|
||||
## Basic Technology Stack
|
||||
|
||||
The core technology stack of LobeChat is as follows:
|
||||
The core technology stack of LobeChat includes:
|
||||
|
||||
- **Framework**: We chose [Next.js](https://nextjs.org/), a powerful React framework that provides key features such as server-side rendering, routing framework, and Router Handler.
|
||||
- **Component Library**: We use [Ant Design (antd)](https://ant.design/) as the basic component library, along with [lobe-ui](https://github.com/lobehub/lobe-ui) as our business component library.
|
||||
- **State Management**: We selected [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
|
||||
- **Framework**: We have chosen [Next.js](https://nextjs.org/), a powerful React framework that provides key features such as server-side rendering, routing framework, and Router Handler for our project.
|
||||
- **Component Library**: We use [Ant Design (antd)](https://ant.design/) as the basic component library, and also introduce [lobe-ui](https://github.com/lobehub/lobe-ui) as our business component library.
|
||||
- **State Management**: We have opted for [zustand](https://github.com/pmndrs/zustand), a lightweight and easy-to-use state management library.
|
||||
- **Network Requests**: We use [swr](https://swr.vercel.app/), a React Hooks library for data fetching.
|
||||
- **Routing**: For routing management, we directly use the solution provided by [Next.js](https://nextjs.org/).
|
||||
- **Internationalization**: We use [i18next](https://www.i18next.com/) to support multiple languages in the application.
|
||||
- **Routing**: For routing management, we directly use the solution provided by [Next.js](https://nextjs.org/) itself.
|
||||
- **Internationalization**: We use [i18next](https://www.i18next.com/) to implement multi-language support for the application.
|
||||
- **Styling**: We use [antd-style](https://github.com/ant-design/antd-style), a CSS-in-JS library that complements Ant Design.
|
||||
- **Unit Testing**: We use [vitest](https://github.com/vitest-dev/vitest) for unit testing.
|
||||
|
||||
@@ -30,82 +26,18 @@ The folder directory structure of LobeChat is as follows:
|
||||
|
||||
```bash
|
||||
src
|
||||
├── app # Code related to the main logic and state management of the application
|
||||
├── app # Main logic of the application and code related to state management
|
||||
├── components # Reusable UI components
|
||||
├── config # Application configuration files, including client and server environment variables
|
||||
├── config # Application configuration files, including client-side environment variables and server-side environment variables
|
||||
├── const # Used to define constants, such as action types, route names, etc.
|
||||
├── features # Business-related feature modules, such as Agent settings, plugin development pop-ups, etc.
|
||||
├── hooks # Custom utility Hooks reusable across the application
|
||||
├── features # Function modules related to business features, such as Agent settings, plugin development pop-ups, etc.
|
||||
├── hooks # Custom utility hooks reused throughout the application
|
||||
├── layout # Application layout components, such as navigation bars, sidebars, etc.
|
||||
├── locales # Language files for internationalization
|
||||
├── services # Encapsulated backend service interfaces, such as HTTP requests
|
||||
├── store # Zustand store for state management
|
||||
├── types # TypeScript type definition files
|
||||
└── utils # General utility functions
|
||||
└── utils # Common utility functions
|
||||
```
|
||||
|
||||
For a detailed introduction to the directory structure, see: [Folder Directory Structure](Folder-Structure.zh-CN.md)
|
||||
|
||||
## Local Development Environment Setup
|
||||
|
||||
This section outlines setting up the development environment and local development. Before starting, please ensure that Node.js, Git, and your chosen package manager (Bun or PNPM) are installed in your local environment.
|
||||
|
||||
We recommend using WebStorm as your integrated development environment (IDE).
|
||||
|
||||
1. **Get the code**: Clone the LobeChat code repository locally:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/lobehub/lobe-chat.git
|
||||
```
|
||||
|
||||
2. **Install dependencies**: Enter the project directory and install the required dependencies:
|
||||
|
||||
```bash
|
||||
cd lobe-chat
|
||||
# If you use Bun
|
||||
bun install
|
||||
# If you use PNPM
|
||||
pnpm install
|
||||
```
|
||||
|
||||
3. **Run and debug**: Start the local development server and begin your development journey:
|
||||
|
||||
```bash
|
||||
# Start the development server with Bun
|
||||
bun run dev
|
||||
# Visit http://localhost:3010 to view the application
|
||||
```
|
||||
|
||||
> \[!IMPORTANT]\
|
||||
> If you encounter the error "Could not find 'stylelint-config-recommended'" when installing dependencies with `npm`, please reinstall the dependencies using `pnpm` or `bun`.
|
||||
|
||||
Now, you should be able to see the welcome page of LobeChat in your browser. For a detailed environment setup guide, please refer to [Development Environment Setup Guide](Setup-Development.zh-CN.md).
|
||||
|
||||
## Code Style and Contribution Guide
|
||||
|
||||
In the LobeChat project, we place great emphasis on the quality and consistency of the code. For this reason, we have established a series of code style standards and contribution processes to ensure that every developer can smoothly participate in the project. Here are the code style and contribution guidelines you need to follow as a developer.
|
||||
|
||||
- **Code Style**: We use `@lobehub/lint` to unify the code style, including ESLint, Prettier, remarklint, and stylelint configurations. Please adhere to our code standards to maintain code consistency and readability.
|
||||
- **Contribution Process**: We use gitmoji and semantic release for code submission and release processes. Please use gitmoji to annotate your commit messages and ensure compliance with the semantic release standards so that our automation systems can correctly handle version control and releases.
|
||||
|
||||
All contributions will undergo code review. Maintainers may suggest modifications or requirements. Please respond actively to review comments and make timely adjustments. We look forward to your participation and contribution.
|
||||
|
||||
For detailed code style and contribution guidelines, please refer to [Code Style and Contribution Guide](Contributing-Guidelines.zh-CN.md).
|
||||
|
||||
## Internationalization Implementation Guide
|
||||
|
||||
LobeChat uses `i18next` and `lobe-i18n` to implement multilingual support, ensuring a global user experience.
|
||||
|
||||
Internationalization files are located in `src/locales`, containing the default language (Chinese). We generate other language JSON files automatically through `lobe-i18n`.
|
||||
|
||||
If you want to add a new language, follow specific steps detailed in [New Language Addition Guide](../Internationalization/Add-New-Locale.zh-CN.md). We encourage you to participate in our internationalization efforts to provide better services to global users.
|
||||
|
||||
For a detailed guide on internationalization implementation, please refer to [Internationalization Implementation Guide](../Internationalization/Internationalization-Implementation.zh-CN.md).
|
||||
|
||||
## Appendix: Resources and References
|
||||
|
||||
To support developers in better understanding and using the technology stack of LobeChat, we provide a comprehensive list of resources and references — [LobeChat Resources and References](https://github.com/lobehub/lobe-chat/wiki/Resources.zh-CN) - Visit our maintained list of resources, including tutorials, articles, and other useful links.
|
||||
|
||||
We encourage developers to utilize these resources to deepen their learning and enhance their skills, join community discussions through [LobeChat GitHub Discussions](https://github.com/lobehub/lobe-chat/discussions) or [Discord](https://discord.com/invite/AYFPHvv2jT), ask questions, or share your experiences.
|
||||
|
||||
If you have any questions or need further assistance, please do not hesitate to contact us through the above channels.
|
||||
For a detailed introduction to the directory structure, please refer to: [Folder Directory Structure](Folder-Structure.en-US.md)
|
||||
|
||||
@@ -76,9 +76,6 @@ bun run dev
|
||||
# 访问 http://localhost:3010 查看应用
|
||||
```
|
||||
|
||||
> \[!IMPORTANT]\
|
||||
> 如果使用`npm`安装依赖出现`Could not find "stylelint-config-recommended"`错误,请使用 `pnpm` 或者 `bun` 重新安装依赖。
|
||||
|
||||
现在,你应该可以在浏览器中看到 LobeChat 的欢迎页面。详细的环境配置指南,请参考 [开发环境设置指南](Setup-Development.zh-CN.md)。
|
||||
|
||||
## 代码风格与贡献指南
|
||||
|
||||
@@ -1,56 +1,40 @@
|
||||
---
|
||||
title: LobeChat Authorization Service
|
||||
title: >-
|
||||
LobeChat Identity Verification Service - Centralized User Authorization
|
||||
Management
|
||||
description: >-
|
||||
Learn about LobeChat's support for configuring external identity verification
|
||||
services for centralized user authorization within enterprises/organizations.
|
||||
Explore supported services like Auth0, Microsoft Entra ID, Authentik, Github,
|
||||
and ZITADEL.
|
||||
tags:
|
||||
- Identity Verification Service
|
||||
- Centralized User Authorization
|
||||
- SSO Providers
|
||||
- Next Auth
|
||||
- Clerk
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
---
|
||||
|
||||
# LobeChat Authorization
|
||||
# Identity Verification Service
|
||||
|
||||
LobeChat supports the configuration of external identity verification services for internal use within enterprises/organizations to centrally manage user authorization.
|
||||
|
||||
## Clerk
|
||||
|
||||
Clerk is a comprehensive identity verification solution that has recently gained popularity. It provides a simple yet powerful API and services to handle user authentication and session management. Clerk's design philosophy is to offer a concise and modern authentication solution that enables developers to easily integrate and use it.
|
||||
|
||||
LobeChat has deeply integrated with Clerk to provide users with a more secure and convenient login and registration experience. It also relieves developers from the burden of managing authentication logic. Clerk's concise and modern design philosophy aligns perfectly with LobeChat's goals, making user management on the entire platform more efficient and reliable.
|
||||
|
||||
By setting the environment variables NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in LobeChat's environment, you can enable and use Clerk.
|
||||
|
||||
## Next Auth
|
||||
|
||||
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. |
|
||||
| `ACCESS_CODE` | Required | Add a password to access this service. You can set a sufficiently long random password to "disable" access code authorization. |
|
||||
| `NEXTAUTH_URL` | Optional | 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,azure-ad,authentik`. |
|
||||
|
||||
Currently supported identity verification services include:
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
||||
<Card
|
||||
href={'/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
||||
title={'Microsoft Entra ID'}
|
||||
/>
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
||||
<Card href={'/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
||||
</Cards>
|
||||
- [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
|
||||
- [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
|
||||
- [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
|
||||
- [Github](/docs/self-hosting/advanced/sso-providers/github)
|
||||
- [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
|
||||
|
||||
Click on the links to view the corresponding platform's configuration documentation.
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
To simultaneously enable multiple identity verification sources, please set the `SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
|
||||
The order corresponds to the display order of the SSO providers.
|
||||
|
||||
|
||||
@@ -1,54 +1,36 @@
|
||||
---
|
||||
title: LobeChat 身份验证服务配置
|
||||
description: 了解如何使用 Clerk 或 Next Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、 Azure ID 等。
|
||||
title: LobeChat 外部身份验证服务配置指南
|
||||
description: >-
|
||||
了解如何配置外部身份验证服务以统一管理用户授权。支持的身份验证服务包括 Auth0, Microsoft Entra ID, Authentik,
|
||||
Github, 和 ZITADEL。
|
||||
tags:
|
||||
- 身份验证服务
|
||||
- LobeChat
|
||||
- SSO
|
||||
- Clerk
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
---
|
||||
|
||||
# 身份验证服务
|
||||
|
||||
LobeChat 支持使用 Clerk 或者 Next Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
|
||||
|
||||
## Clerk
|
||||
|
||||
Clerk 是一个近期流行起来的全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。Clerk 的设计哲学是提供一套简洁、现代的认证解决方案,使得开发者可以轻松集成和使用。
|
||||
|
||||
LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全、便捷的登录和注册体验,同时也为开发者减轻了管理身份验证逻辑的负担。Clerk 的简洁和现代的设计理念与 LobeChat 的目标非常契合,使得整个平台的用户管理更加高效和可靠。
|
||||
|
||||
在 LobeChat 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。
|
||||
|
||||
## Next Auth
|
||||
|
||||
在使用 NextAuth 之前,请先在 LobeChat 的环境变量中设置以下变量:
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
|
||||
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
||||
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。 |
|
||||
LobeChat 支持配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
|
||||
|
||||
目前支持的身份验证服务有:
|
||||
|
||||
<Cards>
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
||||
<Card
|
||||
href={'/zh/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
||||
title={'Microsoft Entra ID'}
|
||||
/>
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
||||
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
||||
</Cards>
|
||||
- [Auth0](/docs/self-hosting/advanced/sso-providers/auth0)
|
||||
- [Microsoft Entra ID](/docs/self-hosting/advanced/sso-providers/microsoft-entra-id)
|
||||
- [Authentik](/docs/self-hosting/advanced/sso-providers/authentik)
|
||||
- [Github](/docs/self-hosting/advanced/sso-providers/github)
|
||||
- [ZITADEL](/docs/self-hosting/advanced/sso-providers/zitadel)
|
||||
|
||||
点击即可查看对应平台的配置文档。
|
||||
点击链接可以查看对应平台的配置文档。
|
||||
|
||||
## 进阶配置
|
||||
|
||||
同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
|
||||
同时启用多个身份验证源请设置 `SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
|
||||
|
||||
顺序为 SSO 提供商的显示顺序。
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
title: LobeChat Feature Flags Environment Variables Configuration Guide
|
||||
description: >-
|
||||
Learn how to use environment variables to customize LobeChat's feature flags,
|
||||
including controlling whether a feature is enabled or disabled, or enabling or
|
||||
disabling features for specific user groups or environments as needed.
|
||||
tags:
|
||||
- LobeChat
|
||||
- Environment Variables
|
||||
- Configuration Guide
|
||||
- Feature Flags
|
||||
---
|
||||
|
||||
# Feature Flags
|
||||
|
||||
In addition to basic environment variable configuration, LobeChat also offers feature flags to control whether a feature is enabled globally, or to enable or disable features for specific user groups or environments as needed.
|
||||
|
||||
## Feature Flags Environment Variable `FEATURE_FLAGS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to control LobeChat's feature functionalities. Supports multiple feature flags, using `+` to add a feature and `-` to disable a feature. Separate multiple feature flags with a comma `,` and enclose the entire value in quotes `"` to avoid parsing errors.
|
||||
- Default: `-`
|
||||
- Example: `"-welcome_suggest"`
|
||||
|
||||
All features are controlled by the `FEATURE_FLAGS` variable as the sole configuration variable.
|
||||
|
||||
You can achieve various feature combinations using the above configuration syntax. All feature flags are Boolean values, enabled with `+` and disabled with `-`.
|
||||
|
||||
<Callout type={'tip'}>
|
||||
Attention: Unlike the `OPENAI_MODEL_LIST` variable, the `FEATURE_FLAGS` variable does not support
|
||||
the `all` keyword. You need to manually control all feature flags (otherwise, they will adopt
|
||||
their default values).
|
||||
</Callout>
|
||||
|
||||
| Configuration Item | Description | Default Value |
|
||||
| ------------------------- | ----------------------------------------------- | ------------- |
|
||||
| `webrtc_sync` | Enables WebRTC sync functionality. | Disabled |
|
||||
| `language_model_settings` | Enables language model settings. | Enabled |
|
||||
| `openai_api_key` | Allows users to customize the OpenAI API Key. | Enabled |
|
||||
| `openai_proxy_url` | Allows users to customize the OpenAI proxy URL. | Enabled |
|
||||
| `create_session` | Allows users to create sessions. | Enabled |
|
||||
| `edit_agent` | Allows users to edit assistants. | Enabled |
|
||||
| `dalle` | Enables the DALL-E functionality. | Enabled |
|
||||
| `check_updates` | Allows checking for updates. | Enabled |
|
||||
| `welcome_suggest` | Displays welcome suggestions. | Enabled |
|
||||
|
||||
You can always check the [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) to get the latest list of feature flags.
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: LobeChat 特性标志环境变量配置指南
|
||||
description: 了解如何使用环境变量自定义 LobeChat 的特性标志,包括控制否启用某个功能、或者根据需要对特定用户群体或环境启用或禁用功能。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 环境变量
|
||||
- 配置指南
|
||||
- 特征标志
|
||||
---
|
||||
|
||||
# 特性标志
|
||||
|
||||
除了基础的环境变量配置外,LobeChat 还提供了一些特性标志(Feature Flags),用于控制是否全局启用某个功能,或者根据需要对特定用户群体或环境启用或禁用功能。
|
||||
|
||||
## 特性标志环境变量 `FEATURE_FLAGS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于控制 LobeChat 的特性功能,支持多个功能标志,使用 `+` 增加一个功能,使用 `-` 来关闭一个功能,多个功能标志之间使用英文逗号 `,` 隔开,最外层建议添加引号 `"` 以避免解析错误。
|
||||
- 默认值:`-`
|
||||
- 示例:`"-welcome_suggest"`
|
||||
|
||||
所有的功能统一以特性标志 `FEATURE_FLAGS` 作为唯一的配置变量。
|
||||
|
||||
你可以通过上述配置语法来实现更多的功能组合。所有的功能配置项都是布尔类型,通过 `+` 来启用,通过 `-` 来关闭。
|
||||
|
||||
<Callout type={'tip'}>
|
||||
注意:与 `OPENAI_MODEL_LIST` 变量不同,`FEATURE_FLAGS` 变量不支持 `all`
|
||||
关键字,你需要手动控制所有的功能标志(否则它们会采用对应的默认值)。
|
||||
</Callout>
|
||||
|
||||
| 配置项 | 解释 | 默认值 |
|
||||
| ------------------------- | -------------------------------- | ------ |
|
||||
| `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` | 显示欢迎建议。 | 开启 |
|
||||
|
||||
你可以随时检查 [featureFlags](https://github.com/lobehub/lobe-chat/blob/main/src/config/featureFlags/schema.ts) 以获取最新的特性标志列表。
|
||||
@@ -12,10 +12,10 @@ tags:
|
||||
|
||||
# Model List
|
||||
|
||||
LobeChat supports customizing the model list during deployment. This configuration is done in the environment for each [model provider](/docs/self-hosting/environment-variables/model-provider). You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
||||
LobeChat supports customizing the model list during deployment. You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
||||
|
||||
```text
|
||||
id=displayName<maxToken:vision:fc:file>,model2,model3
|
||||
```shell
|
||||
id=displayName < maxToken:vision:fc:file > ,model2,model3
|
||||
```
|
||||
|
||||
For example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
||||
@@ -36,7 +36,7 @@ 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;
|
||||
- `gemini-pro-vision=Gemini Pro Vision<16000:vision>`: Google Vision model, maximum context of 16k, supports image recognition;
|
||||
- `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:
|
||||
|
||||
@@ -8,13 +8,12 @@ tags:
|
||||
- 模型展示名
|
||||
- 模型能力
|
||||
---
|
||||
|
||||
# Model List
|
||||
|
||||
LobeChat 支持在部署时自定义模型列表,可以使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。通过 `<>` 来添加扩展配置。基本语法如下:
|
||||
|
||||
```text
|
||||
id=displayName<maxToken:vision:fc:file>,model2,model3
|
||||
```shell
|
||||
id=displayName < maxToken:vision:fc:file > ,model2,model3
|
||||
```
|
||||
|
||||
例如: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
||||
@@ -35,7 +34,7 @@ id=displayName<maxToken:vision:fc:file>
|
||||
|
||||
- `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,支持图像识别;
|
||||
- `gemini-pro-vision=Gemini Pro Vision<16000:vision>`:Google 视觉模型,最大上下文 16k,支持图像识别;
|
||||
- `gpt-4-all=ChatGPT Plus<128000:fc:vision:file>`,hack 的 ChatGPT Plus 网页版,上下 128k ,支持图像识别、Function Call、文件上传
|
||||
|
||||
目前支持的扩展能力有:
|
||||
|
||||
@@ -1,425 +0,0 @@
|
||||
---
|
||||
title: Deploying Server-Side Database - Configuration Guide for LobeChat on Vercel
|
||||
description: >-
|
||||
Learn how to deploy the server-side database version of LobeChat on Vercel,
|
||||
including database configuration, identity authentication service setup, and
|
||||
S3 storage service configuration.
|
||||
tags:
|
||||
- Server-Side Database
|
||||
- Vercel Deployment
|
||||
- Postgres Database
|
||||
- Identity Authentication
|
||||
- S3 Storage Service
|
||||
- Configuration Guide
|
||||
---
|
||||
|
||||
# Deploying Server-Side Database
|
||||
|
||||
LobeChat defaults to using a client-side database (IndexedDB) but also supports using a server-side database. LobeChat uses Postgres as the backend storage database. PostgreSQL is a powerful open-source relational database management system with high scalability and standard SQL support. It provides rich data types, concurrency control, data integrity, security, and programmability, making it suitable for complex applications and large-scale data management.
|
||||
|
||||
This article will detail how to deploy the server-side database version of LobeChat on Vercel, including: 1) database configuration; 2) identity authentication service configuration; 3) steps for setting up the S3 storage service.
|
||||
|
||||
<Callout type={'info'}>
|
||||
Due to workload constraints, currently only deployment on Vercel using the server-side database
|
||||
version is supported, with Docker version support planned for future iterations.
|
||||
</Callout>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Before proceeding, please ensure the following
|
||||
- **Export all data.** After deploying the server-side database, the original user data cannot be migrated automatically. You must back it up in advance and import it manually!
|
||||
- **The `ACCESS_CODE` environment variable is set.** It should not be empty or cleared!
|
||||
- **It is crucial to fill in all the environment variables required for the server-side database configuration before deployment.** Failure to do so may result in database migration issues!
|
||||
</Callout>
|
||||
|
||||
## 1. Configure the Database
|
||||
|
||||
<Steps>
|
||||
|
||||
### Prepare a Server-Side Database Instance and Obtain the Connection URL
|
||||
|
||||
Before deployment, make sure you have prepared a Postgres database instance. You can choose either 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, which will be distinguished in the next step.
|
||||
|
||||
### Add Environment Variables in Vercel
|
||||
|
||||
In Vercel's deployment environment variables, add the `DATABASE_URL` and other environment variables. Fill in the prepared Postgres database connection URL. The typical format for the database connection URL is `postgres://username:password@host:port/database`.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Confirm the type of `Postgres` your provider offers. If it's `Node Postgres`, you must add the environment variable `DATABASE_DRIVER=node`.
|
||||
</Callout>
|
||||
|
||||
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
||||
|
||||
<Tab>
|
||||
|
||||
Variables required for Serverless Postgres are as follows:
|
||||
|
||||
```shell
|
||||
# Serverless Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# Specify the service mode as server, otherwise it won't enter the server-side database
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
An example of how to fill in Vercel is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Add Serverless Postgres DATABASE_URL'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}
|
||||
></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
Variables required for Node Postgres are as follows:
|
||||
|
||||
```shell
|
||||
# Node Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# Specify the Postgres database driver as node
|
||||
DATABASE_DRIVER=node
|
||||
|
||||
# Specify the service mode as server, otherwise it won't enter the server-side database
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
An example of how to fill in Vercel is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Add Node Postgres DATABASE_URL'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}
|
||||
></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tabs>
|
||||
|
||||
<Callout type={'info'}>
|
||||
To connect to the database using SSL, please refer to this [link](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode) for instructions on how to configure it.
|
||||
</Callout>
|
||||
|
||||
### Add the `KEY_VAULTS_SECRET` Environment Variable
|
||||
|
||||
After adding the `DATABASE_URL` environment variable, you need to add a `KEY_VAULTS_SECRET` environment variable. This variable is used to encrypt sensitive information like user-stored API keys. You can generate a random 32-character string as the key using `openssl rand -base64 32`.
|
||||
|
||||
```shell
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
```
|
||||
|
||||
Add this to the Vercel environment variables as well.
|
||||
|
||||
</Steps>
|
||||
|
||||
## 2. Configure the Identity Authentication Service
|
||||
|
||||
A server-side database needs to be paired with an identity authentication service to function properly. Therefore, the corresponding identity authentication service needs to be configured.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Due to workload constraints, currently only Clerk is supported as an identity authentication
|
||||
service solution. Integration with Next-Auth for server-side database is under development.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### Prepare the Clerk Identity 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.
|
||||
|
||||
<Callout type={'info'}>
|
||||
If you are unfamiliar with Clerk, you can refer to [Authentication
|
||||
Service-Clerk](/en/docs/self-hosting/advanced/authentication#clerk) for details on using Clerk.
|
||||
</Callout>
|
||||
|
||||
### 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.
|
||||
|
||||
<Image
|
||||
alt={'Find the corresponding public and private key environment variables in Clerk'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
|
||||
></Image>
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
Add these variables to Vercel:
|
||||
|
||||
<Image
|
||||
alt={'Add Clerk public and private key environment variables in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
|
||||
></Image>
|
||||
|
||||
### Create and Configure a Webhook in Clerk
|
||||
|
||||
Since we let Clerk handle user authentication and management entirely, we need Clerk to notify our application and store data in the database when there are changes in the user lifecycle (create, update, delete). We achieve this 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 status changes.
|
||||
|
||||
<Image
|
||||
alt={'Add an endpoint in Clerk Webhooks'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
|
||||
>
|
||||
|
||||
</Image>
|
||||
|
||||
Fill in your Vercel project's URL in the endpoint, such as `https://your-project.vercel.app/api/webhooks/clerk`. Then, in the Subscribe to events section, check the three user events (`user.created`, `user.deleted`, `user.updated`), and click create.
|
||||
|
||||
<Callout type={'warning'}>Ensure that the URL includes the `https://` prefix. Maintaining the integrity of the URL is crucial.</Callout>
|
||||
|
||||
<Image
|
||||
alt={'Configure URL and user events when adding Clerk Webhooks'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
|
||||
></Image>
|
||||
|
||||
### Add the Webhook Secret to Vercel Environment Variables
|
||||
|
||||
After creation, you can find the secret of this Webhook in the bottom right corner:
|
||||
|
||||
<Image
|
||||
alt={'View Clerk Webhook secret'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variable name for this secret is `CLERK_WEBHOOK_SECRET`:
|
||||
|
||||
```shell
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
Add this to Vercel's environment variables:
|
||||
|
||||
<Image
|
||||
alt={'Add Clerk Webhook secret in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}>
|
||||
|
||||
</Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
You have now successfully configured the Clerk identity authentication service. Next, we will configure the S3 storage service.
|
||||
|
||||
## 3. Configure S3 Storage Service
|
||||
|
||||
LobeChat has long supported multimodal AI conversations, involving the function of uploading images to AI. In the client-side database solution, image files are stored as binary data in the browser's indexedDB database. However, this solution is not feasible in the server-side database. We need to configure the S3 storage service to store a large number of image files, and S3 can also serve as a storage solution for file uploads.
|
||||
|
||||
<Callout type={'info'}>
|
||||
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 etc., all of
|
||||
which support S3-compatible APIs.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### 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. Below is an example of the creation process using Cloudflare R2.
|
||||
|
||||
The interface of Cloudflare R2 is shown below:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 Storage Interface'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
||||
></Image>
|
||||
|
||||
When creating the bucket, specify its name and then click create.
|
||||
|
||||
<Image
|
||||
alt={'Create Bucket in R2'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
||||
></Image>
|
||||
|
||||
### Obtain Environment Variables for the Bucket
|
||||
|
||||
In the settings of the R2 storage bucket, you can view the bucket configuration information:
|
||||
|
||||
<Image
|
||||
alt={'View Bucket Information'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variables are:
|
||||
|
||||
```shell
|
||||
# Bucket name
|
||||
S3_BUCKET=lobechat
|
||||
# Bucket request endpoint(note that the path of this link contains the bucket name, you must remove the path, or use the link provided on the "Apply for S3 API Token" page)
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# Public domain for accessing the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>The path must be removed from the `S3_ENDPOINT`, otherwise, uploaded files will be inaccessible.</Callout>
|
||||
|
||||
### 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:
|
||||
|
||||
<Image
|
||||
alt={'View Access Key for Bucket'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
||||
></Image>
|
||||
|
||||
Click the button in the upper right corner to create an API token, then enter the API Token creation page.
|
||||
|
||||
<Image
|
||||
alt={'Create Corresponding API Token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
||||
></Image>
|
||||
|
||||
Since our server-side database needs to read and write to the S3 storage service, the permission needs to be set to `Administrator Read and Write`. Then, click Create.
|
||||
|
||||
<Callout type={'warning'}>The permission must be set to `Administrator Read and Write`, otherwise, uploading photos and other files will not be possible.</Callout>
|
||||
|
||||
<Image
|
||||
alt={'Configure API Token Permissions'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
||||
></Image>
|
||||
|
||||
After creation, you can see the corresponding S3 API token.
|
||||
|
||||
<Image
|
||||
alt={'Copy API Token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
||||
></Image>
|
||||
|
||||
The corresponding environment variables are:
|
||||
|
||||
```shell
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
```
|
||||
|
||||
### Add the 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 in the end:
|
||||
|
||||
<Callout type={'warning'}>Ensure that the `S3_ENDPOINT` includes the `https://` prefix. Maintaining the integrity of the URL is crucial.</Callout>
|
||||
|
||||
```shell
|
||||
# S3 Key
|
||||
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 accessing the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
|
||||
# Bucket region, such as us-west-1, generally not required to add, but some service providers may need to configure
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
|
||||
Then enter the above environment variables into Vercel's environment variables:
|
||||
|
||||
<Image
|
||||
alt={'Add S3 Environment Variables in Vercel'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
|
||||
></Image>
|
||||
|
||||
### Configure Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
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:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 CORS Settings'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
||||
></Image>
|
||||
|
||||
Add a CORS rule to allow requests from your domain (in this case, `https://your-project.vercel.app`):
|
||||
|
||||
<Image
|
||||
alt={'Configure Allowed Site Domain'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
||||
></Image>
|
||||
|
||||
Example configuration:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"AllowedOrigins": ["https://your-project.vercel.app"],
|
||||
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
||||
"AllowedHeaders": ["*"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
After configuration, click save.
|
||||
|
||||
</Steps>
|
||||
|
||||
## 4. Deployment and Verification
|
||||
|
||||
After completing the above steps, the configuration of the server database should be done. Next, we can deploy LobeChat to Vercel and then visit your Vercel link to verify if the server database is working correctly.
|
||||
|
||||
<Steps>
|
||||
### Redeploy the latest commit
|
||||
|
||||
After configuring the environment variables, you need to redeploy the latest commit and wait for the deployment to complete.
|
||||
|
||||
<Image
|
||||
alt={'Redeploy the latest commit'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
|
||||
></Image>
|
||||
|
||||
### Check if the features are working properly
|
||||
|
||||
If you click on the login button in the top left corner and the login popup appears normally, then you have configured it successfully. Enjoy using it\~
|
||||
|
||||
<Image alt={'User login popup'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}>
|
||||
|
||||
</Image>
|
||||
|
||||
<Image alt={'Login success status'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}>
|
||||
|
||||
</Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
## Appendix
|
||||
|
||||
### Overview of Server Database Environment Variables
|
||||
|
||||
For easy copying, here is a summary of the environment variables required to configure the server database:
|
||||
|
||||
```shell
|
||||
# Specify the service mode as server
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres database URL
|
||||
DATABASE_URL=
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
|
||||
# Clerk related configurations
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# S3 related configurations
|
||||
# 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 access domain for the bucket
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
# Bucket region, such as us-west-1, generally not needed to add, but some service providers may require configuration
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
@@ -1,413 +0,0 @@
|
||||
---
|
||||
title: 使用服务端数据库部署 - 配置 Postgres、Clerk 和 S3 存储服务
|
||||
description: 本文详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置和 S3 存储服务的设置步骤。
|
||||
tags:
|
||||
- 服务端数据库
|
||||
- Postgres
|
||||
- Clerk
|
||||
- S3存储服务
|
||||
- Vercel部署
|
||||
- 数据库配置
|
||||
- 身份验证服务
|
||||
- 环境变量配置
|
||||
---
|
||||
|
||||
# 使用服务端数据库部署
|
||||
|
||||
LobeChat 默认使用客户端数据库(IndexedDB),同时也支持使用服务端数据库。LobeChat 采用了 Postgres 作为后端存储数据库。PostgreSQL是一种强大的开源关系型数据库管理系统,具备高度扩展性和标准SQL支持。它提供了丰富的数据类型、并发处理、数据完整性、安全性及可编程性,适用于复杂应用和大规模数据管理。
|
||||
|
||||
本文将详细介绍如何在 Vercel 中部署服务端数据库版 LobeChat,包括: 1)数据库配置;2)身份验证服务配置;3) S3 存储服务的设置步骤。
|
||||
|
||||
<Callout type={'info'}>
|
||||
限于工作量原因,目前仅支持在 Vercel 中部署使用服务端数据库版本,Docker 版本将会在后续迭代中支持。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
进行后续操作前,请务必确认以下事项
|
||||
- 导出所有数据,部署服务端数据库后,原有用户数据无法自动迁移,只能提前备份后进行手动导入!
|
||||
- 环境变量中的`ACCESS_CODE`未设置或已清除!
|
||||
- 配置服务端数据库所需要的环境变量时,需全部填入后再进行部署,否则可能遭遇数据库迁移问题!
|
||||
</Callout>
|
||||
|
||||
## 一、 配置数据库
|
||||
|
||||
<Steps>
|
||||
|
||||
### 准备服务端数据库实例,获取连接 URL
|
||||
|
||||
在部署之前,请确保你已经准备好 Postgres 数据库实例,你可以选择以下任一方式:
|
||||
|
||||
- `A.` 使用 Vercel / Neon 等 Serverless Postgres 实例;
|
||||
- `B.` 使用 Docker 等自部署 Postgres 实例。
|
||||
|
||||
两者的配置方式略有不同,在下一步会有所区分。
|
||||
|
||||
### 在 Vercel 中添加环境变量
|
||||
|
||||
在 Vercel 的部署环境变量中,添加 `DATABASE_URL` 等环境变量,将上一步准备好的 Postgres 数据库连接 URL 填入其中。数据库连接 URL 的通常格式为 `postgres://username:password@host:port/database`。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
确认您的供应商所提供的`Postgres`类型,若为`Node Postgres`,则必须添加环境变量`DATABASE_DRIVER=node`
|
||||
</Callout>
|
||||
|
||||
<Tabs items={['Serverless Postgres', 'Node Postgres']}>
|
||||
|
||||
<Tab>
|
||||
|
||||
Serverless Postgres 需要填写的变量如下:
|
||||
|
||||
```shell
|
||||
# Serverless Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# 指定 service mode 为 server,否则不会进入服务端数据库
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
在 Vercel 中填写的示例如下:
|
||||
|
||||
<Image alt={'添加 Serverless Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/d4a710cd-6404-4196-90d0-cd08ca385074'}></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab>
|
||||
Node Postgres 需要填写的变量如下:
|
||||
|
||||
```shell
|
||||
# Node Postgres DB Url
|
||||
DATABASE_URL=
|
||||
|
||||
# 指定 Postgres database driver 为 node
|
||||
DATABASE_DRIVER=node
|
||||
|
||||
# 指定 service mode 为 server,否则不会进入服务端数据库
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
```
|
||||
|
||||
在 Vercel 中填写的示例如下:
|
||||
|
||||
<Image alt={'添加 Node Postgres DATABASE_URL'} src={'https://github.com/lobehub/lobe-chat/assets/28616219/1c689738-809b-4199-b305-ba5770d39da7'}></Image>
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tabs>
|
||||
|
||||
<Callout type={'info'}>
|
||||
如果希望连接数据库时启用 SSL ,请自行参考[链接](https://stackoverflow.com/questions/14021998/using-psql-to-connect-to-postgresql-in-ssl-mode)进行设置
|
||||
</Callout>
|
||||
|
||||
### 添加 `KEY_VAULTS_SECRET` 环境变量
|
||||
|
||||
在完成数据库 DATABASE_URL 环境变量添加后,需要添加一个 `KEY_VAULTS_SECRET` 环境变量。该变量用于加密用户存储的 apikey 等敏感信息。你可以使用 `openssl rand -base64 32` 生成一个随机的 32 位字符串作为密钥。
|
||||
|
||||
```shell
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
```
|
||||
|
||||
同样需要将其添加到 Vercel 环境变量中。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 二、 配置身份验证服务
|
||||
|
||||
服务端数据库需要搭配用户身份验证服务才可以正常使用。因此需要配置对应的身份验证服务。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
同样由于工作量原因,目前仅支持 Clerk 作为身份验证服务方案, Next-Auth 的服务端数据库集成有待开发
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### 准备 Clerk 身份验证服务
|
||||
|
||||
前往 [Clerk](https://clerk.com?utm_source=lobehub&utm_medium=docs) 注册并创建应用,获取相应的 Public Key 和 Secret Key。
|
||||
|
||||
<Callout type={'info'}>
|
||||
如果对 Clerk 不太了解,可以查阅
|
||||
[身份验证服务-Clerk](/zh/docs/self-hosting/advanced/authentication#clerk) 了解 Clerk 的使用详情。
|
||||
</Callout>
|
||||
|
||||
### 在 Vercel 中添加公、私钥环境变量
|
||||
|
||||
在 Vercel 的部署环境变量中,添加 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY` 环境变量。你可以在菜单中点击「API Keys」,然后复制对应的值填入 Vercel 的环境变量中。
|
||||
|
||||
<Image
|
||||
alt={'在 Clerk 中找到对应的公私钥环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/89883703-7a1a-4a11-b944-5d804544e57c'}
|
||||
></Image>
|
||||
|
||||
此步骤所需的环境变量如下:
|
||||
|
||||
```shell
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
添加上述变量到 Vercel 中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中添加 Clerk 公私钥环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2bfa13df-6e20-4768-97c0-4dad06c85a2f'}
|
||||
></Image>
|
||||
|
||||
### 在 Clerk 中创建并配置 Webhook
|
||||
|
||||
由于我们让 Clerk 完全接管用户鉴权与管理,因此我们需要在 Clerk 用户生命周期变更时(创建、更新、删除)中通知我们的应用并存储落库。我们通过 Clerk 提供的 Webhook 来实现这一诉求。
|
||||
|
||||
我们需要在 Clerk 的 Webhooks 中添加一个端点(Endpoint),告诉 Clerk 当用户发生变更时,向这个端点发送通知。
|
||||
|
||||
<Image
|
||||
alt={'Clerk 添加 Webhooks 端点'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/f50f47fb-5e8e-4930-bf4e-8cf6f5b8afb9'}
|
||||
></Image>
|
||||
|
||||
在 endppint 中填写你的 Vercel 项目的 URL,如 `https://your-project.vercel.app/api/webhooks/clerk`。然后在订阅事件(Subscribe to events)中,勾选 user 的三个事件(`user.created` 、`user.deleted`、`user.updated`),然后点击创建。
|
||||
|
||||
<Callout type={'warning'}>URL的`https://`不可缺失,须保持URL的完整性</Callout>
|
||||
|
||||
<Image
|
||||
alt={'添加 Clerk Webhooks 时,配置 URL 和用户事件'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/0249ea56-ab17-4aa9-a56c-9ebd556c2645'}
|
||||
></Image>
|
||||
|
||||
### 将 Webhook 秘钥添加到 Vercel 环境变量
|
||||
|
||||
创建完毕后,可以在右下角找到该 Webhook 的秘钥:
|
||||
|
||||
<Image
|
||||
alt={'查看 Clerk Webhooks 秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/fab4abb2-584b-49de-9340-813382951635'}
|
||||
></Image>
|
||||
|
||||
这个秘钥所对应的环境变量名为 `CLERK_WEBHOOK_SECRET`:
|
||||
|
||||
```shell
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
将其添加到 Vercel 的环境变量中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中 添加 Clerk Webhooks 秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/5fdc9479-007f-46ab-9d6e-a9603e949116'}
|
||||
></Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
这样,你已经成功配置了 Clerk 身份验证服务。接下来我们将配置 S3 存储服务。
|
||||
|
||||
## 三、 配置 S3 存储服务
|
||||
|
||||
LobeChat 在很早以前就支持了多模态 的 AI 会话,其中涉及到图片上传给 AI 的功能。在客户端数据库方案中,图片文件直接以二进制数据存储在浏览器 indexedDB 数据库,但在服务端数据库中这个方案并不可行。我们需要配置 S3 存储服务来存储大量的图片文件,同时 S3 也可以作为文件上传的存储方案。
|
||||
|
||||
<Callout type={'info'}>
|
||||
在本文,S3所指代的是指兼容 S3 存储方案,即支持 Amazon S3 API 的对象存储系统,常见例如 Cloudflare
|
||||
R2 、阿里云 OSS 等均支持 S3 兼容 API。
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
|
||||
### 配置并获取 S3 存储桶
|
||||
|
||||
你需要前往你的 S3 服务提供商(如 AWS S3、Cloudflare R2 等)并创建一个新的存储桶(Bucket)。接下来以 Cloudflare R2 为例,介绍创建流程。
|
||||
|
||||
下图是 Cloudflare R2 的界面:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 存储界面'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/41f7f677-0153-4a96-b849-5ac9b7ebefee'}
|
||||
></Image>
|
||||
|
||||
创建存储桶时将指定其名称,然后点击创建。
|
||||
<Image
|
||||
alt={'R2 创建存储桶'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9c0d184c-3169-40fa-9115-011cfffb9ca7'}
|
||||
></Image>
|
||||
|
||||
### 获取存储桶相关环境变量
|
||||
|
||||
在 R2 存储桶的设置中,可以看到桶配置的信息:
|
||||
|
||||
<Image
|
||||
alt={'查看存储桶的相关信息'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/2ceb210c-eca0-4439-ba27-8734d4ebb3ee'}
|
||||
></Image>
|
||||
|
||||
其对应的环境变量为:
|
||||
|
||||
```shell
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点(注意此处链接的路径带存储桶名称,必须删除该路径,或使用申请 S3 API token 页面所提供的链接)
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>`S3_ENDPOINT`必须删除其路径,否则会无法访问所上传文件</Callout>
|
||||
|
||||
### 获取 S3 密钥环境变量
|
||||
|
||||
你需要获取 S3 的访问密钥,以便 LobeChat 的服务端有权限访问 S3 存储服务。在 R2 中,你可以在账户详情中配置访问密钥:
|
||||
|
||||
<Image
|
||||
alt={'查看存储桶的访问秘钥'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/be0c95c0-6693-44ee-a490-7e8dfaa8b34d'}
|
||||
></Image>
|
||||
|
||||
点击右上角按钮创建 API token,进入创建 API Token 页面
|
||||
|
||||
<Image
|
||||
alt={'创建对应 API token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/7b0ea46c-5157-40a8-888f-f47664a4884f'}
|
||||
></Image>
|
||||
|
||||
鉴于我们的服务端数据库需要读写 S3 存储服务,因此权限需要选择`管理员读与写`,然后点击创建。
|
||||
|
||||
<Callout type={'warning'}>权限必须为`管理员读与写`,否则无法上传照片等其它文件</Callout>
|
||||
|
||||
<Image
|
||||
alt={'配置 API token 权限'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/d6f5a918-7b50-4d6e-83a6-3894ab930ddf'}
|
||||
></Image>
|
||||
|
||||
创建完成后,就可以看到对应的 S3 API token
|
||||
|
||||
<Image
|
||||
alt={'复制 API token'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/763b18f9-2b5f-44bb-a479-9b56d46f7397'}
|
||||
></Image>
|
||||
|
||||
其对应的环境变量为:
|
||||
|
||||
```shell
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
```
|
||||
|
||||
### 在 Vercel 中添加对应的环境变量
|
||||
|
||||
不同 S3 服务商获取所需环境变量的步骤可能有所不同,但最终获得到的环境变量应该都是一致的:
|
||||
|
||||
<Callout type={'warning'}>URL的`https://`不可缺失,须保持URL的完整性</Callout>
|
||||
|
||||
```shell
|
||||
# S3 秘钥
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-dev.your-domain.com
|
||||
|
||||
# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
|
||||
然后将上述环境变量填入 Vercel 的环境变量中:
|
||||
|
||||
<Image
|
||||
alt={'在 Vercel 中添加 S3 的环境变量'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/cd74152d-0ae8-44fd-b815-3307c56a3c18'}
|
||||
></Image>
|
||||
|
||||
### 配置跨域
|
||||
|
||||
由于 S3 存储服务往往是一个独立的网址,因此需要配置跨域访问。
|
||||
|
||||
在 R2 中,你可以在存储桶的设置中找到跨域配置:
|
||||
|
||||
<Image
|
||||
alt={'Cloudflare R2 的跨域设置'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/ab008be7-26b2-4b78-8bd9-24301bf34d23'}
|
||||
></Image>
|
||||
|
||||
添加跨域规则,允许你的域名(在上文是 `https://your-project.vercel.app`)来源的请求:
|
||||
|
||||
<Image
|
||||
alt={'配置允许你的站点域名'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/dfcc2cb3-2958-4498-a8a4-51bec584fe7d'}
|
||||
></Image>
|
||||
|
||||
示例配置如下:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"AllowedOrigins": ["https://your-project.vercel.app"],
|
||||
"AllowedMethods": ["GET", "PUT", "HEAD", "POST", "DELETE"],
|
||||
"AllowedHeaders": ["*"]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
配置后点击保存即可。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 四、部署并验证
|
||||
|
||||
通过上述步骤之后,我们应该就完成了服务端数据库的配置。接下来我们可以将 LobeChat 部署到 Vercel 上,然后访问你的 Vercel 链接,验证服务端数据库是否正常工作。
|
||||
|
||||
<Steps>
|
||||
### 重新部署最新的 commit
|
||||
|
||||
配置好环境变量后,你需要重新部署最新的 commit,并等待部署完成。
|
||||
|
||||
<Image
|
||||
alt={'重新部署最新的 commit'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/b3a78112-adc8-4837-b4e3-48f67058f16e'}
|
||||
></Image>
|
||||
|
||||
### 检查功能是否正常
|
||||
|
||||
如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~
|
||||
|
||||
<Image
|
||||
alt={'用户登录弹窗'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/da84edc3-46f7-4e2b-a0cd-dc33a98bf5cb'}
|
||||
></Image>
|
||||
|
||||
<Image
|
||||
alt={'登录成功状态'}
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/9cb5150d-6e1e-4c59-9a18-4e418dce1a5d'}
|
||||
></Image>
|
||||
|
||||
</Steps>
|
||||
|
||||
## 附录
|
||||
|
||||
### 服务端数据库环境变量一览
|
||||
|
||||
为方便一键复制,在此汇总配置服务端数据库所需要的环境变量:
|
||||
|
||||
```shell
|
||||
# 指定服务模式为 server
|
||||
NEXT_PUBLIC_SERVICE_MODE=server
|
||||
|
||||
# Postgres 数据库 URL
|
||||
DATABASE_URL=
|
||||
KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk=
|
||||
|
||||
# Clerk 相关配置
|
||||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
|
||||
CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
|
||||
CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# S3 相关配置
|
||||
# S3 秘钥
|
||||
S3_ACCESS_KEY_ID=9998d6757e276cf9f1edbd325b7083a6
|
||||
S3_SECRET_ACCESS_KEY=55af75d8eb6b99f189f6a35f855336ea62cd9c4751a5cf4337c53c1d3f497ac2
|
||||
|
||||
# 存储桶的名称
|
||||
S3_BUCKET=lobechat
|
||||
# 存储桶的请求端点
|
||||
S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
||||
# 存储桶对外的访问域名
|
||||
NEXT_PUBLIC_S3_DOMAIN=https://s3-for-lobechat.your-domain.com
|
||||
# 桶的区域,如 us-west-1,一般来说不需要添加,但某些服务商则需要配置
|
||||
# S3_REGION=us-west-1
|
||||
```
|
||||
@@ -1,25 +1,9 @@
|
||||
---
|
||||
title: Share Settings via URL - Import and Export Configuration Settings
|
||||
description: >-
|
||||
Learn how to import and export configuration settings for LobeChat via URL.
|
||||
Understand the supported settings, URL format, and parameter schema for
|
||||
keyVaults and languageModel.
|
||||
tags:
|
||||
- Share Settings
|
||||
- URL Import
|
||||
- URL Export
|
||||
- Configuration Settings
|
||||
- LobeChat
|
||||
- Parameter Schema
|
||||
---
|
||||
|
||||
# Share settings via URL
|
||||
# Share settings via URL
|
||||
|
||||
LobeChat support import settings from external URL to quickly set up LobeChat configuration.
|
||||
|
||||
The currently supported settings are:
|
||||
|
||||
- `keyVaults`: provider api key and baseURL settings
|
||||
- `languageModel`: Language model settings
|
||||
|
||||
## Import from URL
|
||||
@@ -28,18 +12,18 @@ Use the following URL format to import settings parameters from an external URL:
|
||||
|
||||
```plaintext
|
||||
https://lobehub.com/?settings=<settings object in JSON format>
|
||||
https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
https://lobehub.com/?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
```
|
||||
|
||||
Example of settings in JSON format:
|
||||
|
||||
```json
|
||||
{
|
||||
"keyVaults": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
"languageModel": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -48,100 +32,69 @@ Example of settings in JSON format:
|
||||
```ts
|
||||
// Generate settings to export to URL
|
||||
const settings = {
|
||||
keyVaults: {
|
||||
languageModel: {
|
||||
openai: {
|
||||
apiKey: 'user-key',
|
||||
baseURL: 'https://your-proxy.com/v1',
|
||||
apiKey: 'user-key',
|
||||
endpoint: 'https://lobehub.com/v1'
|
||||
},
|
||||
},
|
||||
};
|
||||
}};
|
||||
// Convert settings to a JSON formatted string
|
||||
const url = `/?settings=${JSON.stringify(settings)}`;
|
||||
console.log(url);
|
||||
// /?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
console.log(url);
|
||||
// /?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>
|
||||
LobeChat does not verify the correctness of the settings parameters in the URL, nor provide
|
||||
encryption or decryption methods. Please use with caution.
|
||||
LobeChat does not verify the correctness of the settings parameters in the URL, nor provide encryption or decryption methods. Please use with caution.
|
||||
</Callout>
|
||||
|
||||
## Parameter schema
|
||||
|
||||
### keyVaults
|
||||
### languageModel
|
||||
|
||||
- Property name and type
|
||||
|
||||
| Property name | Type |
|
||||
| ------------- | -------------------------- |
|
||||
| anthropic | `OpenAICompatibleKeyVault` |
|
||||
| azure | `AzureOpenAIKeyVault` |
|
||||
| bedrock | `AWSBedrockKeyVault` |
|
||||
| google | `OpenAICompatibleKeyVault` |
|
||||
| groq | `OpenAICompatibleKeyVault` |
|
||||
| minimax | `OpenAICompatibleKeyVault` |
|
||||
| mistral | `OpenAICompatibleKeyVault` |
|
||||
| moonshot | `OpenAICompatibleKeyVault` |
|
||||
| ollama | `OpenAICompatibleKeyVault` |
|
||||
| openai | `OpenAICompatibleKeyVault` |
|
||||
| openrouter | `OpenAICompatibleKeyVault` |
|
||||
| perplexity | `OpenAICompatibleKeyVault` |
|
||||
| togetherai | `OpenAICompatibleKeyVault` |
|
||||
| zeroone | `OpenAICompatibleKeyVault` |
|
||||
| zhipu | `OpenAICompatibleKeyVault` |
|
||||
| Property name | Type |
|
||||
|---------------|--------------------------------|
|
||||
| anthropic | GeneralModelProviderConfig |
|
||||
| azure | AzureOpenAIConfig |
|
||||
| bedrock | AWSBedrockConfig |
|
||||
| google | GeneralModelProviderConfig |
|
||||
| groq | GeneralModelProviderConfig |
|
||||
| minimax | GeneralModelProviderConfig |
|
||||
| mistral | GeneralModelProviderConfig |
|
||||
| moonshot | GeneralModelProviderConfig |
|
||||
| ollama | GeneralModelProviderConfig |
|
||||
| openai | GeneralModelProviderConfig |
|
||||
| openrouter | GeneralModelProviderConfig |
|
||||
| perplexity | GeneralModelProviderConfig |
|
||||
| togetherai | GeneralModelProviderConfig |
|
||||
| zeroone | GeneralModelProviderConfig |
|
||||
| zhipu | GeneralModelProviderConfig |
|
||||
|
||||
- Type `OpenAICompatibleKeyVault`
|
||||
- Type `GeneralModelProviderConfig`
|
||||
|
||||
| Property name | Type | Description |
|
||||
| ------------- | ------ | ------------------------------------ |
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| baseURL | string | The endpoint for the model provider. |
|
||||
| Property name | Type | Description |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| 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. |
|
||||
| endpoint | string | The endpoint for the model provider. |
|
||||
| fetchOnClient | boolean | Whether to fetch on the client. |
|
||||
|
||||
- Type `AzureOpenAIKeyVault`
|
||||
- Type `AzureOpenAIConfig`
|
||||
> Inherits the fields from `GeneralModelProviderConfig`
|
||||
|
||||
| Property name | Type | Description |
|
||||
| ------------- | ------ | ------------------------------------ |
|
||||
| apiVersion | string | The API version for Azure OpenAI. |
|
||||
| apiKey | string | The API key for the model provider. |
|
||||
| endpoint | string | The endpoint for the model provider. |
|
||||
| Property name | Type | Description |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiVersion | string | The API version for Azure OpenAI. |
|
||||
|
||||
- Type `AWSBedrockKeyVault`
|
||||
- Type `AWSBedrockConfig`
|
||||
> Inherits all fields from `GeneralModelProviderConfig` except `apiKey, endpoint`
|
||||
|
||||
| Property name | Type | Description |
|
||||
| --------------- | ------ | -------------------------------------- |
|
||||
| accessKeyId | string | The access key ID for AWS Bedrock. |
|
||||
| region | string | The region for AWS Bedrock. |
|
||||
| secretAccessKey | string | The secret access key for AWS Bedrock. |
|
||||
| Property name | Type | Description |
|
||||
| accessKeyId | string | The access key ID for AWS Bedrock. |
|
||||
| region | string | The region for AWS Bedrock. |
|
||||
| secretAccessKey | string | The secret access key for AWS Bedrock. |
|
||||
|
||||
### languageModel
|
||||
|
||||
```ts
|
||||
export type UserModelProviderConfig = Record<string, ProviderConfig>;
|
||||
```
|
||||
|
||||
| Property name | Type |
|
||||
| ------------- | ---------------- |
|
||||
| anthropic | `ProviderConfig` |
|
||||
| azure | `ProviderConfig` |
|
||||
| bedrock | `ProviderConfig` |
|
||||
| google | `ProviderConfig` |
|
||||
| groq | `ProviderConfig` |
|
||||
| minimax | `ProviderConfig` |
|
||||
| mistral | `ProviderConfig` |
|
||||
| moonshot | `ProviderConfig` |
|
||||
| ollama | `ProviderConfig` |
|
||||
| openai | `ProviderConfig` |
|
||||
| openrouter | `ProviderConfig` |
|
||||
| perplexity | `ProviderConfig` |
|
||||
| togetherai | `ProviderConfig` |
|
||||
| zeroone | `ProviderConfig` |
|
||||
| zhipu | `ProviderConfig` |
|
||||
|
||||
- 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. |
|
||||
|
||||
@@ -1,25 +1,10 @@
|
||||
---
|
||||
title: URL 分享设置参数 - LobeChat 配置快速设置
|
||||
description: 了解如何从外部 URL 导入和导出 LobeChat 的设置参数,包括 keyVaults 和 languageModel,以及参数格式和类型。
|
||||
tags:
|
||||
- URL 分享
|
||||
- 设置参数
|
||||
- LobeChat
|
||||
- keyVaults
|
||||
- languageModel
|
||||
- JSON 格式
|
||||
- URL 导入
|
||||
- URL 导出
|
||||
---
|
||||
|
||||
# URL 分享设置参数
|
||||
|
||||
LobeChat 支持从外部 URL 导入设置参数,以便于快速设置 LobeChat 的配置。
|
||||
|
||||
目前支持的设置项有:
|
||||
|
||||
- `keyVaults`: 模型供应商相关秘钥设置
|
||||
- `languageModel`:语言模型设置
|
||||
- `languageModel`:语言模型设置
|
||||
|
||||
## 从 URL 中导入
|
||||
|
||||
@@ -27,18 +12,18 @@ LobeChat 支持从外部 URL 导入设置参数,以便于快速设置 LobeChat
|
||||
|
||||
```plaintext
|
||||
https://lobehub.com/?settings=<JSON格式的设置对象>
|
||||
https://lobehub.com/?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
https://lobehub.com/?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
```
|
||||
|
||||
JSON格式的设置示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"keyVaults": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
"languageModel": {
|
||||
"openai": {
|
||||
"apiKey": "user-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -47,99 +32,69 @@ JSON格式的设置示例:
|
||||
```ts
|
||||
// 生成要导出到 URL 的设置
|
||||
const settings = {
|
||||
keyVaults: {
|
||||
languageModel: {
|
||||
openai: {
|
||||
apiKey: 'user-key',
|
||||
baseURL: 'https://your-proxy.com/v1',
|
||||
apiKey: 'user-key',
|
||||
endpoint: 'https://lobehub.com/v1'
|
||||
},
|
||||
},
|
||||
};
|
||||
// Convert settings to a JSON formatted string
|
||||
}};
|
||||
// 将设置转为 JSON 格式的字符串
|
||||
const url = `/?settings=${JSON.stringify(settings)}`;
|
||||
console.log(url);
|
||||
// /?settings={"keyVaults":{"openai":{"apiKey":"user-key","baseURL":"https://your-proxy.com/v1"}}}
|
||||
console.log(url);
|
||||
// /?settings={"languageModel":{"openai":{"apiKey":"user-key","endpoint":"https://lobehub.com/v1"}}}
|
||||
```
|
||||
|
||||
<Callout type={'warning'}>
|
||||
LobeChat 不对 URL 中的设置参数进行正确性校验,也不提供 URL 的加密、解密方法,请谨慎使用。
|
||||
LobeChat 不对 URL 中的设置参数进行正确性校验,也不提供加密、解密方法,请谨慎使用。
|
||||
</Callout>
|
||||
|
||||
## 参数格式
|
||||
|
||||
### keyVaults
|
||||
### languageModel
|
||||
|
||||
- 参数及其类型
|
||||
|
||||
| 参数名称 | 类型 |
|
||||
| ---------- | -------------------------- |
|
||||
| anthropic | `OpenAICompatibleKeyVault` |
|
||||
| azure | `AzureOpenAIKeyVault` |
|
||||
| bedrock | `AWSBedrockKeyVault` |
|
||||
| google | `OpenAICompatibleKeyVault` |
|
||||
| groq | `OpenAICompatibleKeyVault` |
|
||||
| minimax | `OpenAICompatibleKeyVault` |
|
||||
| mistral | `OpenAICompatibleKeyVault` |
|
||||
| moonshot | `OpenAICompatibleKeyVault` |
|
||||
| ollama | `OpenAICompatibleKeyVault` |
|
||||
| openai | `OpenAICompatibleKeyVault` |
|
||||
| openrouter | `OpenAICompatibleKeyVault` |
|
||||
| perplexity | `OpenAICompatibleKeyVault` |
|
||||
| togetherai | `OpenAICompatibleKeyVault` |
|
||||
| zeroone | `OpenAICompatibleKeyVault` |
|
||||
| zhipu | `OpenAICompatibleKeyVault` |
|
||||
| 参数名称 | 类型 |
|
||||
|---------------|--------------------------------|
|
||||
| anthropic | GeneralModelProviderConfig |
|
||||
| azure | AzureOpenAIConfig |
|
||||
| bedrock | AWSBedrockConfig |
|
||||
| google | GeneralModelProviderConfig |
|
||||
| groq | GeneralModelProviderConfig |
|
||||
| minimax | GeneralModelProviderConfig |
|
||||
| mistral | GeneralModelProviderConfig |
|
||||
| moonshot | GeneralModelProviderConfig |
|
||||
| ollama | GeneralModelProviderConfig |
|
||||
| openai | GeneralModelProviderConfig |
|
||||
| openrouter | GeneralModelProviderConfig |
|
||||
| perplexity | GeneralModelProviderConfig |
|
||||
| togetherai | GeneralModelProviderConfig |
|
||||
| zeroone | GeneralModelProviderConfig |
|
||||
| zhipu | GeneralModelProviderConfig |
|
||||
|
||||
- Type `OpenAICompatibleKeyVault`
|
||||
- 类型 `GeneralModelProviderConfig`
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
| ------- | ------ | ----------------- |
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| baseURL | string | 模型API端点。 |
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| autoFetchModelLists | boolean | 是否自动获取模型列表。 |
|
||||
| enabled | boolean | 是否启用该模型。 |
|
||||
| enabledModels | string[] | 启用的模型的 ID。 |
|
||||
| endpoint | string | 模型API端点。 |
|
||||
| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 |
|
||||
|
||||
- Type `AzureOpenAIKeyVault`
|
||||
- 类型 `AzureOpenAIConfig`
|
||||
> 继承 `GeneralModelProviderConfig` 中的字段
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
| ---------- | ------ | -------------------------- |
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| apiVersion | string | Azure OpenAI 的 API 版本。 |
|
||||
| apiKey | string | 模型的 API 密钥。 |
|
||||
| baseURL | string | 模型API端点。 |
|
||||
|
||||
- Type `AWSBedrockKeyVault`
|
||||
- 类型 `AWSBedrockConfig`
|
||||
> 继承 `GeneralModelProviderConfig` 中除 `apiKey, endpoint` 外的所有字段
|
||||
|
||||
| 参数 | 类型 | 描述 |
|
||||
| --------------- | ------ | --------------------------- |
|
||||
| accessKeyId | string | AWS Bedrock 的访问密钥 ID。 |
|
||||
| region | string | AWS Bedrock 的区域。 |
|
||||
| secretAccessKey | string | AWS Bedrock 的访问密钥。 |
|
||||
|
||||
### languageModel
|
||||
|
||||
```ts
|
||||
export type UserModelProviderConfig = Record<string, ProviderConfig>;
|
||||
```
|
||||
|
||||
| 参数名称 | 类型 |
|
||||
| ---------- | ---------------- |
|
||||
| anthropic | `ProviderConfig` |
|
||||
| azure | `ProviderConfig` |
|
||||
| bedrock | `ProviderConfig` |
|
||||
| google | `ProviderConfig` |
|
||||
| groq | `ProviderConfig` |
|
||||
| minimax | `ProviderConfig` |
|
||||
| mistral | `ProviderConfig` |
|
||||
| moonshot | `ProviderConfig` |
|
||||
| ollama | `ProviderConfig` |
|
||||
| openai | `ProviderConfig` |
|
||||
| openrouter | `ProviderConfig` |
|
||||
| perplexity | `ProviderConfig` |
|
||||
| togetherai | `ProviderConfig` |
|
||||
| zeroone | `ProviderConfig` |
|
||||
| zhipu | `ProviderConfig` |
|
||||
|
||||
- 类型 `ProviderConfig`
|
||||
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
| ------------------- | -------- | -------------------------------------------- |
|
||||
| autoFetchModelLists | boolean | 是否自动获取模型列表。 |
|
||||
| enabled | boolean | 是否启用该模型。 |
|
||||
| enabledModels | string[] | 启用的模型的 ID。 |
|
||||
| fetchOnClient | boolean | 是否在客户端发起请求,默认在服务端发起请求。 |
|
||||
| 参数 | TS 类型 | 描述 |
|
||||
|-----------------------|--------------------------|-----------------------------------------------------------------------------|
|
||||
| accessKeyId | string | AWS Bedrock 的访问密钥 ID。 |
|
||||
| region | string | AWS Bedrock 的区域。 |
|
||||
| secretAccessKey | string | AWS Bedrock 的访问密钥。 |
|
||||
|
||||
@@ -76,8 +76,9 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| 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` | Optional | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `auth0` for Auth0. |
|
||||
| `AUTH0_CLIENT_ID` | Required | Client ID of the Auth0 application |
|
||||
| `AUTH0_CLIENT_SECRET` | Required | Client Secret of the Auth0 application |
|
||||
| `AUTH0_ISSUER` | Required | Domain of the Auth0 application, `https://example.auth0.com` |
|
||||
|
||||
@@ -15,7 +15,7 @@ tags:
|
||||
<Steps>
|
||||
### 创建 Auth0 应用
|
||||
|
||||
注册并登录 [Auth0](https://manage.auth0.com/dashboard),点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。
|
||||
注册并登录 [Auth0][auth0-client-page],点击左侧导航栏的「Applications」,切换到应用管理界面,点击右上角「Create Application」以创建应用。
|
||||
|
||||
<Image
|
||||
alt="创建 Auth0 应用 S1"
|
||||
@@ -71,8 +71,9 @@ http(s)://your-domain/api/auth/callback/auth0
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Auth0 请填写 `auth0`。 |
|
||||
| `AUTH0_CLIENT_ID` | 必选 | Auth0 应用程序的 Client ID |
|
||||
| `AUTH0_CLIENT_SECRET` | 必选 | Auth0 应用程序的 Client Secret |
|
||||
| `AUTH0_ISSUER` | 必选 | Auth0 应用程序的 Domain,`https://example.auth0.com` |
|
||||
@@ -80,7 +81,7 @@ http(s)://your-domain/api/auth/callback/auth0
|
||||
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
|
||||
|
||||
<Callout type={'tip'}>
|
||||
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#auth-0) 可查阅相关变量详情。
|
||||
前往 [📘 环境变量](/docs/self-hosting/environment-variable#auth0) 可查阅相关变量详情。
|
||||
|
||||
</Callout>
|
||||
</Steps>
|
||||
@@ -95,7 +96,7 @@ http(s)://your-domain/api/auth/callback/auth0
|
||||
|
||||
如果你的企业或组织已有现有的统一身份认证设施,可在 Applications -> SSO Integrations 中,连接现有的单点登录服务。
|
||||
|
||||
Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里](https://marketplace.auth0.com/features/sso-integrations)
|
||||
Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zoom 等单点登录服务,详细支持列表可参考 [这里][auth0-sso-integrations]
|
||||
|
||||
<Image
|
||||
alt="Connecting to an Existing Single Sign-On Service"
|
||||
@@ -117,5 +118,9 @@ Auth0 支持 Azure Active Directory / Slack / Google Workspace / Office 365 / Zo
|
||||
|
||||
<Callout>
|
||||
如果你需要限制登录人员,务必配置 **阻止策略**: 请在打开社交登录选项后,参考
|
||||
[这篇文章](https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/) 创建 Action 来设置阻止 / 允许列表。
|
||||
[这篇文章][auth0-login-actions-manual] 创建 Action 来设置阻止 / 允许列表。
|
||||
</Callout>
|
||||
|
||||
[auth0-client-page]: https://manage.auth0.com/dashboard
|
||||
[auth0-login-actions-manual]: https://auth0.com/blog/permit-or-deny-login-requests-using-auth0-actions/
|
||||
[auth0-sso-integrations]: https://marketplace.auth0.com/features/sso-integrations
|
||||
|
||||
@@ -54,8 +54,9 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| 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. |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
|
||||
| `NEXTAUTH_SECRET` | Required | The secret used to encrypt Auth.js session tokens. You can generate a secret using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the SSO provider for LoboChat. Use `authentik` for Authentik. |
|
||||
| `AUTHENTIK_CLIENT_ID` | Required | The Client ID from the Authentik application provider details page |
|
||||
| `AUTHENTIK_CLIENT_SECRET` | Required | The Client Secret from the Authentik application provider details page |
|
||||
| `AUTHENTIK_ISSUER` | Required | The OpenID Configuration Issuer from the Authentik application provider details page |
|
||||
|
||||
@@ -49,8 +49,9 @@ https://your-domain/api/auth/callback/authentik
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Authentik 请填写 `authentik`。 |
|
||||
| `AUTHENTIK_CLIENT_ID` | 必选 | Authentik 提供程序详情页的 客户端 ID |
|
||||
| `AUTHENTIK_CLIENT_SECRET` | 必选 | Authentik 提供程序详情页的 客户端 Secret |
|
||||
| `AUTHENTIK_ISSUER` | 必选 | Authentik 提供程序详情页的 OpenID 配置颁发者 |
|
||||
|
||||
@@ -82,8 +82,9 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| 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. |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the Single Sign-On provider for LobeChat. Use `github` for Github. |
|
||||
| `GITHUB_CLIENT_ID` | Required | Client ID in the Github App details page. |
|
||||
| `GITHUB_CLIENT_SECRET` | Required | Client Secret in the Github App details page. |
|
||||
| `ACCESS_CODE` | Required | Add a password for accessing this service. You can set a long random password to "disable" access code authorization. |
|
||||
|
||||
@@ -78,8 +78,9 @@ tags:
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Github 请填写 `github`。 |
|
||||
| `GITHUB_CLIENT_ID` | 必选 | Github App详情页的 客户端 ID |
|
||||
| `GITHUB_CLIENT_SECRET` | 必选 | Github App详情页的 客户端 Secret |
|
||||
| `ACCESS_CODE` | 必选 | 添加访问此服务的密码,你可以设置一个足够长的随机密码以 “禁用” 访问码授权 |
|
||||
|
||||
@@ -71,8 +71,9 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| 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 `azure-ad` for Microsoft Entra ID. |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `azure-ad` for Microsoft Entra ID. |
|
||||
| `AZURE_AD_CLIENT_ID` | Required | Client ID of the Microsoft Entra ID application. |
|
||||
| `AZURE_AD_CLIENT_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
|
||||
| `AZURE_AD_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
|
||||
|
||||
@@ -68,8 +68,9 @@ https://your-domain/api/auth/callback/azure-ad
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
|
||||
| `AZURE_AD_CLIENT_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
|
||||
| `AZURE_AD_CLIENT_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
|
||||
| `AZURE_AD_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
|
||||
|
||||
@@ -57,8 +57,7 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
- 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.
|
||||
</Callout>
|
||||
|
||||
Confirm the configuration and click **Create**.
|
||||
@@ -77,7 +76,8 @@ Save the **ClientId** and **ClientSecret** for later use.
|
||||
src="https://github.com/lobehub/lobe-chat/assets/8692892/407b4eed-7f21-4aa6-b68f-9bae2faf09d0"
|
||||
/>
|
||||
|
||||
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**.
|
||||
|
||||
<Image
|
||||
alt="Create ZITADEL Application S7"
|
||||
@@ -99,8 +99,9 @@ When deploying LobeChat, you need to configure the following environment variabl
|
||||
|
||||
| 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` | Optional | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
|
||||
| `ENABLE_OAUTH_SSO` | Required | Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on. |
|
||||
| `NEXTAUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | Optional | Select the single sign-on provider for LoboChat. Use `zitadel` for ZITADEL. |
|
||||
| `ZITADEL_CLIENT_ID` | Required | Client ID (`ClientId` as shown in ZITADEL) of the ZITADEL application |
|
||||
| `ZITADEL_CLIENT_SECRET` | Required | Client Secret (`ClientSecret` as shown in ZITADEL) of the ZITADEL application |
|
||||
| `ZITADEL_ISSUER` | Required | Issuer URL of the ZITADEL application |
|
||||
|
||||
@@ -53,8 +53,7 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
<Callout type={'important'}>
|
||||
- 可以创建应用后再填写或修改重定向 URL,但请确保填写的 URL 与部署的 URL 一致。
|
||||
|
||||
- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。
|
||||
|
||||
- 请将 `http(s)://your-domain` 替换为 LobeChat 部署的实际 URL。
|
||||
</Callout>
|
||||
|
||||
确认配置并点击「创建」。
|
||||
@@ -95,8 +94,9 @@ http(s)://your-domain/api/auth/callback/zitadel
|
||||
|
||||
| 环境变量 | 类型 | 描述 |
|
||||
| --- | --- | --- |
|
||||
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` |
|
||||
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 |
|
||||
| `ENABLE_OAUTH_SSO` | 必选 | 为 LobeChat 启用单点登录(SSO)。设置为 `1` 以启用单点登录。 |
|
||||
| `NEXTAUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` |
|
||||
| `SSO_PROVIDERS` | 可选 | 为 LobeChat 选择单点登录提供程序。对于 ZITADEL,请填写 `zitadel`。 |
|
||||
| `ZITADEL_CLIENT_ID` | 必选 | ZITADEL 应用的 Client ID(`ClientId`)。 |
|
||||
| `ZITADEL_CLIENT_SECRET` | 必选 | ZITADEL 应用的 Client Secret(`ClientSecret`)。 |
|
||||
| `ZITADEL_ISSUER` | 必选 | ZITADEL 应用的 OpenID Connect 颁发者(issuer)URL。 |
|
||||
|
||||
@@ -126,13 +126,13 @@ 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)"
|
||||
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
|
||||
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)"
|
||||
|
||||
@@ -103,7 +103,7 @@ OPENAI_MODEL_LIST=-gpt-4,-gpt-4-32k,-gpt-3.5-turbo-16k,gpt-3.5-turbo-1106=gpt-3.
|
||||
# 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)
|
||||
@@ -121,13 +121,13 @@ 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)"
|
||||
# 运行新的容器
|
||||
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)"
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# LobeChat WebRTC Sync
|
||||
|
||||
## Introduction to WebRTC
|
||||
|
||||
WebRTC (Web Real-Time Communication) is a technology that enables peer-to-peer communication between browsers. In LobeChat, we experimentally implemented real-time data synchronization between devices based on WebRTC and YJS, without relying on traditional server databases. This solution offers high privacy, zero conflicts, and provides a real-time session synchronization experience.
|
||||
|
||||
## Configuring WebRTC for Synchronization
|
||||
|
||||
To use the WebRTC synchronization feature in LobeChat, you need to complete the following steps:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Deploy Signaling Server
|
||||
|
||||
Deploy a WebRTC signaling server with one click using the Zeabur platform:
|
||||
|
||||
[](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.
|
||||
|
||||
After deployment, you will receive a URL, for example: `https://my-signaling-server.zeabur.app`.
|
||||
|
||||
### 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`.
|
||||
|
||||
### 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
|
||||
|
||||
<Image
|
||||
alt={'LobeChat Data Sync Settings Page'}
|
||||
height={356}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
||||
/>
|
||||
|
||||
### 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.
|
||||
|
||||
</Steps>
|
||||
|
||||
## Limitations and Known Issues
|
||||
|
||||
Although WebRTC has the advantages of no database and flexibility, after extensive community testing, the following limitations and known issues have been identified:
|
||||
|
||||
### Requirement for Devices to be Online Simultaneously
|
||||
|
||||
WebRTC requires devices to be online simultaneously to synchronize, meaning changes cannot be made on one device while offline and then synced later on another device.
|
||||
|
||||
This limitation is due to the communication nature of WebRTC. In a pure frontend, serverless scenario, data synchronization between two devices can only be achieved through peer-to-peer communication. When one device is online and the other is offline, it is impossible to determine where the data should come from. Only when both devices are online can data communication occur. This mode is more like an online chat room where everyone needs to be online to see each other's data and achieve synchronization.
|
||||
|
||||
Therefore, in certain situations, WebRTC's pure peer-to-peer approach may not fully meet users' needs (e.g., one device is a work computer, and the other is a home computer), and there are also some issues with data synchronization.
|
||||
|
||||
### Network Issues Leading to Sync Failures
|
||||
|
||||
Due to the implementation mechanism of WebRTC, its peer-to-peer communication has strict network requirements. Many of our users have reported:
|
||||
|
||||
- Syncing between PCs is possible, but syncing between a mobile device with a SIM card and a PC is not, although syncing is possible when using the same WIFI as the PC;
|
||||
- Syncing fails when switching networks.
|
||||
|
||||
### Stability and Performance Issues
|
||||
|
||||
- Some users have reported ICE connection failures on the Firefox browser: [WebRTC Data Sync Feedback](https://github.com/lobehub/lobe-chat/issues/1683#issuecomment-2094745907)
|
||||
- For extremely long text or large amounts of conversation records, the synchronization process may slow down or become unstable: [When the model outputs a very long conversation, the end of the conversation will contain synchronization-related content tags, leading to sync failures](https://github.com/lobehub/lobe-chat/issues/1962)
|
||||
|
||||
## Our Recommendations
|
||||
|
||||
Considering the above reasons, we recommend users treat the WebRTC sync feature as experimental and regularly back up important data.
|
||||
|
||||
We have already released a more stable and user-friendly server database synchronization solution ([deployment guide](/docs/self-hosting/advanced/server-database)). We recommend users prioritize using the server database synchronization solution.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Please note that we have officially announced the archiving of this sync feature in [PR
|
||||
3182](https://github.com/lobehub/lobe-chat/pull/3182), and the above issues will no longer be
|
||||
considered for fixes.
|
||||
</Callout>
|
||||
@@ -1,87 +0,0 @@
|
||||
---
|
||||
title: LobeChat WebRTC 同步配置指南
|
||||
description: 在 LobeChat 中实现基于 WebRTC 和 YJS 的设备间实时数据同步。了解如何配置 WebRTC 并开启同步功能,以及使用局限性和已知问题。
|
||||
tags:
|
||||
- YJS
|
||||
- 信令服务器
|
||||
---
|
||||
|
||||
# LobeChat WebRTC 同步
|
||||
|
||||
## WebRTC 简介
|
||||
|
||||
WebRTC (Web Real-Time Communication) 是一项实现浏览器之间点对点通信的技术。在 LobeChat 中,我们实验性地基于 WebRTC 和 YJS 实现了设备间的实时数据同步,无需依赖传统的服务器数据库。这种方案具有高度隐私性、零冲突性,并能提供实时会话同步体验。
|
||||
|
||||
## 配置 WebRTC 并实现同步
|
||||
|
||||
要使用 LobeChat 的 WebRTC 同步功能,需要完成以下步骤:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 部署信令服务器
|
||||
|
||||
使用 Zeabur 平台一键部署 WebRTC 信令服务器:
|
||||
|
||||
[](https://zeabur.com/templates/MY0JZG?referralCode=arvinxx)
|
||||
|
||||
或者查看 [源码](https://github.com/lobehub/y-webrtc-signaling) 自行部署。
|
||||
|
||||
部署完成后,可以得到一个 URL,例如:`https://my-signaling-server.zeabur.app`。
|
||||
|
||||
### 在部署实例中开启 WebRTC 同步
|
||||
|
||||
LobeChat 默认隐藏了 WebRTC 同步功能,需要通过添加环境变量 `FEATURE_FLAGS=+webrtc_sync` 来开启 WebRTC 同步特性。
|
||||
|
||||
### 配置 LobeChat 的 WebRTC 同步设置
|
||||
|
||||
1. 打开 LobeChat 设置 -> 数据同步
|
||||
2. 在 WebRTC 同步中填写信令服务器地址;
|
||||
3. 设置同步频道名称和密码
|
||||
|
||||
<Image
|
||||
alt={'LobeChat 数据同步设置页'}
|
||||
height={356}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/28616219/bf86bf1e-87fb-4015-8587-15ff28bb9c24'}
|
||||
/>
|
||||
|
||||
### 在需要同步的设备上重复以上配置
|
||||
|
||||
确保所有设备使用相同的信令服务器、频道名称和密码,完成配置后,设备间应该可以开始自动同步数据。
|
||||
|
||||
</Steps>
|
||||
|
||||
## 使用局限性和已知问题
|
||||
|
||||
虽然 WebRTC 具有无数据库、比较灵活的特性,但目前该功能经过大范围社区测试,存在以下局限性和已知问题:
|
||||
|
||||
### 设备同时在线要求
|
||||
|
||||
WebRTC 要求设备同时在线才能进行同步,这意味着无法在一台设备离线时在另一台设备上进行更改并稍后同步。
|
||||
|
||||
这是 WebRTC 本身的通信特性有关系,由于在纯前端、无服务端的情况下,两个设备的数据同步只能通过点对点通信的形式达成。当一个设备在线,一个设备离线的情况下,我们无从感知数据到底应该从哪来,只有当两台设备都在线的时候,双发数据才能通信。其实这种模式更像是一个在线聊天室,大家都在线时才能看到对方的数据,然后达成同步。
|
||||
|
||||
因此 WebRTC 这种纯点对点的方式在某些情况下并无法完全满足用户的诉求(例如一个是公司电脑,一个是家里电脑),同时也存在一些数据同步层面的问题。
|
||||
|
||||
### 网络问题可能导致同步失败
|
||||
|
||||
由于 WebRTC 的实现机制,其点对点通信对于网络要求非常苛刻,我们的很多用户反馈:
|
||||
|
||||
- 在 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)
|
||||
|
||||
## 我们的建议
|
||||
|
||||
鉴于以上原因,我们建议用户将 WebRTC 同步功能视为实验性功能,并定期备份重要数据。
|
||||
|
||||
目前我们已经发布了更稳定、更用户友好的服务端数据库同步方案([部署指南](/zh/docs/self-hosting/advanced/server-database)),我们建议用户优先考虑使用服务端数据库同步方案。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
请注意,我们已经在 [PR 3182](https://github.com/lobehub/lobe-chat/pull/3182)
|
||||
中正式宣布归档该同步特性,上述问题将不再考虑进行修复。
|
||||
</Callout>
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
title: Integrating Analytics in LobeChat
|
||||
title: >-
|
||||
Integrating Data Analytics Services in LobeChat: Environment Variables and
|
||||
Configuration
|
||||
description: >-
|
||||
Learn how to configure environment variables for Vercel Analytics, Google
|
||||
Analytics, PostHog Analytics, and Umami Analytics in LobeChat for data
|
||||
@@ -34,30 +36,44 @@ We have integrated several free/open-source data analytics services in LobeChat
|
||||
|
||||
## Google Analytics
|
||||
|
||||
### `ENABLE_GOOGLE_ANALYTICS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to configure the environment variable for Google Analytics. Set to `1` to enable Google Analytics.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `GOOGLE_ANALYTICS_MEASUREMENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Google Analytics Measurement ID,you can get it from the Google Analytics dashboard. Add it will auto enable Google Analytics.
|
||||
- Description: Google Analytics Measurement ID,you can get it from the Google Analytics dashboard.
|
||||
- Default: `-`
|
||||
- Example: `G-63LP2TV03T`
|
||||
|
||||
## Posthog Analytics
|
||||
|
||||
### `POSTHOG_KEY`
|
||||
### `NEXT_PUBLIC_ANALYTICS_POSTHOG`
|
||||
|
||||
- Type: Required
|
||||
- Description: Set the PostHog project Key. Add it will auto enable PostHog Analytics.
|
||||
- Type: Optional
|
||||
- Description: Used to enable the environment variable for [PostHog Analytics][posthog-analytics-url]. Set to `1` to enable PostHog Analytics.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_KEY`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Set the PostHog project Key.
|
||||
- Default: `-`
|
||||
- Example: `phc_xxxxxxxx`
|
||||
|
||||
### `POSTHOG_HOST`
|
||||
### `NEXT_PUBLIC_POSTHOG_HOST`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Set the deployment address of the PostHog service, defaulting to the official SAAS address.
|
||||
- Default: `https://app.posthog.com`
|
||||
- Example: `https://example.com`
|
||||
|
||||
### `DEBUG_POSTHOG_ANALYTICS`
|
||||
### `NEXT_PUBLIC_POSTHOG_DEBUG`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Enable the debug mode for PostHog.
|
||||
@@ -66,19 +82,26 @@ We have integrated several free/open-source data analytics services in LobeChat
|
||||
|
||||
## Umami Analytics
|
||||
|
||||
### `UMAMI_WEBSITE_ID`
|
||||
### `NEXT_PUBLIC_ANALYTICS_UMAMI`
|
||||
|
||||
- Type: Required
|
||||
- Description: Your Umami Website ID. Add it will auto enable Umami Analytics.
|
||||
- Type: Optional
|
||||
- Description: Used to enable the environment variable for [Umami Analytics][umami-analytics-url]. Set to `1` to enable Umami Analytics.
|
||||
- Default: `-`
|
||||
- Example: `E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
- Example: `1`
|
||||
|
||||
### `UMAMI_SCRIPT_URL`
|
||||
### `NEXT_PUBLIC_UMAMI_SCRIPT_URL`
|
||||
|
||||
- Type: Optional
|
||||
- Description: The URL of the Umami script, defaulting to the script URL provided by Umami Cloud.
|
||||
- Default: `https://analytics.umami.is/script.js`
|
||||
- Example: `https://umami.your-site.com/script.js`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_WEBSITE_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Your Umami Website ID.
|
||||
- Default: `-`
|
||||
- Example: `E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
[posthog-analytics-url]: https://posthog.com
|
||||
[umami-analytics-url]: https://umami.is
|
||||
|
||||
@@ -32,30 +32,44 @@ tags:
|
||||
|
||||
## Google Analytics
|
||||
|
||||
### `ENABLE_GOOGLE_ANALYTICS`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:用于配置 Google Analytics 的环境变量,当设为 `1` 时开启 Google Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
|
||||
### `GOOGLE_ANALYTICS_MEASUREMENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:Google Analytics 的 Measurement ID,填写此项后将自动开启 Google Analytics
|
||||
- 描述:Google Analytics 的 Measurement ID,如果开启了 Google Analytics,此项必填
|
||||
- 默认值: `-`
|
||||
- 示例:`G-63LP2TV03T`
|
||||
|
||||
## Posthog Analytics
|
||||
|
||||
### `POSTHOG_KEY`
|
||||
### `NEXT_PUBLIC_ANALYTICS_POSTHOG`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:设置 PostHog 项目 Key,设置此项后将自动开启 PostHog Analytics
|
||||
- 类型:可选
|
||||
- 描述:用于开启 [PostHog Analytics][posthog-analytics-url] 的环境变量,设为 `1` 时开启 PostHog Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
|
||||
### `NEXT_PUBLIC_POSTHOG_KEY`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:设置 PostHog 项目 Key
|
||||
- 默认值: `-`
|
||||
- 示例:`phc_xxxxxxxx`
|
||||
|
||||
### `POSTHOG_HOST`
|
||||
### `NEXT_PUBLIC_POSTHOG_HOST`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:设置 PostHog 服务的部署地址,默认为官方的 SaaS 地址
|
||||
- 描述:设置 PostHog 服务的部署地址,默认为官方的 SAAS 地址
|
||||
- 默认值:`https://app.posthog.com`
|
||||
- 示例:`https://example.com`
|
||||
|
||||
### `POSTHOG_DEBUG`
|
||||
### `NEXT_PUBLIC_POSTHOG_DEBUG`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:开启 PostHog 的调试模式
|
||||
@@ -64,19 +78,26 @@ tags:
|
||||
|
||||
## Umami Analytics
|
||||
|
||||
### `UMAMI_WEBSITE_ID`
|
||||
### `NEXT_PUBLIC_ANALYTICS_UMAMI`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:你的 Umami 的 Website ID,填写此项后将自动开启 Umami Analytics
|
||||
- 默认值:`-`
|
||||
- 示例:`E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
- 类型:可选
|
||||
- 描述:用于开启 [Umami Analytics][umami-analytics-url] 的环境变量,设为 `1` 时开启 Umami Analytics
|
||||
- 默认值: `-`
|
||||
- 示例:`1`
|
||||
|
||||
### `UMAMI_SCRIPT_URL`
|
||||
### `NEXT_PUBLIC_UMAMI_SCRIPT_URL`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:Umami 脚本的网址,默认为 Umami Cloud 提供的脚本网址
|
||||
- 默认值:`https://analytics.umami.is/script.js`
|
||||
- 示例:`https://umami.your-site.com/script.js`
|
||||
|
||||
### `NEXT_PUBLIC_UMAMI_WEBSITE_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:你的 Umami 的 Website ID
|
||||
- 默认值:`-`
|
||||
- 示例:`E738D82A-EE9E-4806-A81F-0CA3CAE57F65`
|
||||
|
||||
[posthog-analytics-url]: https://posthog.com
|
||||
[umami-analytics-url]: https://umami.is
|
||||
|
||||
@@ -5,143 +5,150 @@ description: >-
|
||||
services in LobeChat, including OAuth SSO, NextAuth settings, and
|
||||
provider-specific details.
|
||||
tags:
|
||||
- LobeChat
|
||||
- Authentication Service
|
||||
- Environment Variables
|
||||
- OAuth SSO
|
||||
- Clerk
|
||||
- NextAuth
|
||||
- Provider Details
|
||||
---
|
||||
|
||||
# Authentication Service
|
||||
## Authentication Service
|
||||
|
||||
LobeChat provides a complete authentication service capability when deployed. The following are the relevant environment variables. You can use these environment variables to easily define the identity verification services that need to be enabled in LobeChat.
|
||||
|
||||
## Next Auth
|
||||
## General Settings
|
||||
|
||||
### General Settings
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
#### `NEXT_AUTH_SECRET`
|
||||
- Type: Required
|
||||
- Description: Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on.
|
||||
- Default: `-`
|
||||
- Example: `1`
|
||||
|
||||
### `SSO_PROVIDERS`
|
||||
|
||||
- Type: Required
|
||||
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
- Default: `auth0`
|
||||
- Example: `auth0,azure-ad,authentik`
|
||||
|
||||
### `NEXTAUTH_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Key used to encrypt the session tokens in Auth.js. You can generate the key using the following command: `openssl rand -base64 32`.
|
||||
- Default: `-`
|
||||
- Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
||||
|
||||
#### `NEXT_AUTH_SSO_PROVIDERS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
||||
- Default: `auth0`
|
||||
- Example: `auth0,azure-ad,authentik`
|
||||
|
||||
#### `NEXTAUTH_URL`
|
||||
### `NEXTAUTH_URL`
|
||||
|
||||
- Type: Optional
|
||||
- Description: This URL is used to specify the callback address for Auth.js during OAuth authentication. It does not need to be set when deploying on Vercel.
|
||||
- Default: `-`
|
||||
- Example: `https://example.com/api/auth`
|
||||
|
||||
### Auth0
|
||||
## Auth0
|
||||
|
||||
#### `AUTH0_CLIENT_ID`
|
||||
### `AUTH0_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Auth0 application. You can access it [here](https://manage.auth0.com/dashboard) and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
#### `AUTH0_CLIENT_SECRET`
|
||||
### `AUTH0_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Auth0 application.
|
||||
- Default: `-`
|
||||
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
#### `AUTH0_ISSUER`
|
||||
### `AUTH0_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer/domain of the Auth0 application.
|
||||
- Default: `-`
|
||||
- Example: `https://example.auth0.com`
|
||||
|
||||
### Microsoft Entra ID
|
||||
## Microsoft Entra ID
|
||||
|
||||
#### `AZURE_AD_CLIENT_ID`
|
||||
### `AZURE_AD_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
||||
|
||||
#### `AZURE_AD_CLIENT_SECRET`
|
||||
### `AZURE_AD_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
||||
|
||||
#### `AZURE_AD_TENANT_ID`
|
||||
### `AZURE_AD_TENANT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Tenant ID of the Microsoft Entra ID application.
|
||||
- Default: `-`
|
||||
- Example: `c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
||||
|
||||
### Authentik
|
||||
## Authentik
|
||||
|
||||
#### `AUTHENTIK_CLIENT_ID`
|
||||
### `AUTHENTIK_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Authentik provider application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
#### `AUTHENTIK_CLIENT_SECRET`
|
||||
### `AUTHENTIK_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Authentik provider application.
|
||||
- Default: `-`
|
||||
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
#### `AUTHENTIK_ISSUER`
|
||||
### `AUTHENTIK_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer/domain of the Authentik provider application.
|
||||
- Default: `-`
|
||||
- Example: `https://your-authentik-domain.com/application/o/slug/`
|
||||
|
||||
### Github
|
||||
## Github
|
||||
|
||||
#### `GITHUB_CLIENT_ID`
|
||||
### `GITHUB_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the Github application. You can access it [here](https://github.com/settings/apps) and navigate to the application settings to view.
|
||||
- Default: `-`
|
||||
- Example: `abd94200333283550508`
|
||||
|
||||
#### `GITHUB_CLIENT_SECRET`
|
||||
### `GITHUB_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the Github application.
|
||||
- Default: `-`
|
||||
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
||||
|
||||
### ZITADEL
|
||||
## ZITADEL
|
||||
|
||||
#### `ZITADEL_CLIENT_ID`
|
||||
### `ZITADEL_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client ID of the ZITADEL application. This can be found under your application in the ZITADEL console.
|
||||
- Default: `-`
|
||||
- Example: `123456789012345678@your-project`
|
||||
|
||||
#### `ZITADEL_CLIENT_SECRET`
|
||||
### `ZITADEL_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Client Secret of the ZITADEL application.
|
||||
- Default: `-`
|
||||
- Example: `9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
||||
|
||||
#### `ZITADEL_ISSUER`
|
||||
### `ZITADEL_ISSUER`
|
||||
|
||||
- Type: Required
|
||||
- Description: Issuer of the ZITADEL application. This is usually the URL of the ZITADEL instance, and can be found in `URLs` tab of your application in the console.
|
||||
@@ -153,19 +160,3 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
||||
providers, you can submit a [feature
|
||||
request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
|
||||
</Callout>
|
||||
|
||||
## Clerk
|
||||
|
||||
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: Publishable key of the Clerk application. You can access it [here](https://dashboard.clerk.com) and navigate to the API Keys to view.
|
||||
- Default: `-`
|
||||
- Example: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` in dev / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` in production
|
||||
|
||||
### `CLERK_SECRET_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: Secret key of the Clerk application.
|
||||
- Default: `-`
|
||||
- Example: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` in dev / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ` in production
|
||||
|
||||
@@ -1,145 +1,155 @@
|
||||
---
|
||||
title: LobeChat 身份验证服务设置
|
||||
description: 了解如何配置 LobeChat 的身份验证服务环境变量。
|
||||
description: >-
|
||||
了解如何配置 LobeChat 的身份验证服务环境变量,包括单点登录 (SSO)、Auth0、Microsoft Entra
|
||||
ID、Authentik、Github 和 ZITADEL。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 身份验证服务
|
||||
- 单点登录
|
||||
- Next Auth
|
||||
- Clerk
|
||||
- Auth0
|
||||
- Microsoft Entra ID
|
||||
- Authentik
|
||||
- Github
|
||||
- ZITADEL
|
||||
---
|
||||
|
||||
# 身份验证服务
|
||||
|
||||
LobeChat 在部署时提供了完善的身份验证服务能力,以下是相关的环境变量,你可以使用这些环境变量轻松定义需要在 LobeChat 中开启的身份验证服务。
|
||||
|
||||
## Next Auth
|
||||
## 通用设置
|
||||
|
||||
### 通用设置
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
#### `NEXT_AUTH_SECRET`
|
||||
- 类型:必选
|
||||
- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。
|
||||
- 默认值: `-`
|
||||
- 示例: `1`
|
||||
|
||||
### `SSO_PROVIDERS`
|
||||
|
||||
- Type: 必需
|
||||
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
||||
- 默认值: `auth0`
|
||||
- 示例: `auth0,azure-ad,authentik`
|
||||
|
||||
### `NEXTAUTH_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`.
|
||||
- 默认值: `-`
|
||||
- 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
||||
|
||||
#### `NEXT_AUTH_SSO_PROVIDERS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
||||
- 默认值: `auth0`
|
||||
- 示例: `auth0,azure-ad,authentik`
|
||||
|
||||
#### `NEXTAUTH_URL`
|
||||
### `NEXTAUTH_URL`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,在 Vercel 上部署时无需设置。
|
||||
- 默认值:`-`
|
||||
- 示例:`https://example.com/api/auth`
|
||||
|
||||
### Auth0
|
||||
## Auth0
|
||||
|
||||
#### `AUTH0_CLIENT_ID`
|
||||
### `AUTH0_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的 Client ID,您可以访问[这里](https://manage.auth0.com/dashboard)并导航至应用程序设置来查看
|
||||
- 默认值: `-`
|
||||
- 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
||||
|
||||
#### `AUTH0_CLIENT_SECRET`
|
||||
### `AUTH0_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的 Client Secret
|
||||
- 默认值: `-`
|
||||
- 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
||||
|
||||
#### `AUTH0_ISSUER`
|
||||
### `AUTH0_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Auth0 应用程序的签发人 / 域
|
||||
- 默认值: `-`
|
||||
- 示例: `https://example.auth0.com`
|
||||
|
||||
### Microsoft Entra ID
|
||||
## Microsoft Entra ID
|
||||
|
||||
#### `AZURE_AD_CLIENT_ID`
|
||||
### `AZURE_AD_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 类型:必需
|
||||
- 描述:Microsoft Entra ID 应用程序的客户端 ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
||||
|
||||
#### `AZURE_AD_CLIENT_SECRET`
|
||||
### `AZURE_AD_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 类型:必需
|
||||
- 描述:Microsoft Entra ID 应用程序的客户端密钥。
|
||||
- 默认值:`-`
|
||||
- 示例:`~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
||||
|
||||
#### `AZURE_AD_TENANT_ID`
|
||||
### `AZURE_AD_TENANT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 类型:必需
|
||||
- 描述:Microsoft Entra ID 应用程序的租户 ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
||||
|
||||
### Authentik
|
||||
## Authentik
|
||||
|
||||
#### `AUTHENTIK_CLIENT_ID`
|
||||
### `AUTHENTIK_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 Client ID
|
||||
- 默认值: `-`
|
||||
- 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
|
||||
|
||||
#### `AUTHENTIK_CLIENT_SECRET`
|
||||
### `AUTHENTIK_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 Client Secret
|
||||
- 默认值: `-`
|
||||
- 示例: `h3lMI1vPUzqyqqeIDUbH5UNNOxyQLXk35h89yETeaAwHk7qVXBG3sJQWeqHBU5pyggwhP9u0eaZ1eq6DHUddVPLoS4gncqD37yuCr8jI8dY66WAt45MStDsDcQm0Ygze`
|
||||
|
||||
#### `AUTHENTIK_ISSUER`
|
||||
### `AUTHENTIK_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Authentik 提供程序的 OpenID Connect 颁发者
|
||||
- 默认值: `-`
|
||||
- 示例: `https://your-authentik-domain.com/application/o/slug/`
|
||||
|
||||
### Github
|
||||
## Github
|
||||
|
||||
#### `GITHUB_CLIENT_ID`
|
||||
### `GITHUB_CLIENT_ID`
|
||||
|
||||
- Type: Required
|
||||
- Description: Github应用的客户端ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
|
||||
- Default: `-`
|
||||
- Example: `abd94200333283550508`
|
||||
|
||||
#### `GITHUB_CLIENT_SECRET`
|
||||
### `GITHUB_CLIENT_SECRET`
|
||||
|
||||
- Type: Required
|
||||
- Description: Github应用的客户端密钥。
|
||||
- Default: `-`
|
||||
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
||||
|
||||
### ZITADEL
|
||||
## ZITADEL
|
||||
|
||||
#### `ZITADEL_CLIENT_ID`
|
||||
### `ZITADEL_CLIENT_ID`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 Client ID。您可以在 ZITADEL 控制台应用设置中找到 Client ID。
|
||||
- 默认值:`-`
|
||||
- 示例:`123456789012345678@your-project`
|
||||
|
||||
#### `ZITADEL_CLIENT_SECRET`
|
||||
### `ZITADEL_CLIENT_SECRET`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 Client Secret。
|
||||
- 默认值:`-`
|
||||
- 示例:`9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
||||
|
||||
#### `ZITADEL_ISSUER`
|
||||
### `ZITADEL_ISSUER`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:ZITADEL 应用的 OpenID Connect 颁发者(issuer),通常为 ZITADEL 实例的 URL。您可以在 ZITADEL 控制台应用设置中的 `URLs` 选项卡中找到 issuer。
|
||||
@@ -150,19 +160,3 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
||||
如果您需要使用其他身份验证服务提供商,可以提交
|
||||
[功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
|
||||
</Callout>
|
||||
|
||||
## Clerk
|
||||
|
||||
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Clerk 应用程序的 Publishable key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
||||
- 默认值:`-`
|
||||
- 示例: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` (测试环境) / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` (生产环境)
|
||||
|
||||
### `CLERK_SECRET_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述: Clerk 应用程序的 Secret key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
||||
- 默认值:`-`
|
||||
- 示例: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` (测试环境) / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ`(生产环境)
|
||||
|
||||
@@ -36,7 +36,14 @@ LobeChat provides some additional configuration options during deployment, which
|
||||
|
||||
When using the `random` mode, a random API Key will be selected from the available multiple API Keys.
|
||||
|
||||
When using the `turn` mode, the API Keys will be retrieved in a polling manner according to the specified order.
|
||||
When using the `turn` mode, the API Keys will be retrieved in a round-robin manner according to the specified order.
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Enable Single Sign-On (SSO) for LobeChat. Set to `1` to enable SSO. For more information, see [Authentication Services](#authentication-services).
|
||||
- Default: -
|
||||
- Example: `1`
|
||||
|
||||
### `NEXT_PUBLIC_BASE_PATH`
|
||||
|
||||
@@ -50,7 +57,7 @@ When using the `turn` mode, the API Keys will be retrieved in a polling manner a
|
||||
- Type: Optional
|
||||
- Description: 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.
|
||||
- Default: -
|
||||
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
|
||||
- Example: `'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
|
||||
|
||||
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:
|
||||
|
||||
@@ -61,8 +68,8 @@ The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the Lob
|
||||
| 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. |
|
||||
| Numeric Value | `params.max_tokens=300` | Set the maximum tokens to `300`. |
|
||||
| Boolean Value | `enableAutoCreateTopic=true` | Enable automatic topic creation. |
|
||||
| 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`. |
|
||||
@@ -71,15 +78,6 @@ Further reading:
|
||||
|
||||
- [[RFC] 022 - Default Assistant Parameters Configuration via Environment Variables](https://github.com/lobehub/lobe-chat/discussions/913)
|
||||
|
||||
### `FEATURE_FLAGS`
|
||||
|
||||
- Type: Optional
|
||||
- Description: Used to control LobeChat's feature functionalities. Supports multiple feature flags, using `+` to add a feature and `-` to disable a feature. Separate multiple feature flags with a comma `,` and enclose the entire value in quotes `"` to avoid parsing errors.
|
||||
- Default: `-`
|
||||
- Example: `"-welcome_suggest"`
|
||||
|
||||
For specific content, please refer to the [Feature Flags](/docs/self-hosting/advanced/feature-flags) documentation.
|
||||
|
||||
## Plugin Service
|
||||
|
||||
### `PLUGINS_INDEX_URL`
|
||||
|
||||
@@ -32,7 +32,14 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
|
||||
使用 `random` 模式下,将在多个 API Keys 中随机获取一个 API Key。
|
||||
|
||||
使用 `turn` 模式下,将按照填写的顺序,轮询获取得到 API Key。
|
||||
使用 `turn` 模式下,将按照填写的顺序,轮训获取得到 API Key。
|
||||
|
||||
### `ENABLE_OAUTH_SSO`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。有关详细信息,请参阅[身份验证服务](#身份验证服务)。
|
||||
- 默认值: `-`
|
||||
- 示例: `1`
|
||||
|
||||
### `NEXT_PUBLIC_BASE_PATH`
|
||||
|
||||
@@ -46,7 +53,7 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
- 类型:可选
|
||||
- 描述:用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。
|
||||
- 默认值:`-`
|
||||
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer'`
|
||||
- 示例:`'model=gpt-4-1106-preview;params.max_tokens=300;plugins=search-engine,lobe-image-designer`
|
||||
|
||||
`DEFAULT_AGENT_CONFIG` 用于配置 LobeChat 默认助理的默认配置。它支持多种数据类型和结构,包括键值对、嵌套字段、数组值等。下表详细说明了 `DEFAULT_AGENT_CONFIG` 环境变量的配置项、示例以及相应解释:
|
||||
|
||||
@@ -57,8 +64,8 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
| 数组 | `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` | 启用自动创建主题,历史长度压缩阈值,历史记录条数。 |
|
||||
| 数字值 | `params.max_tokens=300` | 设置最大令牌数为 `300`。 |
|
||||
| 布尔值 | `enableAutoCreateTopic=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`。 |
|
||||
@@ -67,15 +74,6 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
|
||||
|
||||
- [[RFC] 022 - 环境变量配置默认助手参数](https://github.com/lobehub/lobe-chat/discussions/913)
|
||||
|
||||
### `FEATURE_FLAGS`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:用于控制 LobeChat 的特性功能,支持多个功能标志,使用 `+` 增加一个功能,使用 `-` 来关闭一个功能,多个功能标志之间使用英文逗号 `,` 隔开,最外层建议添加引号 `"` 以避免解析错误。
|
||||
- 默认值:`-`
|
||||
- 示例:`"-welcome_suggest"`
|
||||
|
||||
具体的内容可以参见 [特性标志](/zh/docs/self-hosting/advanced/feature-flags) 中的说明。
|
||||
|
||||
## 插件服务
|
||||
|
||||
### `PLUGINS_INDEX_URL`
|
||||
|
||||
@@ -15,13 +15,6 @@ When deploying LobeChat, a rich set of environment variables related to model se
|
||||
|
||||
## OpenAI
|
||||
|
||||
### `ENABLED_OPENAI`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables OpenAI as a model provider by default, turns off the OpenAI service when set to `0`
|
||||
- Default:`1`
|
||||
- Example:`0`
|
||||
|
||||
### `OPENAI_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
@@ -132,13 +125,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
|
||||
## AWS Bedrock
|
||||
|
||||
### `ENABLED_AWS_BEDROCK`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables AWS Bedrock as a model provider by default, turns on the AWS Bedrock service when set to `1`
|
||||
- Default:`0`
|
||||
- Example:`1`
|
||||
|
||||
### `AWS_ACCESS_KEY_ID`
|
||||
|
||||
- Type: Required
|
||||
@@ -160,15 +146,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Default: `us-east-1`
|
||||
- Example: `us-east-1`
|
||||
|
||||
## DeepSeek AI
|
||||
|
||||
### `DEEPSEEK_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the DeepSeek AI service
|
||||
- Default: -
|
||||
- Example: `sk-xxxxxx...xxxxxx`
|
||||
|
||||
## OpenRouter AI
|
||||
|
||||
### `OPENROUTER_API_KEY`
|
||||
@@ -176,7 +153,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the OpenRouter AI service
|
||||
- Default: -
|
||||
- Example: `sk-or-v1-xxxxxx...xxxxxx=`
|
||||
- Example: `sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
|
||||
### `OPENROUTER_MODEL_LIST`
|
||||
|
||||
@@ -192,7 +169,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the TogetherAI service
|
||||
- Default: -
|
||||
- Example: `xxxxxx...xxxxxx`
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
### `TOGETHERAI_MODEL_LIST`
|
||||
|
||||
@@ -203,13 +180,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
|
||||
## Ollama
|
||||
|
||||
### `ENABLED_OLLAMA`
|
||||
|
||||
- Type:Optional
|
||||
- Description:Enables Ollama as a model provider by default, turns off the Ollama service when set to `0`
|
||||
- Default:`1`
|
||||
- Example:`0`
|
||||
|
||||
### `OLLAMA_PROXY_URL`
|
||||
|
||||
- Type: Required
|
||||
@@ -240,7 +210,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied from Perplexity AI
|
||||
- Default: -
|
||||
- Example: `pplx-xxxxxx...xxxxxx`
|
||||
- Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## Minimax AI
|
||||
|
||||
@@ -249,7 +219,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the Minimax AI service
|
||||
- Default: -
|
||||
- Example: `xxxxxx...xxxxxx`
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## Mistral AI
|
||||
|
||||
@@ -258,7 +228,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the Mistral AI service
|
||||
- Default: -
|
||||
- Example: `xxxxxx...xxxxxx=`
|
||||
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
|
||||
## Groq AI
|
||||
|
||||
@@ -267,7 +237,7 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied from Groq AI
|
||||
- Default: -
|
||||
- Example: `gsk_xxxxxx...xxxxxx`
|
||||
- Example: `gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## ZHIPU AI
|
||||
|
||||
@@ -285,15 +255,6 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
||||
- Type: Required
|
||||
- Description: This is the API key you applied for in the 01.AI service
|
||||
- Default: -
|
||||
- Example:`xxxxxx...xxxxxx`
|
||||
|
||||
## Qwen
|
||||
|
||||
### `QWEN_API_KEY`
|
||||
|
||||
- Type: Required
|
||||
- Description: This is the DashScope API key you can obtain from Alibaba Cloud
|
||||
- Default: -
|
||||
- Example:`sk-xxxxx...xxxxx`
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
[model-list]: /docs/self-hosting/advanced/model-list
|
||||
|
||||
@@ -15,13 +15,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## OpenAI
|
||||
|
||||
### `ENABLED_OPENAI`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:默认启用 OpenAI 作为模型供应商,当设为 0 时关闭 OpenAI 服务
|
||||
- 默认值:`1`
|
||||
- 示例:`0`
|
||||
|
||||
### `OPENAI_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
@@ -130,13 +123,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## AWS Bedrock
|
||||
|
||||
### `ENABLED_AWS_BEDROCK`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:当设为 1 时启用 AWS Bedrock 服务
|
||||
- 默认值:`0`
|
||||
- 示例:`1`
|
||||
|
||||
### `AWS_ACCESS_KEY_ID`
|
||||
|
||||
- 类型:必选
|
||||
@@ -158,15 +144,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 默认值:`us-east-1`
|
||||
- 示例:`us-east-1`
|
||||
|
||||
## DeepSeek AI
|
||||
|
||||
### `DEEPSEEK_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:这是你在 DeepSeek AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-xxxxxx...xxxxxx`
|
||||
|
||||
## OpenRouter AI
|
||||
|
||||
### `OPENROUTER_API_KEY`
|
||||
@@ -174,7 +151,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 OpenRouter AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-or-v1-xxxxxx...xxxxxx=`
|
||||
- 示例:`sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
|
||||
### `OPENROUTER_MODEL_LIST`
|
||||
|
||||
@@ -190,7 +167,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 TogetherAI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
### `TOGETHERAI_MODEL_LIST`
|
||||
|
||||
@@ -201,13 +178,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
|
||||
## Ollama
|
||||
|
||||
### `ENABLED_OLLAMA`
|
||||
|
||||
- 类型:可选
|
||||
- 描述:默认启用 Ollama 作为模型供应商,当设为 0 时关闭 Ollama 服务
|
||||
- 默认值:`1`
|
||||
- 示例:`0`
|
||||
|
||||
### `OLLAMA_PROXY_URL`
|
||||
|
||||
- 类型:必选
|
||||
@@ -238,7 +208,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Perplexity AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`pplx-xxxxxx...xxxxxx`
|
||||
- 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## Minimax AI
|
||||
|
||||
@@ -247,7 +217,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Minimax AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## Mistral AI
|
||||
|
||||
@@ -256,7 +226,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Mistral AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxx...xxxxxx=`
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
|
||||
|
||||
## Groq AI
|
||||
|
||||
@@ -265,7 +235,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在 Groq AI 服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`gsk_xxxxxx...xxxxxx`
|
||||
- 示例:`gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
## 智谱 AI
|
||||
|
||||
@@ -283,15 +253,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
||||
- 类型:必选
|
||||
- 描述:这是你在零一万物服务中申请的 API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`xxxxxx...xxxxxx`
|
||||
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
||||
|
||||
[model-list]: /docs/self-hosting/advanced/model-list
|
||||
|
||||
## 通义千问
|
||||
|
||||
### `QWEN_API_KEY`
|
||||
|
||||
- 类型:必选
|
||||
- 描述:这是你在阿里云百炼平台上获取的 DashScope API 密钥
|
||||
- 默认值:-
|
||||
- 示例:`sk-xxxxx...xxxxx`
|
||||
|
||||
@@ -27,7 +27,7 @@ First, you need to install Ollama. For detailed steps on installing and configur
|
||||
Assuming you have already started the Ollama service locally on port `11434`. Run the following Docker command to start LobeChat locally:
|
||||
|
||||
```bash
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 lobehub/lobe-chat
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434/v1 lobehub/lobe-chat
|
||||
```
|
||||
|
||||
Now, you can use LobeChat to converse with the local LLM.
|
||||
@@ -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
|
||||
|
||||
@@ -64,10 +64,10 @@ If Ollama is run as a macOS application, environment variables should be set usi
|
||||
|
||||
1. For each environment variable, call `launchctl setenv`.
|
||||
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
|
||||
2. Restart Ollama application.
|
||||
|
||||
@@ -77,25 +77,25 @@ If Ollama is run as a systemd service, environment variables should be set using
|
||||
|
||||
1. Edit the systemd service by calling `sudo systemctl edit ollama.service`.
|
||||
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
|
||||
2. For each environment variable, add a line `Environment` under section `[Service]`:
|
||||
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
3. Save and exit.
|
||||
4. Reload `systemd` and restart Ollama:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
### Setting environment variables on Docker
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Ollama 是一款强大的本地运行大型语言模型(LLM)的框架,支
|
||||
假设你已经在本地 `11434` 端口启动了 Ollama 服务。运行以下 Docker 命令行,在本地启动 LobeChat:
|
||||
|
||||
```bash
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434 lobehub/lobe-chat
|
||||
docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434/v1 lobehub/lobe-chat
|
||||
```
|
||||
|
||||
接下来,你就可以使用 LobeChat 与本地 LLM 对话了。
|
||||
@@ -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 上设置环境变量
|
||||
|
||||
@@ -62,10 +62,10 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
|
||||
1. 对于每个环境变量,调用 `launchctl setenv`。
|
||||
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
```bash
|
||||
launchctl setenv OLLAMA_HOST "0.0.0.0"
|
||||
launchctl setenv OLLAMA_ORIGINS "*"
|
||||
```
|
||||
|
||||
2. 重启 Ollama 应用程序。
|
||||
|
||||
@@ -75,28 +75,29 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
|
||||
1. 通过调用`sudo systemctl edit ollama.service`编辑 systemd 服务。
|
||||
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
```bash
|
||||
sudo systemctl edit ollama.service
|
||||
```
|
||||
|
||||
2. 对于每个环境变量,在`[Service]`部分下添加`Environment`:
|
||||
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
```bash
|
||||
[Service]
|
||||
Environment="OLLAMA_HOST=0.0.0.0"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
3. 保存并退出。
|
||||
4. 重载`systemd`并重启 Ollama:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
### 在 Docker 上设置环境变量
|
||||
|
||||
如果 Ollama 作为 Docker 容器运行,你可以将环境变量添加到 `docker run` 命令中。
|
||||
|
||||
详细配置方法可以参考 [Ollama 官方文档](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server)。
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ services:
|
||||
OPENAI_API_KEY: sk-xxxx
|
||||
OPENAI_PROXY_URL: https://api-proxy.com/v1
|
||||
ACCESS_CODE: lobe66
|
||||
|
||||
```
|
||||
|
||||
运行以下命令启动 Lobe Chat 服务:
|
||||
@@ -91,7 +92,7 @@ output=$(docker pull lobehub/lobe-chat:latest 2>&1)
|
||||
|
||||
# Check if the pull command was executed successfully
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the output contains a specific string
|
||||
@@ -99,7 +100,7 @@ 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
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Detected Lobe-Chat update"
|
||||
|
||||
@@ -64,7 +64,7 @@ Command explanation:
|
||||
|
||||
- Replace `sk-xxxx` in the above command with your OpenAI API Key.
|
||||
|
||||
- For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-variables) section.
|
||||
- For the complete list of environment variables supported by LobeChat, please refer to the [Environment Variables](/docs/self-hosting/environment-ariable) section.
|
||||
|
||||
<Callout type="tip">
|
||||
Since the official Docker image build takes about half an hour, if you see the "update available"
|
||||
|
||||
@@ -23,8 +23,6 @@ tags:
|
||||
|
||||
我们提供了 [Docker 镜像][docker-release-link],供你在自己的私有设备上部署 LobeChat 服务。
|
||||
|
||||
## 部署指南
|
||||
|
||||
<Steps>
|
||||
### 安装 Docker 容器环境
|
||||
|
||||
@@ -62,7 +60,7 @@ $ docker run -d -p 3210:3210 \
|
||||
指令说明:
|
||||
|
||||
- 默认映射端口为 `3210`, 请确保未被占用或手动更改端口映射
|
||||
- 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx` ,获取 API Key 的方式详见最后一节。
|
||||
- 使用你的 OpenAI API Key 替换上述命令中的 `sk-xxxx`
|
||||
|
||||
<Callout type={'tip'}>
|
||||
LobeChat 支持的完整环境变量列表请参考 [📘 环境变量](/docs/self-hosting/environment-variables) 部分
|
||||
@@ -161,64 +159,6 @@ echo "Removed old images."
|
||||
|
||||
</Steps>
|
||||
|
||||
## 获取 OpenAI API Key
|
||||
|
||||
API Key 是使用 LobeChat 进行大语言模型会话的必要信息,本节以 OpenAI 模型服务商为例,简要介绍获取 API Key 的方式。
|
||||
|
||||
### `A` 通过 OpenAI 官方渠道
|
||||
|
||||
- 注册一个 [OpenAI 账户](https://platform.openai.com/signup),你需要使用国际手机号、非大陆邮箱进行注册;
|
||||
- 注册完毕后,前往 [API Keys](https://platform.openai.com/api-keys) 页面,点击 `Create new secret key` 创建新的 API Key:
|
||||
|
||||
<Steps>
|
||||
|
||||
#### 步骤 1:打开创建窗口
|
||||
|
||||
<Image
|
||||
alt={'打开创建窗口'}
|
||||
height={600}
|
||||
src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296253192-ff2193dd-f125-4e58-82e8-91bc376c0d68.png"
|
||||
/>
|
||||
|
||||
#### 步骤 2:创建 API Key
|
||||
|
||||
<Image
|
||||
alt={'创建 API Key'}
|
||||
height={600}
|
||||
src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296254170-803bacf0-4471-4171-ae79-0eab08d621d1.png"
|
||||
/>
|
||||
|
||||
#### 步骤 3:获取 API Key
|
||||
|
||||
<Image
|
||||
alt={'获取 API Key'}
|
||||
height={600}
|
||||
src="https://github-production-user-asset-6210df.s3.amazonaws.com/28616219/296255167-f2745f2b-f083-4ba8-bc78-9b558e0002de.png"
|
||||
/>
|
||||
|
||||
</Steps>
|
||||
|
||||
将此 API Key 填写到 LobeChat 的 API Key 配置中,即可开始使用。
|
||||
|
||||
<Callout type={'tip'}>
|
||||
账户注册后,一般有 5 美元的免费额度,但有效期只有三个月。如果你希望长期使用你的 API
|
||||
Key,你需要完成支付的信用卡绑定。由于 OpenAI
|
||||
只支持外币信用卡,因此你需要找到合适的支付渠道,此处不再详细展开。
|
||||
</Callout>
|
||||
|
||||
### `B` 通过 OpenAI 第三方代理商
|
||||
|
||||
如果你发现注册 OpenAI 账户或者绑定外币信用卡比较麻烦,可以考虑借助一些知名的 OpenAI 第三方代理商来获取 API Key,这可以有效降低获取 OpenAI API Key 的门槛。但与此同时,一旦使用三方服务,你可能也需要承担潜在的风险,请根据你自己的实际情况自行决策。以下是常见的第三方模型代理商列表,供你参考:
|
||||
|
||||
| Logo | 服务商 | 特性说明 | Proxy 代理地址 | 链接 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/296272721-c3ac0bf3-e433-4496-89c4-ebdc20689c17.jpg" width="40" /> | **AiHubMix** | 使用 OpenAI 企业接口,全站模型价格为官方 **86 折**(含 GPT-4 、Cluade 3.5 等) | `https://aihubmix.com/v1` | [获取](https://lobe.li/CnsM6fH) |
|
||||
|
||||
<Callout type={'warning'}>
|
||||
**免责申明**: 在此推荐的 OpenAI API Key 由第三方代理商提供,所以我们不对 API Key 的 **有效性** 和
|
||||
**安全性** 负责,请你自行承担购买和使用 API Key 的风险。
|
||||
</Callout>
|
||||
|
||||
[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
|
||||
|
||||
@@ -41,6 +41,6 @@ Vercel's assigned domain DNS may be polluted in some regions, so binding a custo
|
||||
If you have deployed your project using the one-click deployment steps mentioned above, you may find that you are always prompted with "updates available." This is because Vercel creates a new project for you by default instead of forking this project, which causes the inability to accurately detect updates.
|
||||
|
||||
<Callout>
|
||||
We recommend following the [Self-Hosting Upstream Sync](/docs/self-hosting/advanced/upstream-sync)
|
||||
steps to Redeploy.
|
||||
We recommend following the [Self-Hosting Upstream Sync](/docs/self-hosting/advanced/upstream-sync) steps to
|
||||
Redeploy.
|
||||
</Callout>
|
||||
|
||||
@@ -40,8 +40,7 @@ Vercel 分配的域名 DNS 在某些区域被污染了,绑定自定义域名
|
||||
如果你根据上述中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。
|
||||
|
||||
<Callout>
|
||||
我们建议按照 [📘 LobeChat 自部署保持更新](/docs/self-hosting/advanced/upstream-sync)
|
||||
步骤重新部署。
|
||||
我们建议按照 [📘 LobeChat 自部署保持更新](/docs/self-hosting/advanced/upstream-sync) 步骤重新部署。
|
||||
</Callout>
|
||||
|
||||
[deploy-button-image]: https://vercel.com/button
|
||||
|
||||
@@ -35,50 +35,3 @@ You can use the subdomain provided by Zeabur, or choose to bind a custom domain.
|
||||
|
||||
[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!
|
||||
|
||||
Since Zeabur does NOT officially support FREE users deploy containerized service, you may wish to deploy LobeChat as a serverless function service. To deploy LobeChat as a serverless function service on Zeabur, you can follow the steps below:
|
||||
|
||||
## Zeabur Deployment Process
|
||||
|
||||
<Steps>
|
||||
|
||||
### Fork LobeChat
|
||||
|
||||
### Add Zeabur pack config file
|
||||
|
||||
Add a `zbpack.json` configuration file with the following content to the root dir of your fork:
|
||||
|
||||
```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.
|
||||
|
||||
### Login to your [Zeabur dashboard](https://dash.zeabur.com)
|
||||
|
||||
If you do not already have an account, you will need to register one.
|
||||
|
||||
### Create a project and service
|
||||
|
||||
Create a project, then create a service under this project.
|
||||
|
||||
### Link your fork of LobeChat to the just created Zeabur service.
|
||||
|
||||
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
|
||||
|
||||
### Bind a custom domain (optional)
|
||||
|
||||
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.
|
||||
|
||||
</Steps>
|
||||
|
||||
@@ -34,50 +34,3 @@ tags:
|
||||
|
||||
[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),请自担风险!
|
||||
|
||||
由于 Zeabur 并未官方支持免费用户部署容器化服务,您可能希望将 LobeChat 部署为无服务器函数服务。要在 Zeabur 上将 LobeChat 部署为无服务器函数服务,您可以按照以下步骤操作:
|
||||
|
||||
## Zeabur 部署流程
|
||||
|
||||
<Steps>
|
||||
|
||||
### Fork LobeChat
|
||||
|
||||
### 添加 Zeabur 打包配置文件
|
||||
|
||||
在您的分支的根目录下添加一个 `zbpack.json` 配置文件,内容如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"ignore_dockerfile": true,
|
||||
"serverless": true
|
||||
}
|
||||
```
|
||||
|
||||
### 准备您的 OpenAI API 密钥
|
||||
|
||||
前往 [OpenAI API 密钥](https://platform.openai.com/account/api-keys) 获取您的 OpenAI API 密钥。
|
||||
|
||||
### 登录到您的 [Zeabur 仪表板](https://dash.zeabur.com)
|
||||
|
||||
如果您尚未拥有一个账号,您需要注册一个。
|
||||
|
||||
### 创建项目与服务。
|
||||
|
||||
创建一个项目,并再这个项目下新建一个服务。
|
||||
|
||||
### 将您的 LobeChat 分支链接到刚创建的 Zeabur 服务。
|
||||
|
||||
在添加服务时,选择 github。这可能会触发一个 oAuth,取决于诸如您如何登录到 Zeabur以及您是否已经授权 Zeabur 访问所有您的存储库等各种因素。
|
||||
|
||||
### 绑定自定义域名(可选)
|
||||
|
||||
您可以创建 Zeabur 提供的子域名,或选择绑定自定义域名。目前,Zeabur 提供的域名尚未受到污染,大多数地区可以直接连接。
|
||||
|
||||
### Zeabur 将开始自动构建,您应该可以在一段时间后通过您选择的域名访问它。
|
||||
|
||||
</Steps>
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
title: Efficiently Organize Your AI Assistants with LobeChat
|
||||
description: >-
|
||||
Learn how to use LobeChat's grouping, search, and pinning functions to
|
||||
efficiently organize and locate your AI assistants.
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI assistants
|
||||
- assistant organization
|
||||
- grouping
|
||||
- search function
|
||||
- pinning function
|
||||
---
|
||||
|
||||
# Assistant Organization Guide
|
||||
|
||||
<Image
|
||||
alt={'Assistant Organization'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/5e04b71a-4c25-4f3d-ae7d-9237ffcb37be'}
|
||||
/>
|
||||
|
||||
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.
|
||||
|
||||
When you have added a large number of assistants, finding a specific assistant in the list may become challenging. LobeChat provides `search`, `grouping`, and `pinning` functions to help you better organize assistants and improve efficiency in locating them.
|
||||
|
||||
## Assistant Grouping
|
||||
|
||||
Firstly, LobeChat's AI assistants support organization through grouping. You can categorize assistants of the same type together and easily search for the required assistants by collapsing and expanding groups.
|
||||
|
||||
### Assistant Settings
|
||||
|
||||
<Image
|
||||
alt={'Assistant Grouping'}
|
||||
src={'https://github.com/user-attachments/assets/97a9d713-f4c1-4170-a707-d2060eeab35c'}
|
||||
/>
|
||||
|
||||
- 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
|
||||
|
||||
<Image
|
||||
alt={'Group Menu'}
|
||||
src={'https://github.com/user-attachments/assets/b9ca37db-0f0b-449f-b3b7-f147bec3a735'}
|
||||
/>
|
||||
|
||||
- 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
|
||||
|
||||
<Image
|
||||
alt={'Assistant Search'}
|
||||
src={'https://github.com/user-attachments/assets/816ad463-e1ef-478b-9930-c40948247288'}
|
||||
/>
|
||||
|
||||
- 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
|
||||
|
||||
<Image
|
||||
alt={'Assistant Pinning'}
|
||||
src={'https://github.com/user-attachments/assets/d574b08e-ab93-4723-9d1b-9e9be2bff7ee'}
|
||||
/>
|
||||
|
||||
- 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.
|
||||
- For pinned assistants, you can choose `Unpin` to remove them from the pinned area.
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
title: LobeChat 助手组织指南 - 提升助手管理效率
|
||||
description: 了解如何通过分组、搜索和固定功能更好地组织 LobeChat 的 AI 助手,提升助手管理效率和定位效率。
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI 助手
|
||||
- 助手组织
|
||||
- 分组设置
|
||||
- 助手搜索
|
||||
- 助手固定
|
||||
---
|
||||
|
||||
# 助手组织指南
|
||||
|
||||
<Image
|
||||
alt={'助手组织'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/5e04b71a-4c25-4f3d-ae7d-9237ffcb37be'}
|
||||
/>
|
||||
|
||||
LobeChat 提供了丰富的 AI 助手资源,用户可以通过助手市场方便地添加各类助手,为 AI 应用提供了广泛的应用场景。
|
||||
|
||||
当你添加了大量助手后,在列表中寻找特定助手可能会变得比较困难。LobeChat 提供了`搜索`、`分组`和`固定`功能,帮助您更好地组织助手,提升定位效率。
|
||||
|
||||
## 助手分组
|
||||
|
||||
首先 LobeChat 的 AI 助手支持以分组的方式进行组织。你可以将同类型的助手归类到一起,并通过折叠和展开分组的方式方便地查询所需助手。
|
||||
|
||||
### 助手设置
|
||||
|
||||
<Image
|
||||
alt={'助手分组'}
|
||||
src={'https://github.com/user-attachments/assets/97a9d713-f4c1-4170-a707-d2060eeab35c'}
|
||||
/>
|
||||
|
||||
- 在单个助手的菜单中,选择`移动到分组`选项可以快速将该助手归类到指定分组。
|
||||
- 如果没有你想要的分组,可以选择`添加分组`,快速创建一个新的分组。
|
||||
|
||||
### 分组设置
|
||||
|
||||
<Image
|
||||
alt={'分组菜单'}
|
||||
src={'https://github.com/user-attachments/assets/b9ca37db-0f0b-449f-b3b7-f147bec3a735'}
|
||||
/>
|
||||
|
||||
- 在分组菜单中,可以快速在该分组下新建助手
|
||||
- 点击`分组管理`按钮可以对所有分组进行`重命名`、`删除`、`排序`等操作。
|
||||
|
||||
## 助手搜索
|
||||
|
||||
<Image
|
||||
alt={'助手搜索'}
|
||||
src={'https://github.com/user-attachments/assets/816ad463-e1ef-478b-9930-c40948247288'}
|
||||
/>
|
||||
|
||||
- 在助手列表的顶部,您可以通过助手搜索功能,方便地使用关键词定位到您所需的助手。
|
||||
|
||||
## 助手固定
|
||||
|
||||
<Image
|
||||
alt={'助手固定'}
|
||||
src={'https://github.com/user-attachments/assets/d574b08e-ab93-4723-9d1b-9e9be2bff7ee'}
|
||||
/>
|
||||
|
||||
- 在助手菜单中,你可以使用`固定`功能将该助手固定在顶部。
|
||||
- 固定助手后,助手列表的上方将出现一个固定区域,显示所有已固定的助手列表。
|
||||
- 对于已固定的助手,你可以选择`解除固定`,将其移出固定区域。
|
||||
@@ -57,7 +57,7 @@ The second prompt generates longer output and better structure. The use of the t
|
||||
- **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.
|
||||
|
||||
|
||||
</Callout>
|
||||
|
||||
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.
|
||||
|
||||
@@ -53,7 +53,7 @@ tags:
|
||||
- **尽量明确你的需求:** 模型的输出会尽可能满足你的需求,所以如果你的需求不明确,输出可能会不如预期。
|
||||
- **使用正确的语法和拼写:** 模型会尽可能模仿你的语言风格,所以如果你的语言风格有问题,输出可能也会有问题。
|
||||
- **提供足够的上下文信息:** 模型会根据你提供的上下文信息生成输出,所以如果你提供的上下文信息不足,可能无法生成你想要的结果。
|
||||
|
||||
|
||||
</Callout>
|
||||
|
||||
在为讨论问题制定有效的提示后,您现在需要细化生成的结果。这可能涉及到调整输出以符合诸如字数等限制,或将不同生成的结果的概念组合在一起。
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
title: Support Multi-User Management - Identity Verification Solutions
|
||||
description: >-
|
||||
Explore LobeChat's user authentication solutions with next-auth and Clerk for
|
||||
flexible and secure user management. Learn about features like user
|
||||
registration, session management, multi-factor authentication, and more.
|
||||
tags:
|
||||
- Multi-User Management
|
||||
- Identity Verification
|
||||
- next-auth
|
||||
- Clerk
|
||||
- User Authentication
|
||||
- Session Management
|
||||
- Multi-Factor Authentication
|
||||
- User Management
|
||||
---
|
||||
|
||||
# Support Multi-User Management
|
||||
|
||||
<Image
|
||||
alt={'Identity Verification System'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2'}
|
||||
/>
|
||||
|
||||
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.
|
||||
|
||||
## next-auth: Flexible and Powerful Identity Verification Library
|
||||
|
||||
LobeChat integrates `next-auth`, a flexible and powerful identity verification library that supports various authentication methods, including OAuth, email login, and credential login. With `next-auth`, you can easily achieve the following functions:
|
||||
|
||||
- **User Registration and Login**: Support various authentication methods to meet different user needs.
|
||||
- **Session Management**: Efficiently manage user sessions to ensure security.
|
||||
- **Social Login**: Support quick login via various social platforms.
|
||||
- **Data Security**: Ensure the security and privacy of user data.
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Due to workload constraints, integration of next-auth with a server-side database has not been
|
||||
implemented yet. If you need to use a server-side database, please use Clerk.
|
||||
</Callout>
|
||||
|
||||
<Callout type={'info'}>
|
||||
For information on using Next-Auth, you can refer to [Authentication Services - Next
|
||||
Auth](/docs/self-hosting/advanced/authentication#next-auth).
|
||||
</Callout>
|
||||
|
||||
## Clerk: Modern User Management Platform
|
||||
|
||||
For users requiring advanced user management features, LobeChat also supports [Clerk](https://clerk.com), a modern user management platform. Clerk offers richer functionality to help you achieve higher security and flexibility:
|
||||
|
||||
- **Multi-Factor Authentication (MFA)**: Provides higher security protection.
|
||||
- **User Profile Management**: Conveniently manage user information and configurations.
|
||||
- **Login Activity Monitoring**: Real-time monitoring of user login activities to ensure account security.
|
||||
- **Scalability**: Supports complex user management requirements.
|
||||
|
||||
<Callout type={'info'}>
|
||||
For information on using Clerk, you can refer to [Authentication Services -
|
||||
Clerk](/docs/self-hosting/advanced/authentication#clerk) .
|
||||
</Callout>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
If you need to use Clerk in conjunction with a server-side database, you can refer to the
|
||||
"Configuring Authentication Services" section in [Deploying with a Server-Side
|
||||
Database](/docs/self-hosting/advanced/server-database).
|
||||
</Callout>
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
title: 多用户管理支持
|
||||
description: LobeChat 提供了多种用户认证和管理方案,以满足不同用户的需求。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 用户管理
|
||||
- next-auth
|
||||
- Clerk
|
||||
- 身份验证
|
||||
- 多因素认证
|
||||
---
|
||||
|
||||
# 身份验证系统 / 多用户管理支持
|
||||
|
||||
<Image
|
||||
alt={'身份验证系统'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/8ce70e15-40df-451e-b700-66090fe5b8c2'}
|
||||
/>
|
||||
|
||||
在现代应用中,用户管理和身份验证是至关重要的功能。为满足不同用户的多样化需求,LobeChat 提供了两种主要的用户认证和管理方案:`next-auth` 和 `Clerk`。无论您是追求简便的用户注册登录,还是需要更高级的多因素认证和用户管理,LobeChat 都可以灵活实现。
|
||||
|
||||
## next-auth:灵活且强大的身份验证库
|
||||
|
||||
LobeChat 集成了 `next-auth`,一个灵活且强大的身份验证库,支持多种身份验证方式,包括 OAuth、邮件登录、凭证登录等。通过 `next-auth`,您可以轻松实现以下功能:
|
||||
|
||||
- **用户注册和登录**:支持多种认证方式,满足不同用户的需求。
|
||||
- **会话管理**:高效管理用户会话,确保安全性。
|
||||
- **社交登录**:支持多种社交平台的快捷登录。
|
||||
- **数据安全**:保障用户数据的安全性和隐私性。
|
||||
|
||||
<Callout type={'warning'}>
|
||||
由于工作量原因,目前还没有实现 next-auth 与服务端数据库的集成,如果需要使用服务端数据库,请使用
|
||||
Clerk 。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'info'}>
|
||||
关于 Next-Auth 的使用,可以查阅 [身份验证服务 - Next
|
||||
Auth](/zh/docs/self-hosting/advanced/authentication#next-auth)。
|
||||
</Callout>
|
||||
|
||||
## Clerk:现代化用户管理平台
|
||||
|
||||
对于需要更高级用户管理功能的用户,LobeChat 还支持 [Clerk](https://clerk.com) ,一个现代化的用户管理平台。Clerk 提供了更丰富的功能,帮助您实现更高的安全性和灵活性:
|
||||
|
||||
- **多因素认证 (MFA)**:提供更高的安全保障。
|
||||
- **用户配置文件管理**:便捷管理用户信息和配置。
|
||||
- **登录活动监控**:实时监控用户登录活动,确保账户安全。
|
||||
- **扩展性**:支持复杂的用户管理需求。
|
||||
|
||||
<Callout type={'info'}>
|
||||
关于 Clerk 的使用,可以查阅 [身份验证服务 -
|
||||
Clerk](/zh/docs/self-hosting/advanced/authentication#clerk)。
|
||||
</Callout>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
如果需要在服务端数据库中搭配使用 Clerk 的使用,可以查阅
|
||||
[使用服务端数据库部署](/zh/docs/self-hosting/advanced/server-database)
|
||||
中的「配置身份验证服务」部分。
|
||||
</Callout>
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
title: Local / Cloud Database Solutions for LobeChat
|
||||
description: >-
|
||||
Explore the options of local and server-side databases for LobeChat, offering
|
||||
data control, privacy protection, and convenient user experiences.
|
||||
tags:
|
||||
- Local Database
|
||||
- Server-Side Database
|
||||
- Data Privacy
|
||||
- Data Control
|
||||
- CRDT Technology
|
||||
- PostgreSQL
|
||||
- Dirzzle ORM
|
||||
- Clerk Authentication
|
||||
---
|
||||
|
||||
# Local / Cloud Database
|
||||
|
||||
<Image
|
||||
alt={'Local / Cloud Database'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9'}
|
||||
/>
|
||||
|
||||
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.
|
||||
|
||||
## Local Database: Data Control and Privacy Protection
|
||||
|
||||
For users who prefer more control over their data and value privacy protection, LobeChat offers support for local databases. By using IndexedDB as the storage solution and combining it with dexie as an Object-Relational Mapping (ORM) tool, LobeChat achieves efficient data management.
|
||||
|
||||
Additionally, we have introduced Conflict-Free Replicated Data Type (CRDT) technology to ensure a seamless multi-device synchronization experience. This experimental feature aims to provide users with greater autonomy and data security.
|
||||
|
||||
<Callout type={'info'}>
|
||||
LobeChat defaults to the local database solution to reduce the onboarding cost for new users.
|
||||
</Callout>
|
||||
|
||||
Furthermore, we have attempted to introduce CRDT technology to achieve cross-device synchronization based on the local database. This experimental feature aims to provide users with greater autonomy and data security.
|
||||
|
||||
## Server-Side Database: Convenient and Efficient User Experience
|
||||
|
||||
For users who seek a convenient user experience, LobeChat supports PostgreSQL as the server-side database. By managing data with Dirzzle ORM and combining it with Clerk for authentication, LobeChat can offer users an efficient and reliable server-side data management solution.
|
||||
|
||||
### Server-Side Database Technology Stack
|
||||
|
||||
- **DB**: PostgreSQL (Neon is the default)
|
||||
- **ORM**: Dirzzle ORM
|
||||
- **Auth**: Clerk
|
||||
- **Server Router**: tRPC
|
||||
|
||||
## Deployment Solution Selection Guide
|
||||
|
||||
### 1. Local Database
|
||||
|
||||
The local database solution is suitable for users who wish to have strict control over their data. With LobeChat's support for local databases, you can securely store and manage data without relying on external servers. This solution is particularly suitable for users with high requirements for data privacy.
|
||||
|
||||
### 2. Server-Side Database
|
||||
|
||||
The server-side database solution is ideal for users who want to simplify data management processes and enjoy a convenient user experience. Through server-side databases and user authentication, LobeChat can ensure the security and efficiency of data. If you want to learn how to configure a server-side database, please refer to our [detailed documentation](/docs/self-hosting/advanced/server-database).
|
||||
|
||||
Whether you choose a local database or a server-side database, LobeChat can provide you with an excellent user experience.
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
title: LobeChat 支持本地 / 云端数据库存储
|
||||
description: LobeChat 支持本地 / 云端数据存储,既能实现 Local First,同时支持数据云同步。
|
||||
tags:
|
||||
- LobeChat
|
||||
- IndexedDB
|
||||
- Postgres
|
||||
- Local First
|
||||
- 数据云同步
|
||||
- 数据库
|
||||
---
|
||||
|
||||
# 本地 / 云端数据存储
|
||||
|
||||
<Image
|
||||
alt={'本地 / 云端数据存储'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/c27a0234-a4e9-40e5-8bcb-42d5ce7e40f9'}
|
||||
/>
|
||||
|
||||
在现代应用开发中,数据存储方案的选择至关重要。为了满足不同用户的需求,LobeChat 提供了同时支持本地数据库和服务端数据库的灵活配置。无论您是注重数据隐私与掌控,还是追求便捷的使用体验,LobeChat 都能为您提供卓越的解决方案。
|
||||
|
||||
## 本地数据库:数据掌控与隐私保护
|
||||
|
||||
对于希望对数据有更多掌控感和隐私保护的用户,LobeChat 提供了本地数据库支持。采用 IndexedDB 作为存储解决方案,并结合 dexie 作为 ORM(对象关系映射),LobeChat 实现了高效的数据管理。
|
||||
|
||||
同时,我们引入了 CRDT(Conflict-Free Replicated Data Type)技术,确保多端同步功能的无缝体验。这一实验性功能旨在为用户提供更高的自主性和数据安全性。
|
||||
|
||||
<Callout type={'info'}>LobeChat 默认采取本地数据库方案,以降低新用户的上手成本。</Callout>
|
||||
|
||||
此外,我们尝试引入了 CRDT(Conflict-Free Replicated Data Type)技术,在本地数据库基础上实现了跨端同步。这一实验性功能旨在为用户提供更高的自主性和数据安全性。
|
||||
|
||||
## 服务端数据库:便捷与高效的使用体验
|
||||
|
||||
对于追求便捷使用体验的用户,LobeChat 支持 PostgreSQL 作为服务端数据库。通过 Dirzzle ORM 管理数据,结合 Clerk 进行身份验证,LobeChat 能够为用户提供高效、可靠的服务端数据管理方案。
|
||||
|
||||
### 服务端数据库技术栈
|
||||
|
||||
- **DB**: PostgreSQL(默认使用 Neon)
|
||||
- **ORM**: Dirzzle ORM
|
||||
- **Auth**: Clerk
|
||||
- **Server Router**: tRPC
|
||||
|
||||
## 部署方案选择指南
|
||||
|
||||
### 1. 本地数据库
|
||||
|
||||
本地数据库方案适用于那些希望对数据进行严格控制的用户。通过 LobeChat 的本地数据库支持,您可以在不依赖外部服务器的情况下,安全地存储和管理数据。这一方案特别适合对数据隐私有高要求的用户。
|
||||
|
||||
### 2. 服务端数据库
|
||||
|
||||
服务端数据库方案则适合那些希望简化数据管理流程,享受便捷使用体验的用户。通过服务端数据库与用户身份验证,LobeChat 能够确保数据的安全性与高效性。如果您希望了解如何配置服务端数据库,请参考我们的[详细文档](/zh/docs/self-hosting/advanced/server-database)。
|
||||
|
||||
无论选择本地数据库还是服务端数据库,LobeChat 都能为你提供卓越的用户体验。
|
||||
@@ -49,8 +49,3 @@ Compared to cloud-based solutions, a local LLM provides higher privacy and secur
|
||||
### Embark on Your LobeChat & Ollama AI Journey
|
||||
|
||||
Now, let's embark on this exciting journey together! Through the collaboration of LobeChat and Ollama AI, explore the endless possibilities brought by AI. Whether you are a tech enthusiast or simply curious about AI communication, LobeChat will offer you an unprecedented experience.
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'Using Multiple Model Providers'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'Using Ollama Local Model'} />
|
||||
</Cards>
|
||||
|
||||
@@ -41,8 +41,3 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
||||
### 开启您的 LobeChat & Ollama AI 之旅
|
||||
|
||||
现在,就让我们一起开启这段激动人心的旅程吧!通过 LobeChat 与 Ollama AI 的协作,探索 AI 带来的无限可能。无论您是技术爱好者,还是对 AI 交流充满好奇,LobeChat 都将为您提供一场前所未有的体验。
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'使用多模型服务商'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'使用 Ollama 本地模型'} />
|
||||
</Cards>
|
||||
|
||||
@@ -45,8 +45,6 @@ We have implemented support for the following model service providers:
|
||||
- **01.AI (Yi Model)**: Integrated the 01.AI models, with series of APIs featuring fast inference speed, which not only shortened the processing time, but also maintained excellent model performance. [Learn more](https://01.ai/)
|
||||
- **Together.ai**: Over 100 leading open-source Chat, Language, Image, Code, and Embedding models are available through the Together Inference API. For these models you pay just for what you use. [Learn more](https://www.together.ai/)
|
||||
- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)
|
||||
- **Qwen**: Integrated with the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Learn more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).
|
||||
|
||||
@@ -59,8 +57,3 @@ At the same time, we are also planning to support more model service providers,
|
||||
/>
|
||||
|
||||
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. For more details, see [Local Model Support](/docs/usage/features/local-llm).
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'Using Multiple Model Providers'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'Using Ollama Local Model'} />
|
||||
</Cards>
|
||||
|
||||
@@ -45,8 +45,6 @@ tags:
|
||||
- **Groq**:接入了 Groq 的 AI 模型,高效处理消息序列,生成回应,胜任多轮对话及单次交互任务。[了解更多](https://groq.com/)
|
||||
- **OpenRouter**:其支持包括 **Claude 3**,**Gemma**,**Mistral**,**Llama2**和**Cohere**等模型路由,支持智能路由优化,提升使用效率,开放且灵活。[了解更多](https://openrouter.ai/)
|
||||
- **Minimax**: 接入了 Minimax 的 AI 模型,包括 MoE 模型 **abab6**,提供了更多的选择空间。[了解更多](https://www.minimaxi.com/)
|
||||
- **DeepSeek**: 接入了 DeepSeek 的 AI 模型,包括最新的 **DeepSeek-V2**,提供兼顾性能与价格的模型。[了解更多](https://www.deepseek.com/)
|
||||
- **Qwen (通义千问)**: 接入了 Qwen 的 AI 模型,包括最新的 **qwen-turbo**,**qwen-plus** 和 **qwen-max** 等模型。[了解更多](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
||||
|
||||
同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)。
|
||||
|
||||
@@ -59,8 +57,3 @@ tags:
|
||||
/>
|
||||
|
||||
为了满足特定用户的需求,LobeChat 还基于 [Ollama](https://ollama.ai) 支持了本地模型的使用,让用户能够更灵活地使用自己的或第三方的模型,详见 [本地模型支持](/docs/usage/features/local-llm)。
|
||||
|
||||
<Cards>
|
||||
<Card href={'/docs/usage/providers'} title={'使用多模型服务商'} />
|
||||
<Card href={'/docs/usage/providers/ollama'} title={'使用 Ollama 本地模型'} />
|
||||
</Cards>
|
||||
|
||||
@@ -40,8 +40,7 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
||||
## 插件生态体系
|
||||
|
||||
<Callout>
|
||||
如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘
|
||||
插件开发指南](/docs/usage/plugins/development)。
|
||||
如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 [📘 插件开发指南](/docs/usage/plugins/development)。
|
||||
</Callout>
|
||||
|
||||
- [lobe-chat-plugins][lobe-chat-plugins]:这是 LobeChat 的插件索引。它从该仓库的 index.json 中获取插件列表并显示给用户。
|
||||
|
||||
@@ -28,8 +28,7 @@ If you are unfamiliar with the installation process of PWA, you can follow the s
|
||||
## Running on Chrome / Edge
|
||||
|
||||
<Callout type={'important'}>
|
||||
On macOS, when using a Chrome-installed PWA, it is required that Chrome be open, otherwise Chrome
|
||||
will automatically open and then launch the PWA app.
|
||||
On macOS, when using a Chrome-installed PWA, it is required that Chrome be open, otherwise Chrome will automatically open and then launch the PWA app.
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
@@ -63,7 +62,7 @@ Safari PWA requires macOS Ventura or later. The PWA installed by Safari does not
|
||||
</Steps>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
The default installed LobeChat PWA icon has a black background, you can use <kbd>cmd</kbd> + <kbd>i</kbd> to paste the following image to replace it with a white background.
|
||||
The default installed LobeChat PWA icon has a black background, you can use <kbd>cmd</kbd> + <kbd>i</kbd> to paste the following image to replace it with a white background.
|
||||
</Callout>
|
||||
|
||||
<Image
|
||||
|
||||
@@ -28,8 +28,7 @@ tags:
|
||||
## Chrome / Edge 浏览器上运行
|
||||
|
||||
<Callout type={'important'}>
|
||||
macOS 下,使用 Chrome 安装的 PWA 时,必须要求 Chrome 是打开状态,否则会自动打开 Chrome 再打开 PWA
|
||||
应用。
|
||||
macOS 下,使用 Chrome 安装的 PWA 时,必须要求 Chrome 是打开状态,否则会自动打开 Chrome 再打开 PWA 应用。
|
||||
</Callout>
|
||||
|
||||
<Steps>
|
||||
@@ -63,7 +62,7 @@ Safari PWA 需要 macOS Ventura 或更高版本。Safari 安装的 PWA 并不要
|
||||
</Steps>
|
||||
|
||||
<Callout type={'tip'}>
|
||||
默认安装的 LobeChat PWA 图标是黑色背景的,您可以在自行使用 <kbd>cmd</kbd> + <kbd>i</kbd> 粘贴如下图片替换为白色背景的。
|
||||
默认安装的 LobeChat PWA 图标是黑色背景的,您可以在自行使用 <kbd>cmd</kbd> + <kbd>i</kbd> 粘贴如下图片替换为白色背景的。
|
||||
</Callout>
|
||||
|
||||
<Image
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
title: Basic Usage Guide for Conversations - Large Language Models (LLMs)
|
||||
description: >-
|
||||
Learn about the fundamental functions for interacting with Large Language
|
||||
Models (LLMs) and how to utilize features like model selection, file/image
|
||||
upload, temperature setting, and more.
|
||||
tags:
|
||||
- Large Language Models
|
||||
- Model Selection
|
||||
- File Upload
|
||||
- Temperature Setting
|
||||
- Voice Input
|
||||
- Plugin Setting
|
||||
---
|
||||
|
||||
# Basic Usage Guide for Conversations
|
||||
|
||||
<Image
|
||||
alt={'Basic Functions'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/ca6baea8-d782-4611-8555-7c81078028db'}
|
||||
/>
|
||||
|
||||
In general, the basic interaction with Large Language Models (LLMs) can be done through the fundamental functions provided in this area (as shown above).
|
||||
|
||||
## Basic Function Description
|
||||
|
||||
<Image
|
||||
alt={'Basic Function Description'}
|
||||
src={'https://github.com/user-attachments/assets/de9f188e-8a3a-49a0-bec6-ab628cdda7e6'}
|
||||
/>
|
||||
|
||||
1. **Model Selection**: Choose the Large Language Model (LLM) to be used in the current conversation. For model settings, refer to [Model Providers](https://lobehub.com/docs/usage/providers).
|
||||
2. **File/Image Upload**: When the selected model supports file or image recognition, users can upload files or images during the conversation with the model.
|
||||
3. **Temperature Setting**: Adjust the randomness level of the model's output. The higher the value, the more random the output results. For detailed information, refer to the [Large Language Model Guide](https://lobehub.com/docs/usage/agents/model).
|
||||
4. **History Record Setting**: Set the number of chat records the model needs to remember in this conversation. The longer the history, the more conversation content the model can remember, but it will also consume more context tokens.
|
||||
5. **Voice Input**: Click this button to convert speech to text input. For more information, refer to [Speech-to-Text Conversion](https://lobehub.com/docs/usage/foundation/tts-stt).
|
||||
6. **Plugin Setting**: Choose the plugins to enable in this conversation. For more information, refer to [Plugin Usage](https://lobehub.com/docs/usage/plugins/basic-usage).
|
||||
7. **Token Usage**: Display the context length and token consumption of this conversation.
|
||||
8. **Start New Topic**: End the current conversation and start a new topic. For more information, refer to [Topic Usage](https://lobehub.com/docs/usage/agents/topics).
|
||||
9. **Send Button**: Send the current input content to the model. The dropdown menu provides additional send operation options.
|
||||
|
||||
<Image
|
||||
alt={'Send Button'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/0833184e-91df-4b8e-a88e-99a19c20b86a'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>
|
||||
- **Send Shortcut**: Set a shortcut to send messages and line breaks using the Enter key or ⌘ +
|
||||
Enter key. - **Add an AI Message**: Manually add and edit a message input by an AI character in
|
||||
the conversation context, which will not trigger a model response. - **Add a User Message**: Add
|
||||
the current input content as a message input by the user character to the conversation context,
|
||||
which will not trigger a model response.
|
||||
</Callout>
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
title: 会话基本使用指南 - 大型语言模型交互指南
|
||||
description: 了解如何使用大型语言模型进行基本交互,包括模型选择、文件/图片上传、温度设置、历史记录设置等。
|
||||
tags:
|
||||
- 大型语言模型
|
||||
- LLM
|
||||
- 模型选择
|
||||
- 文件上传
|
||||
- 温度设置
|
||||
- 历史记录设置
|
||||
- 语音输入
|
||||
- 插件设置
|
||||
- Token 用量
|
||||
- 新建话题
|
||||
- 发送按钮
|
||||
---
|
||||
|
||||
# 会话基本使用指南
|
||||
|
||||
<Image
|
||||
alt={'基本功能'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/ca6baea8-d782-4611-8555-7c81078028db'}
|
||||
/>
|
||||
|
||||
通常情况下,与大型语言模型 (LLMs) 的基本交互可以通过此区域(如上图)提供的基础功能进行。
|
||||
|
||||
## 基本功能说明
|
||||
|
||||
<Image
|
||||
alt={'基本功能说明'}
|
||||
src={'https://github.com/user-attachments/assets/de9f188e-8a3a-49a0-bec6-ab628cdda7e6'}
|
||||
/>
|
||||
|
||||
1. **模型选择**:选择当前对话所使用的大型语言模型 (LLM)。模型的设置详见[模型服务商](https://lobehub.com/docs/usage/providers)。
|
||||
2. **文件/图片上传**:当所选模型支持文件或图片识别功能时,用户可以在与模型的对话中上传文件或图片。
|
||||
3. **温度设置**:调节模型输出的随机性程度。数值越高,输出结果越随机。详细说明请参考[大语言模型指南](https://lobehub.com/docs/usage/agents/model)。
|
||||
4. **历史记录设置**:设定本次对话中模型需要记忆的聊天记录数量。历史记录越长,模型能够记忆的对话内容越多,但同时也会消耗更多的上下文 token。
|
||||
5. **语音输入**:点击该按钮后,可以将语音转换为文字输入。有关详细信息,请参考[语音文字转换](https://lobehub.com/docs/usage/foundation/tts-stt)。
|
||||
6. **插件设置**:选择本次对话中需要启用的插件。有关详细信息,请参考[插件使用](https://lobehub.com/docs/usage/plugins/basic-usage)。
|
||||
7. **Token 用量**:显示本次对话的上下文长度以及 Token 消耗情况。
|
||||
8. **新建话题**:结束当前对话并开启一个新的对话主题。有关详细信息,请参考[话题使用](https://lobehub.com/docs/usage/agents/topics)。
|
||||
9. **发送按钮**:将当前输入内容发送至模型。下拉菜单提供额外的发送操作选项。
|
||||
|
||||
<Image
|
||||
alt={'发送按钮'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/0833184e-91df-4b8e-a88e-99a19c20b86a'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>
|
||||
- **发送快捷键**:设置使用 Enter 键或 ⌘ + Enter 键发送消息和换行的快捷方式。 -
|
||||
**添加一条AI消息**:在对话上下文中手动添加并编辑一条由 AI 角色输入的消息,该操作不会触发模型响应。
|
||||
-
|
||||
**添加一条用户消息**:将当前输入内容作为用户角色输入的消息添加到对话上下文中,该操作不会触发模型响应。
|
||||
</Callout>
|
||||
@@ -1,46 +0,0 @@
|
||||
---
|
||||
title: Share Conversation Records - Screenshot Sharing & ShareGPT
|
||||
description: >-
|
||||
Learn how to share conversation records in LobeChat using Screenshot Sharing
|
||||
and ShareGPT methods. Capture conversation details in images or generate
|
||||
permanent links effortlessly.
|
||||
tags:
|
||||
- Share Conversation Records
|
||||
- Screenshot Sharing
|
||||
- ShareGPT
|
||||
- Conversation Sharing
|
||||
- AI Conversation Sharing
|
||||
---
|
||||
|
||||
# Share Conversation Records
|
||||
|
||||
<Image
|
||||
alt={'Share Conversation'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/00acc7d6-dc66-4998-b1c6-15238be4c3c8'}
|
||||
/>
|
||||
|
||||
By clicking the `Share` button in the top right corner of the chat window, you can share the current conversation records with others. LobeChat supports two sharing methods: `Screenshot Sharing` and `ShareGPT Sharing`.
|
||||
|
||||
## Screenshot Sharing
|
||||
|
||||
<Image
|
||||
alt={'Screenshot Sharing'}
|
||||
src={'https://github.com/user-attachments/assets/ccea7b00-6f92-4213-82ea-88789ef6f3b3'}
|
||||
/>
|
||||
|
||||
The screenshot sharing feature will generate and save an image of the current conversation records, with the following options:
|
||||
|
||||
- Include Assistant Role Settings: Display the assistant's Prompt information in the screenshot.
|
||||
- Include Background Image: Add a gradient background to the generated image.
|
||||
- Include Footer: Add LobeChat footer information to the generated image.
|
||||
- Image Format: Choose the format for saving the image.
|
||||
|
||||
## ShareGPT
|
||||
|
||||
<Image
|
||||
alt={'ShareGPT Sharing'}
|
||||
src={'https://github.com/user-attachments/assets/dea7c748-36e6-4f1b-aa21-acee2bf70d7d'}
|
||||
/>
|
||||
|
||||
[ShareGPT](https://sharegpt.com/) is an AI conversation sharing platform that allows users to easily share their conversations with Large Language Models (LLMs). Users can generate a permanent link with just one click, making it convenient to share these conversations with friends or others. By integrating ShareGPT functionality, LobeChat can generate links for conversation records with just one click, making sharing easy.
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
title: 分享会话记录 - LobeChat 分享功能介绍
|
||||
description: 了解如何通过 LobeChat 的分享功能分享会话记录,包括截图分享和 ShareGPT 分享方式。通过分享功能,轻松与他人分享您的对话。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 分享会话记录
|
||||
- 截图分享
|
||||
- ShareGPT
|
||||
- 对话分享
|
||||
---
|
||||
|
||||
# 分享会话记录
|
||||
|
||||
<Image
|
||||
alt={'分享会话'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/00acc7d6-dc66-4998-b1c6-15238be4c3c8'}
|
||||
/>
|
||||
|
||||
通过会话窗口右上角的`分享`按钮,您可以将当前会话记录分享给其他人。LobeChat 支持两种分享方式:`截图分享`和 `ShareGPT 分享`。
|
||||
|
||||
## 截图分享
|
||||
|
||||
<Image
|
||||
alt={'截图分享'}
|
||||
src={'https://github.com/user-attachments/assets/ccea7b00-6f92-4213-82ea-88789ef6f3b3'}
|
||||
/>
|
||||
|
||||
截图分享功能将生成当前会话记录的图片并保存,其选项说明如下:
|
||||
|
||||
- 包含助手角色设置:在截图中显示助手的 Prompt 信息。
|
||||
- 包含背景图:在生成的图片中添加渐变背景。
|
||||
- 包含页脚:在生成的图片中添加 LobeChat 页脚信息。
|
||||
- 图片格式:选择保存图片的格式。
|
||||
|
||||
## ShareGPT
|
||||
|
||||
<Image
|
||||
alt={'ShareGPT 分享'}
|
||||
src={'https://github.com/user-attachments/assets/dea7c748-36e6-4f1b-aa21-acee2bf70d7d'}
|
||||
/>
|
||||
|
||||
[ShareGPT](https://sharegpt.com/) 是一个 AI 对话分享平台,允许用户便捷地分享他们与大型语言模型 (LLM) 的对话。用户只需点击即可生成永久链接,方便与朋友或其他人分享这些对话。LobeChat 通过集成 ShareGPT 功能,可以一键将对话记录生成链接,方便分享。
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: Guide to Using Text-to-Image Models in LobeChat
|
||||
description: >-
|
||||
Learn how to utilize text-to-image generation in LobeChat using DALL-E and
|
||||
Midjourney plugins. Generate images seamlessly with AI assistance.
|
||||
tags:
|
||||
- Text-to-Image Models
|
||||
- LobeChat
|
||||
- DALL-E
|
||||
- Midjourney
|
||||
- Plugin Installation
|
||||
- AI Assistance
|
||||
---
|
||||
|
||||
# Guide to Using Text-to-Image Models in LobeChat
|
||||
|
||||
LobeChat supports text-to-image generation through a plugin mechanism. Currently, LobeChat comes with the built-in DALL-E plugin, which allows users to generate images using OpenAI's DALL-E model. Additionally, users can also install the official Midjourney plugin to utilize the Midjourney text-to-image feature.
|
||||
|
||||
## DALL-E Model
|
||||
|
||||
If you have configured the OpenAI API, you can enable the DALL-E plugin directly in the assistant interface and input prompts in the conversation for AI to generate images for you.
|
||||
|
||||
<Image
|
||||
alt={'DALL-E Plugin'}
|
||||
src={'https://github.com/user-attachments/assets/7b11b795-4dd3-4020-a9ba-a3723d5f1f28'}
|
||||
/>
|
||||
|
||||
If the DALL-E plugin is not available, please check if the OpenAI API key has been correctly configured.
|
||||
|
||||
## Midjourney Model
|
||||
|
||||
LobeChat also offers the Midjourney plugin, which generates images by calling the Midjourney API. Please install the Midjourney plugin in the plugin store beforehand.
|
||||
|
||||
<Image
|
||||
alt={'Midjourney Plugin'}
|
||||
src={'https://github.com/user-attachments/assets/5f526846-02cd-4dbc-b6e3-a603fa5ac8e7'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>
|
||||
info For plugin installation, please refer to [Plugin
|
||||
Usage](https://lobehub.com/docs/usage/plugins/basic-usage)
|
||||
</Callout>
|
||||
|
||||
When using the Midjourney plugin for the first time, you will need to fill in your Midjourney API key in the plugin settings.
|
||||
|
||||
<Image
|
||||
alt={'Midjourney Plugin Settings'}
|
||||
src={'https://github.com/user-attachments/assets/a5d7a543-aec5-457e-a36c-aa1f82f7bc8a'}
|
||||
/>
|
||||
@@ -1,46 +0,0 @@
|
||||
---
|
||||
title: LobeChat 文生图模型使用指南
|
||||
description: 了解如何在 LobeChat 中使用 DALL-E 和 Midjourney 模型生成图片,配置插件并调用 API。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 文生图模型
|
||||
- DALL-E
|
||||
- Midjourney
|
||||
- 插件
|
||||
- API
|
||||
---
|
||||
|
||||
# 文生图模型使用指南
|
||||
|
||||
LobeChat 通过插件机制支持文本生成图片功能。目前,LobeChat 内置了 DALL-E 插件,支持调用 OpenAI 的 DALL-E 模型进行图片生成。此外,用户还可以安装官方提供的 Midjourney 插件,使用 Midjourney 文生图功能。
|
||||
|
||||
## DALL-E 模型
|
||||
|
||||
如果您已配置 OpenAI API,可以直接在助手界面启用 DALL-E 插件,并在对话中输入提示词,让 AI 为您生成图片。
|
||||
|
||||
<Image
|
||||
alt={'DALL-E 插件'}
|
||||
src={'https://github.com/user-attachments/assets/7b11b795-4dd3-4020-a9ba-a3723d5f1f28'}
|
||||
/>
|
||||
|
||||
如果 DALL-E 插件不可用,请检查 OpenAI API 密钥是否已正确配置。
|
||||
|
||||
## Midjourney 模型
|
||||
|
||||
LobeChat 还提供 Midjourney 插件,通过 API 调用 Midjourney 生成图片。请提前在插件商店中安装 Midjourney 插件。
|
||||
|
||||
<Image
|
||||
alt={'Midjourney 插件'}
|
||||
src={'https://github.com/user-attachments/assets/5f526846-02cd-4dbc-b6e3-a603fa5ac8e7'}
|
||||
/>
|
||||
|
||||
<Callout type={'info'}>
|
||||
插件安装请参考[插件使用](https://lobehub.com/docs/usage/plugins/basic-usage)
|
||||
</Callout>
|
||||
|
||||
首次使用 Midjourney 插件时,您需要在插件设置中填写您的 Midjourney API 密钥。
|
||||
|
||||
<Image
|
||||
alt={'Midjourney 插件设置'}
|
||||
src={'https://github.com/user-attachments/assets/a5d7a543-aec5-457e-a36c-aa1f82f7bc8a'}
|
||||
/>
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
title: Translation of Conversation Records - LobeChat
|
||||
description: >-
|
||||
Learn how to translate conversation content in LobeChat with just one click.
|
||||
Customize translation models for accurate results.
|
||||
tags:
|
||||
- Translation
|
||||
- Conversation Translation
|
||||
- AI Translation Model
|
||||
---
|
||||
|
||||
# Translation of Conversation Records
|
||||
|
||||
<Image
|
||||
alt={'Translation'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/55230f32-b8dd-47db-a2ba-b3fe7e533dc8'}
|
||||
/>
|
||||
|
||||
## Translating Conversation Content
|
||||
|
||||
LobeChat supports users to translate conversation content into a specified language with just one click. After selecting the target language, LobeChat will use a pre-set AI model for translation and display the translated results in real-time in the chat window.
|
||||
|
||||
<Image
|
||||
alt={'Displaying Conversation Translation Results'}
|
||||
src={'https://github.com/user-attachments/assets/868df2eb-0c44-4419-a76a-e173094e1e17'}
|
||||
/>
|
||||
|
||||
## Translation Model Settings
|
||||
|
||||
You can specify the model you wish to use as a translation assistant in the settings.
|
||||
|
||||
<Image
|
||||
alt={'Setting Translation Model'}
|
||||
src={'https://github.com/user-attachments/assets/530c7c96-bac3-456d-a429-f60e7d2ade66'}
|
||||
/>
|
||||
|
||||
- Open the `Settings` panel
|
||||
- Find the `Translation Settings` option under `System Assistants`
|
||||
- Specify a model for your `Translation Assistant`
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
title: LobeChat 会话翻译功能 - 一键实时翻译对话内容
|
||||
description: LobeChat 支持用户一键将对话内容翻译成指定语言,实时显示翻译结果。了解如何设置翻译模型以优化翻译体验。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 会话翻译
|
||||
- 实时翻译
|
||||
- 翻译模型设置
|
||||
---
|
||||
|
||||
# 翻译会话记录
|
||||
|
||||
<Image
|
||||
alt={'翻译会话'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/55230f32-b8dd-47db-a2ba-b3fe7e533dc8'}
|
||||
/>
|
||||
|
||||
## 翻译对话中的内容
|
||||
|
||||
LobeChat 支持用户一键将对话内容翻译成指定语言。选择目标语言后,LobeChat 将调用预先设置的 AI 模型进行翻译,并将翻译结果实时显示在聊天窗口中。
|
||||
|
||||
<Image
|
||||
alt={'显示会话翻译结果'}
|
||||
src={'https://github.com/user-attachments/assets/868df2eb-0c44-4419-a76a-e173094e1e17'}
|
||||
/>
|
||||
|
||||
## 翻译模型设置
|
||||
|
||||
你可以在设置中指定您希望使用的模型作为翻译助手。
|
||||
|
||||
<Image
|
||||
alt={'设置翻译模型'}
|
||||
src={'https://github.com/user-attachments/assets/530c7c96-bac3-456d-a429-f60e7d2ade66'}
|
||||
/>
|
||||
|
||||
- 打开`设置`面板
|
||||
- 在`系统助手`中找到`翻译设置`选项
|
||||
- 为你的`翻译助手`指定一个模型
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
title: Guide to Text-to-Speech Conversion - LobeChat TTS Feature
|
||||
description: >-
|
||||
Learn how to use LobeChat's text-to-speech (TTS) feature for voice input and
|
||||
output. Explore speech-to-text (STT) functionality and customize TTS settings.
|
||||
tags:
|
||||
- Text-to-Speech
|
||||
- TTS feature
|
||||
- Speech-to-Text
|
||||
- STT feature
|
||||
- TTS settings
|
||||
---
|
||||
|
||||
# Guide to Text-to-Speech Conversion
|
||||
|
||||
LobeChat supports text-to-speech conversion, allowing users to input content through voice and have the AI output read aloud through speech.
|
||||
|
||||
## Text-to-Speech (TTS)
|
||||
|
||||
Select any content in the chat window, choose `Text-to-Speech`, and the AI will use the TTS model to read the text content aloud.
|
||||
|
||||
<Image
|
||||
alt={'TTS'}
|
||||
src={'https://github.com/user-attachments/assets/d2714769-15f8-4d70-9128-607134163c52'}
|
||||
/>
|
||||
|
||||
## Speech-to-Text (STT)
|
||||
|
||||
Select the voice input feature in the input window, and LobeChat will convert your speech to text and input it into the text box. After completing the input, you can send it directly to the AI.
|
||||
|
||||
<Image
|
||||
alt={'STT'}
|
||||
src={'https://github.com/user-attachments/assets/d643af6d-ca0f-4abd-9dd2-977dacecb25d'}
|
||||
/>
|
||||
|
||||
## Text-to-Speech Conversion Settings
|
||||
|
||||
You can specify the model you want to use for text-to-speech conversion in the settings.
|
||||
|
||||
<Image
|
||||
alt={'TTS Settings'}
|
||||
src={'https://github.com/user-attachments/assets/2f7c5c45-ec6a-4393-8fa9-19a4c5f52f7a'}
|
||||
/>
|
||||
|
||||
- Open the `Settings` panel
|
||||
- Find the `Text-to-Speech` settings
|
||||
- Select the speech service and AI model you prefer
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: LobeChat 文字语音转换功能指南
|
||||
description: 了解如何在 LobeChat 中使用文字语音转换功能,包括文字转语音(TTS)和语音转文字(STT),以及设置您喜欢的语音模型。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 文字语音转换
|
||||
- TTS
|
||||
- STT
|
||||
- 语音模型
|
||||
---
|
||||
|
||||
# 文字语音转换使用指南
|
||||
|
||||
LobeChat 支持文字语音转换功能,允许用户通过语音输入内容,以及将 AI 输出的内容通过语音播报。
|
||||
|
||||
## 文字转语音(TTS)
|
||||
|
||||
在对话窗口中选中任意内容,选择`文字转语音`,AI 将通过 TTS 模型对文本内容进行语音播报。
|
||||
|
||||
<Image
|
||||
alt={'TTS'}
|
||||
src={'https://github.com/user-attachments/assets/d2714769-15f8-4d70-9128-607134163c52'}
|
||||
/>
|
||||
|
||||
## 语音转文字(STT)
|
||||
|
||||
在输入窗口中选择语音输入功能,LobeChat 将您的语音转换为文字并输入到文本框中,完成输入后可以直接发送给 AI。
|
||||
|
||||
<Image
|
||||
alt={'STT'}
|
||||
src={'https://github.com/user-attachments/assets/d643af6d-ca0f-4abd-9dd2-977dacecb25d'}
|
||||
/>
|
||||
|
||||
## 文字语音转换设置
|
||||
|
||||
你可以在设置中为文字语音转换功能指定您希望使用的模型。
|
||||
|
||||
<Image
|
||||
alt={'TTS 设置'}
|
||||
src={'https://github.com/user-attachments/assets/2f7c5c45-ec6a-4393-8fa9-19a4c5f52f7a'}
|
||||
/>
|
||||
|
||||
- 打开`设置`面板
|
||||
- 找到`文字转语音`设置
|
||||
- 选择您所需的语音服务和 AI 模型
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: Enhancing Multimodal Interaction with Visual Recognition Models
|
||||
description: >-
|
||||
Explore how LobeChat integrates visual recognition capabilities into large
|
||||
language models, enabling multimodal interactions for enhanced user
|
||||
experiences.
|
||||
tags:
|
||||
- Visual Recognition
|
||||
- Multimodal Interaction
|
||||
- Large Language Models
|
||||
- LobeChat
|
||||
- Custom Model Configuration
|
||||
---
|
||||
|
||||
# Visual Model User Guide
|
||||
|
||||
The ecosystem of large language models that support visual recognition is becoming increasingly rich. Starting from `gpt-4-vision`, LobeChat now supports various large language models with visual recognition capabilities, enabling LobeChat to have multimodal interaction capabilities.
|
||||
|
||||
<Video
|
||||
alt={'Visual Model Usage'}
|
||||
src={'https://github.com/user-attachments/assets/1c6b4975-bfc3-4470-a934-558ff7a16941'}
|
||||
/>
|
||||
|
||||
## Image Input
|
||||
|
||||
If the model you are currently using supports visual recognition, you can input image content by uploading a file or dragging the image directly into the input box. The model will automatically recognize the image content and provide feedback based on your prompts.
|
||||
|
||||
<Image
|
||||
alt={'Image Input'}
|
||||
src={'https://github.com/user-attachments/assets/e6836560-8b05-4382-b761-d7624da4b0f1'}
|
||||
/>
|
||||
|
||||
## Visual Models
|
||||
|
||||
In the model list, models with a `👁️` icon next to their names indicate that the model supports visual recognition. Selecting such a model allows you to send image content.
|
||||
|
||||
<Image
|
||||
alt={'Visual Models'}
|
||||
src={'https://github.com/user-attachments/assets/fa07a326-04c8-4744-bb93-cef715d1d71f'}
|
||||
/>
|
||||
|
||||
## Custom Model Configuration
|
||||
|
||||
If you need to add a custom model that is not currently in the list and explicitly supports visual recognition, you can enable the `Visual Recognition` feature in the `Custom Model Configuration` to allow the model to interact with images.
|
||||
|
||||
<Image
|
||||
alt={'Custom Model Configuration'}
|
||||
src={'https://github.com/user-attachments/assets/c24718cc-402b-4298-b046-8b4aee610cbc'}
|
||||
/>
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
title: 视觉模型使用指南 - 支持多模态交互的大语言模型
|
||||
description: "了解如何在LobeChat中使用支持视觉识别功能的大语言模型,通过上传图片或拖拽图片到输入框进行交互,并选择带有\U0001F441️图标的模型进行图片内容交互。"
|
||||
tags:
|
||||
- 视觉模型
|
||||
- 多模态交互
|
||||
- 大语言模型
|
||||
- 自定义模型配置
|
||||
---
|
||||
|
||||
# 视觉模型使用指南
|
||||
|
||||
当前支持视觉识别的大语言模型生态日益丰富。从 `gpt-4-vision` 开始,LobeChat 开始支持各类具有视觉识别能力的大语言模型,这使得 LobeChat 具备了多模态交互的能力。
|
||||
|
||||
<Video
|
||||
alt={'视觉模型使用'}
|
||||
src={'https://github.com/user-attachments/assets/1c6b4975-bfc3-4470-a934-558ff7a16941'}
|
||||
/>
|
||||
|
||||
## 图片输入
|
||||
|
||||
如果你当前使用的模型支持视觉识别功能,您可以通过上传文件或直接将图片拖入输入框的方式输入图片内容。模型会自动识别图片内容,并根据您的提示词给出反馈。
|
||||
|
||||
<Image
|
||||
alt={'图片输入'}
|
||||
src={'https://github.com/user-attachments/assets/e6836560-8b05-4382-b761-d7624da4b0f1'}
|
||||
/>
|
||||
|
||||
## 视觉模型
|
||||
|
||||
在模型列表中,模型名称后面带有`👁️`图标表示该模型支持视觉识别功能。选择该模型后即可发送图片内容。
|
||||
|
||||
<Image
|
||||
alt={'视觉模型'}
|
||||
src={'https://github.com/user-attachments/assets/fa07a326-04c8-4744-bb93-cef715d1d71f'}
|
||||
/>
|
||||
|
||||
## 自定义模型配置
|
||||
|
||||
如果您需要添加当前列表中没有的自定义模型,并且该模型明确支持视觉识别功能,您可以在`自定义模型配置`中开启`视觉识别`功能,使该模型能够与图片进行交互。
|
||||
|
||||
<Image
|
||||
alt={'自定义模型配置'}
|
||||
src={'https://github.com/user-attachments/assets/c24718cc-402b-4298-b046-8b4aee610cbc'}
|
||||
/>
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
title: Enhancing LobeChat with Multiple Model Providers for AI Conversations
|
||||
description: >-
|
||||
Discover how LobeChat offers diverse AI conversation options by supporting
|
||||
multiple model providers, providing flexibility and a wide range of choices
|
||||
for users and developers.
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI Conversations
|
||||
- Model Providers
|
||||
- Diversity
|
||||
- Flexibility
|
||||
- Google AI
|
||||
- ChatGLM
|
||||
- Moonshot AI
|
||||
- 01 AI
|
||||
- Together AI
|
||||
- Ollama
|
||||
---
|
||||
|
||||
# Using Multiple Model Providers in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Multiple Model Providers Support'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1148639c-2687-4a9c-9950-8ca8672f34b6'}
|
||||
/>
|
||||
|
||||
In the continuous development of LobeChat, we deeply understand the importance of diversity in model providers for providing AI conversation services to meet the needs of the community. Therefore, we have expanded our support to multiple model providers instead of being limited to a single one, in order to offer users a more diverse and rich selection of conversation options.
|
||||
|
||||
This approach allows LobeChat to adapt more flexibly to different user needs and provides developers with a wider range of choices.
|
||||
|
||||
## Tutorial on Using Model Providers
|
||||
|
||||
<ProviderCards locale={'en'} />
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用多模型服务商
|
||||
description: 了解 LobeChat 在多模型服务商支持方面的最新进展,包括已支持的模型服务商和计划中的扩展,以及本地模型支持的使用方式。
|
||||
tags:
|
||||
- LobeChat
|
||||
- AI 会话服务
|
||||
- 模型服务商
|
||||
- 多模型支持
|
||||
- 本地模型支持
|
||||
- AWS Bedrock
|
||||
- Google AI
|
||||
- ChatGLM
|
||||
- Moonshot AI
|
||||
- 01 AI
|
||||
- Together AI
|
||||
- Ollama
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用多模型服务商
|
||||
|
||||
<Image
|
||||
alt={'多模型服务商支持'}
|
||||
borderless
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/1148639c-2687-4a9c-9950-8ca8672f34b6'}
|
||||
/>
|
||||
|
||||
在 LobeChat 的不断发展过程中,我们深刻理解到在提供 AI 会话服务时模型服务商的多样性对于满足社区需求的重要性。因此,我们不再局限于单一的模型服务商,而是拓展了对多种模型服务商的支持,以便为用户提供更为丰富和多样化的会话选择。
|
||||
|
||||
通过这种方式,LobeChat 能够更灵活地适应不同用户的需求,同时也为开发者提供了更为广泛的选择空间。
|
||||
|
||||
## 模型服务商使用教程
|
||||
|
||||
<ProviderCards locale={'zh'} />
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
title: Using Zero One AI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate and use Zero One AI in LobeChat with step-by-step
|
||||
instructions. Obtain an API key, configure Zero One AI, and start
|
||||
conversations with AI models.
|
||||
tags:
|
||||
- 01.AI
|
||||
- Zero One AI
|
||||
- Web UI
|
||||
- API key
|
||||
- AI models
|
||||
---
|
||||
|
||||
# Using Zero One AI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Zero One AI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4485fbc3-c309-4c4e-83ee-cb82392307a1'}
|
||||
/>
|
||||
|
||||
[Zero One AI](https://www.01.ai/) is a global company dedicated to AI 2.0 large model technology and applications. Its billion-parameter Yi-Large closed-source model, when evaluated on Stanford University's English ranking AlpacaEval 2.0, is on par with GPT-4.
|
||||
|
||||
This document will guide you on how to use Zero One AI in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Zero One AI API Key
|
||||
|
||||
- Register and log in to the [Zero One AI Large Model Open Platform](https://platform.lingyiwanwu.com/)
|
||||
- Go to the `Dashboard` and access the `API Key Management` menu
|
||||
- A system-generated API key has been created for you automatically, or you can create a new one on this interface
|
||||
|
||||
<Image
|
||||
alt={'Create Zero One AI API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/72f165f4-d529-4f01-a3ac-163c66e5ea73'}
|
||||
/>
|
||||
|
||||
- Account verification is required for first-time use
|
||||
|
||||
<Image
|
||||
alt={'Complete Account Verification'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/e6058456-8f9d-40c1-9ae5-1e9d5eeb9476'}
|
||||
/>
|
||||
|
||||
- Click on the created API key
|
||||
- Copy and save the API key in the pop-up dialog box
|
||||
|
||||
<Image
|
||||
alt={'Save API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f892fe64-c734-4944-91ff-9916a41bd1c9'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Zero One AI in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat
|
||||
- Find the setting for `Zero One AI` under `Language Model`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f539d104-6d64-4cc7-8781-3b36b00d32d0'}
|
||||
/>
|
||||
|
||||
- Open Zero One AI and enter the obtained API key
|
||||
- Choose a 01.AI model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select 01.AI Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/8bf73498-4649-4c4d-a95b-b68447599781'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Zero One AI's relevant
|
||||
fee policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now use the models provided by Zero One AI for conversations in LobeChat.
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 01.AI 零一万物 API Key
|
||||
description: >-
|
||||
学习如何在 LobeChat 中配置并使用 01.AI 零一万物提供的 AI 模型进行对话。获取 API 密钥、填入设置项、选择模型,开始与 AI
|
||||
助手交流。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 01.AI
|
||||
- Zero One AI
|
||||
- 零一万物
|
||||
- Web UI
|
||||
- API密钥
|
||||
- 配置指南
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用零一万物
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用零一万物'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/4485fbc3-c309-4c4e-83ee-cb82392307a1'}
|
||||
/>
|
||||
|
||||
[零一万物](https://www.01.ai/)是一家致力于AI 2.0大模型技术和应用的全球公司,其发布的千亿参数的Yi-Large闭源模型,在斯坦福大学的英语排行AlpacaEval 2.0上,与GPT-4互有第一。
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用零一万物:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取零一万物 API 密钥
|
||||
|
||||
- 注册并登录 [零一万物大模型开放平台](https://platform.lingyiwanwu.com/)
|
||||
- 进入`工作台`并访问`API Key管理`菜单
|
||||
- 系统已为你自动创建了一个 API 密钥,你也可以在此界面创建新的 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'创建零一万物 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/72f165f4-d529-4f01-a3ac-163c66e5ea73'}
|
||||
/>
|
||||
|
||||
- 初次使用时需要完成账号认证
|
||||
|
||||
<Image
|
||||
alt={'完成账号认证'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/e6058456-8f9d-40c1-9ae5-1e9d5eeb9476'}
|
||||
/>
|
||||
|
||||
- 点击创建好的 API 密钥
|
||||
- 在弹出的对话框中复制并保存 API 密钥
|
||||
|
||||
<Image
|
||||
alt={'保存 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f892fe64-c734-4944-91ff-9916a41bd1c9'}
|
||||
/>
|
||||
|
||||
### 步骤二:在LobeChat 中配置零一万物
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`零一万物`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/f539d104-6d64-4cc7-8781-3b36b00d32d0'}
|
||||
/>
|
||||
|
||||
- 打开零一万物并填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 01.AI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择01.AI模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/34400653/8bf73498-4649-4c4d-a95b-b68447599781'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考零一万物的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用零一万物提供的模型进行对话了。
|
||||
@@ -1,78 +0,0 @@
|
||||
---
|
||||
title: Using Anthropic Claude API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Anthropic Claude API in LobeChat to enhance your AI
|
||||
assistant capabilities. Support Claude 3.5 sonnet / Claude 3 Opus / Claude 3
|
||||
haiku
|
||||
tags:
|
||||
- Anthropic Claude
|
||||
- API Key
|
||||
- AI assistant
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using Anthropic Claude in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Anthropic Claude in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/620b956b-dcb2-442a-8bb1-9aa22681dfa4'}
|
||||
/>
|
||||
|
||||
The Anthropic Claude API is now available for everyone to use. This document will guide you on how to use [Anthropic Claude](https://www.anthropic.com/api) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Anthropic Claude API Key
|
||||
|
||||
- Create an [Anthropic Claude API](https://www.anthropic.com/api) account.
|
||||
- Get your [API key](https://console.anthropic.com/settings/keys).
|
||||
|
||||
<Image
|
||||
alt={'Create API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/15e09e71-5899-4805-9c5e-1f7c57be04ae'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
The Claude API currently offers $5 of free credits, but it is only available in certain specific
|
||||
countries/regions. You can go to Dashboard > Claim to see if it is applicable to your
|
||||
country/region.
|
||||
</Callout>
|
||||
|
||||
- Set up your billing for the API key to work on [https://console.anthropic.com/settings/plans](https://console.anthropic.com/settings/plans) (choose the "Build" plan so you can add credits and only pay for usage).
|
||||
|
||||
<Image
|
||||
alt={'Set Up Your Billing'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/385f663f-cae2-4383-9bb0-52c45e5d7d7a'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Anthropic Claude in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat.
|
||||
- Find the setting for `Anthropic Claude` under `Language Models`.
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff9c3eb8-412b-4275-80be-177ae7b7acbc'}
|
||||
/>
|
||||
|
||||
- Enter the obtained API key.
|
||||
- Choose an Anthropic Claude model for your AI assistant to start the conversation.
|
||||
|
||||
<Image
|
||||
alt={'Select Anthropic Claude Model and Start Conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/6cdc5c0e-0508-44ed-a283-03f6b538ed8a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Anthropic Claude's
|
||||
relevant pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now engage in conversations using the models provided by Anthropic Claude in LobeChat.
|
||||
@@ -1,75 +0,0 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Anthropic Claude API Key
|
||||
description: >-
|
||||
学习如何在 LobeChat 中配置和使用 Anthropic Claude API, Claude 3.5 sonnet / Claude 3 Opus
|
||||
/ Claude 3 haiku
|
||||
tags:
|
||||
- Anthropic Claude
|
||||
- API
|
||||
- WebUI
|
||||
- AI助手
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Anthropic Claude
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Anthropic Claude'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/620b956b-dcb2-442a-8bb1-9aa22681dfa4'}
|
||||
/>
|
||||
|
||||
Anthropic Claude API 现在可供所有人使用, 本文档将指导你如何在 LobeChat 中使用 [Anthropic Claude](https://www.anthropic.com/api):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Anthropic Claude API 密钥
|
||||
|
||||
- 创建一个 [Anthropic Claude API](https://www.anthropic.com/api) 帐户
|
||||
- 获取您的 [API 密钥](https://console.anthropic.com/settings/keys)
|
||||
|
||||
<Image
|
||||
alt={'创建 API Key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/15e09e71-5899-4805-9c5e-1f7c57be04ae'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
Claude API 现在提供 5 美元的免费积分,但是,它仅适用于某些特定国家/地区,您可以转到 Dashboard >
|
||||
Claim 查看它是否适用于您所在的国家/地区。
|
||||
</Callout>
|
||||
|
||||
- 设置您的账单,让 API 密钥在 https://console.anthropic.com/settings/plans 上工作(选择“生成”计划,以便您可以添加积分并仅为使用量付费)
|
||||
|
||||
<Image
|
||||
alt={'设置您的账单'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/385f663f-cae2-4383-9bb0-52c45e5d7d7a'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Anthropic Claude
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Anthropic Claude`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ff9c3eb8-412b-4275-80be-177ae7b7acbc'}
|
||||
/>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Anthropic Claude 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Anthropic Claude 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/6cdc5c0e-0508-44ed-a283-03f6b538ed8a'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Anthropic Claude 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Anthropic Claude 提供的模型进行对话了。
|
||||
@@ -1,88 +0,0 @@
|
||||
---
|
||||
title: Using Azure OpenAI API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate and configure Azure OpenAI in LobeChat to enhance your
|
||||
AI assistant capabilities. Follow these steps to obtain the API key, configure
|
||||
the settings, and start engaging in conversations.
|
||||
tags:
|
||||
- Azure OpenAI
|
||||
- AI assistant
|
||||
- API key
|
||||
- Configuration
|
||||
- Conversation models
|
||||
---
|
||||
|
||||
# Using Azure OpenAI in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Azure OpenAI in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/5efa34c2-6523-43e6-9ade-70ab5d802e13'}
|
||||
/>
|
||||
|
||||
This document will guide you on how to use [Azure OpenAI](https://oai.azure.com/) in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Azure OpenAI API Key
|
||||
|
||||
- If you haven't registered yet, you need to create an [Azure OpenAI account](https://oai.azure.com/).
|
||||
|
||||
<Image
|
||||
alt={'Create an Azure OpenAI account'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a77b0fb2-87d7-4527-a804-2f7ad3634aa5'}
|
||||
/>
|
||||
|
||||
- After registration, go to the `Deployments` page and create a new deployment with your selected model.
|
||||
|
||||

|
||||
|
||||
<Image
|
||||
alt={'Create a new deployment with your selected model'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4fae3e6f-e680-4471-93c4-987c19d7170a'}
|
||||
/>
|
||||
|
||||
- Navigate to the `Chat` page and click on `View Code` to obtain your endpoint and key.
|
||||
|
||||
<Image
|
||||
alt={'Go to the Chat page'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ac10d9dd-a977-43fb-8397-b2bbdee6a1a1'}
|
||||
/>
|
||||
|
||||
<Image
|
||||
alt={'Get the endpoint and key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ab94a7b5-6bc4-41e0-97bc-724ee8e315db'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Azure OpenAI in LobeChat
|
||||
|
||||
- Access the `Settings` interface in LobeChat.
|
||||
- Find the setting for `Azure OpenAI` under `Language Model`.
|
||||
|
||||
<Image
|
||||
alt={'Enter the API key'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/63d9f6d4-5b78-4c65-8cd1-ff8b7f143406'}
|
||||
/>
|
||||
|
||||
- Enter the API key you obtained.
|
||||
- Choose an Azure OpenAI model for your AI assistant to start the conversation.
|
||||
|
||||
<Image
|
||||
alt={'Select Azure OpenAI model and start the conversation'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ddb44517-8696-4492-acd9-25b590f6069c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider. Please refer to Azure OpenAI's
|
||||
relevant pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
Now you can engage in conversations using the models provided by Azure OpenAI in LobeChat.
|
||||
@@ -1,79 +0,0 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用 Azure OpenAI API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用 Azure OpenAI 模型进行对话,包括获取 API 密钥和选择模型。
|
||||
tags:
|
||||
- Azure OpenAI
|
||||
- API Key
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用 Azure OpenAI
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用 Azure OpenAI'}
|
||||
cover
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/5efa34c2-6523-43e6-9ade-70ab5d802e13'}
|
||||
/>
|
||||
|
||||
本文档将指导你如何在 LobeChat 中使用 [Azure OpenAI](https://oai.azure.com/):
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取 Azure OpenAI API 密钥
|
||||
|
||||
- 如果尚未注册,则必须注册 [Azure OpenAI 帐户](https://oai.azure.com/)。
|
||||
|
||||
<Image
|
||||
alt={'注册 Azure OpenAI 帐户'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/a77b0fb2-87d7-4527-a804-2f7ad3634aa5'}
|
||||
/>
|
||||
|
||||
- 注册完毕后,转到 `Deployments` 页面,然后使用您选择的模型创建新部署。
|
||||
|
||||
<Image
|
||||
alt={'选择的模型创建新部署'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/4fae3e6f-e680-4471-93c4-987c19d7170a'}
|
||||
/>
|
||||
|
||||
- 转到 `Chat` 页面,然后单击 `View Code` 以获取您的终结点和密钥。
|
||||
|
||||
<Image
|
||||
alt={'转到 Chat 页面'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ac10d9dd-a977-43fb-8397-b2bbdee6a1a1'}
|
||||
/>
|
||||
<Image
|
||||
alt={'获取终结点和密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ab94a7b5-6bc4-41e0-97bc-724ee8e315db'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置 Azure OpenAI
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`Azure OpenAI`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/63d9f6d4-5b78-4c65-8cd1-ff8b7f143406'}
|
||||
/>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个 Azure OpenAI 的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择 Azure OpenAI 模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/lobehub/lobe-chat/assets/17870709/ddb44517-8696-4492-acd9-25b590f6069c'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考 Azure OpenAI 的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用 Azure OpenAI 提供的模型进行对话了。
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
title: Using Baichuan API Key in LobeChat
|
||||
description: >-
|
||||
Learn how to integrate Baichuan AI into LobeChat for enhanced conversational
|
||||
experiences. Follow the steps to configure Baichuan AI and start using its
|
||||
models.
|
||||
tags:
|
||||
- LobeChat
|
||||
- Baichuan
|
||||
- API Key
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# Using Baichuan in LobeChat
|
||||
|
||||
<Image
|
||||
alt={'Using Baichuan in LobeChat'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/d961f2af-47b0-4806-8288-b1e8f7ee8a47'}
|
||||
/>
|
||||
|
||||
This article will guide you on how to use Baichuan in LobeChat:
|
||||
|
||||
<Steps>
|
||||
|
||||
### Step 1: Obtain Baichuan Intelligent API Key
|
||||
|
||||
- Create a [Baichuan Intelligent](https://platform.baichuan-ai.com/homePage) account
|
||||
- Create and obtain an [API key](https://platform.baichuan-ai.com/console/apikey)
|
||||
|
||||
<Image
|
||||
alt={'Create API Key'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/8787716c-833e-44ab-b506-922ddb6121de'}
|
||||
/>
|
||||
|
||||
### Step 2: Configure Baichuan in LobeChat
|
||||
|
||||
- Visit the `Settings` interface in LobeChat
|
||||
- Find the setting for `Baichuan` under `Language Model`
|
||||
|
||||
<Image
|
||||
alt={'Enter API Key'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/dec6665a-b3ec-4c50-a57f-7c7eb3160e7b'}
|
||||
/>
|
||||
|
||||
- Enter the obtained API key
|
||||
- Choose a Baichuan model for your AI assistant to start the conversation
|
||||
|
||||
<Image
|
||||
alt={'Select Baichuan model and start conversation'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/bfda556a-d3fc-409f-8647-e718788f2fb8'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
During usage, you may need to pay the API service provider, please refer to Baichuan's relevant
|
||||
pricing policies.
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
You can now use the models provided by Baichuan for conversation in LobeChat.
|
||||
@@ -1,61 +0,0 @@
|
||||
---
|
||||
title: 在 LobeChat 中使用百川 API Key
|
||||
description: 学习如何在 LobeChat 中配置和使用百川的API Key,以便开始对话和交互。
|
||||
tags:
|
||||
- LobeChat
|
||||
- 百川
|
||||
- 百川智能
|
||||
- API密钥
|
||||
- Web UI
|
||||
---
|
||||
|
||||
# 在 LobeChat 中使用百川
|
||||
|
||||
<Image
|
||||
alt={'在 LobeChat 中使用百川'}
|
||||
cover
|
||||
src={'https://github.com/user-attachments/assets/d961f2af-47b0-4806-8288-b1e8f7ee8a47'}
|
||||
/>
|
||||
|
||||
本文将指导你如何在 LobeChat 中使用百川:
|
||||
|
||||
<Steps>
|
||||
|
||||
### 步骤一:获取百川智能 API 密钥
|
||||
|
||||
- 创建一个[百川智能](https://platform.baichuan-ai.com/homePage)账户
|
||||
- 创建并获取 [API 密钥](https://platform.baichuan-ai.com/console/apikey)
|
||||
|
||||
<Image
|
||||
alt={'创建 API Key'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/8787716c-833e-44ab-b506-922ddb6121de'}
|
||||
/>
|
||||
|
||||
### 步骤二:在 LobeChat 中配置百川
|
||||
|
||||
- 访问 LobeChat 的`设置`界面
|
||||
- 在`语言模型`下找到`百川`的设置项
|
||||
|
||||
<Image
|
||||
alt={'填入 API 密钥'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/dec6665a-b3ec-4c50-a57f-7c7eb3160e7b'}
|
||||
/>
|
||||
|
||||
- 填入获得的 API 密钥
|
||||
- 为你的 AI 助手选择一个百川的模型即可开始对话
|
||||
|
||||
<Image
|
||||
alt={'选择百川模型并开始对话'}
|
||||
inStep
|
||||
src={'https://github.com/user-attachments/assets/bfda556a-d3fc-409f-8647-e718788f2fb8'}
|
||||
/>
|
||||
|
||||
<Callout type={'warning'}>
|
||||
在使用过程中你可能需要向 API 服务提供商付费,请参考百川的相关费用政策。
|
||||
</Callout>
|
||||
|
||||
</Steps>
|
||||
|
||||
至此你已经可以在 LobeChat 中使用百川提供的模型进行对话了。
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user