Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
bentwnghk committed Oct 20, 2024
2 parents 6aa282f + fc1d0a6 commit bf59ea4
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 176 deletions.
6 changes: 3 additions & 3 deletions docs/self-hosting/advanced/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Before using NextAuth, please set the following variables in LobeChat's environm
| --- | --- | --- |
| `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
| `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,azure-ad,authentik`. |
| `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. |

Currently supported identity verification services include:

Expand All @@ -56,7 +56,7 @@ Click on the links to view the corresponding platform's configuration documentat

## 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 `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.

The order corresponds to the display order of the SSO providers.

Expand All @@ -69,7 +69,7 @@ The order corresponds to the display order of the SSO providers.
| Cloudflare Zero Trust | `cloudflare-zero-trust` |
| Github | `github` |
| Logto | `logto` |
| Microsoft Entra ID | `azure-ad` |
| Microsoft Entra ID | `microsoft-entra-id` |
| ZITADEL | `zitadel` |

## Other SSO Providers
Expand Down
6 changes: 3 additions & 3 deletions docs/self-hosting/advanced/auth.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
| --- | --- | --- |
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`|
| `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`|

目前支持的身份验证服务有:

Expand All @@ -53,7 +53,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全

## 进阶配置

同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`
同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`

顺序为 SSO 提供商的显示顺序。

Expand All @@ -66,7 +66,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
| Cloudflare Zero Trust | `cloudflare-zero-trust` |
| Github | `github` |
| Logto | `logto` |
| Microsoft Entra ID | `azure-ad` |
| Microsoft Entra ID | `microsoft-entra-id` |
| ZITADEL | `zitadel` |

## 其他 SSO 提供商
Expand Down
10 changes: 5 additions & 5 deletions docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Fill in the desired application name to be displayed to organizational users, ch
In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:

```bash
https://your-domain/api/auth/callback/azure-ad
https://your-domain/api/auth/callback/microsoft-entra-id
```

<Callout type={'info'}>
Expand Down Expand Up @@ -72,10 +72,10 @@ 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. |
| `AUTH_AZURE_AD_ID` | Required | Client ID of the Microsoft Entra ID application. |
| `AUTH_AZURE_AD_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
| `AUTH_AZURE_AD_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. |
| `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
| `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` |

<Callout type={'tip'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tags:
`Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写:

```bash
https://your-domain/api/auth/callback/azure-ad
https://your-domain/api/auth/callback/microsoft-entra-id
```

<Callout type={'info'}>
Expand Down Expand Up @@ -69,10 +69,10 @@ 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`|
| `AUTH_AZURE_AD_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
| `AUTH_AZURE_AD_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
| `AUTH_AZURE_AD_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`|
| `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
| `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
| `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |

<Callout type={'tip'}>
Expand Down
4 changes: 2 additions & 2 deletions docs/self-hosting/environment-variables/auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ LobeChat provides a complete authentication service capability when deployed. Th
#### `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`.
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.
- Default: `auth0`
- Example: `auth0,azure-ad,authentik`
- Example: `auth0,microsoft-entra-id,authentik`

#### `NEXTAUTH_URL`

Expand Down
4 changes: 2 additions & 2 deletions docs/self-hosting/environment-variables/auth.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
#### `NEXT_AUTH_SSO_PROVIDERS`

- 类型:可选
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,microsoft-entra-id,authentik`
- 默认值: `auth0`
- 示例: `auth0,azure-ad,authentik`
- 示例: `auth0,microsoft-entra-id,authentik`

#### `NEXTAUTH_URL`

Expand Down
7 changes: 3 additions & 4 deletions docs/self-hosting/server-database/docker.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ tags:
</div>

<Callout type="info">
本文已经假定你了解了 LobeChat 服务端数据库版本(下简称 DB
版)的部署基本原理和流程,因此只包含核心环境变量配置的内容。如果你还不了解 LobeChat DB
版的部署原理,请先查阅 [使用服务端数据库部署](https://lobehub.com/zh/docs/self-hosting/advanced/s3/tencent-cloud)
此外,针对国内的腾讯云储存桶用户,可查询[配置腾讯云 COS 存储服务](https://lobehub.com/zh/docs/self-hosting/advanced/s3/tencent-cloud)
本文已经假定你了解了 LobeChat 服务端数据库版本(下简称 DB 版)的部署基本原理和流程,因此只包含核心环境变量配置的内容。如果你还不了解 LobeChat DB 版的部署原理,请先查阅 [使用服务端数据库部署](/zh/docs/self-hosting/server-database)
此外,针对国内的腾讯云储存桶用户,可查询[配置腾讯云 COS 存储服务](/zh/docs/self-hosting/advanced/s3/tencent-cloud)
</Callout>

<Callout type="warning">
Expand Down Expand Up @@ -165,6 +163,7 @@ $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
,将会走到自身容器的 `localhost`,此时请尝试用 `host.docker.internal` 替代 `localhost`
</Callout>


[docker-pulls-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
[docker-pulls-shield]: https://img.shields.io/docker/pulls/lobehub/lobe-chat-database?color=45cc11&labelColor=black&style=flat-square
[docker-release-link]: https://hub.docker.com/r/lobehub/lobe-chat-database
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"@huggingface/inference": "^2.8.1",
"@icons-pack/react-simple-icons": "9.6.0",
"@khmyznikov/pwa-install": "^0.3.9",
"@langchain/community": "^0.2.33",
"@langchain/community": "^0.3.0",
"@lobehub/chat-plugin-sdk": "^1.32.4",
"@lobehub/chat-plugins-gateway": "^1.9.0",
"@lobehub/icons": "^1.35.4",
Expand Down
2 changes: 1 addition & 1 deletion src/config/modelProviders/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Github: ModelProviderCard = {
{
description: 'Phi-3-mini模型的更新版。',
displayName: 'Phi-3.5-mini 128K',
id: 'Phi-3-5-mini-instruct',
id: 'Phi-3.5-mini-instruct',
maxOutput: 4096,
tokens: 131_072,
},
Expand Down
23 changes: 11 additions & 12 deletions src/config/modelProviders/hunyuan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,30 @@ const Hunyuan: ModelProviderCard = {
tokens: 32_000,
},
{
description: '混元最新代码生成模型,经过 200B 高质量代码数据增训基座模型,迭代半年高质量 SFT 数据训练,上下文长窗口长度增大到 8K,五大语言代码生成自动评测指标上位居前列;五大语言10项考量各方面综合代码任务人工高质量评测上,性能处于第一梯队',
displayName: 'Hunyuan Code',
description: '混元最新多模态模型,支持图片+文本输入生成文本内容。',
displayName: 'Hunyuan Vision',
enabled: true,
id: 'hunyuan-code',
id: 'hunyuan-vision',
maxOutput: 4000,
pricing: {
currency: 'CNY',
input: 4,
output: 8,
input: 18,
output: 18,
},
tokens: 8000,
vision: true,
},
{
description: '混元最新多模态模型,支持图片+文本输入生成文本内容。',
displayName: 'Hunyuan Vision',
enabled: true,
id: 'hunyuan-vision',
description: '混元最新代码生成模型,经过 200B 高质量代码数据增训基座模型,迭代半年高质量 SFT 数据训练,上下文长窗口长度增大到 8K,五大语言代码生成自动评测指标上位居前列;五大语言10项考量各方面综合代码任务人工高质量评测上,性能处于第一梯队',
displayName: 'Hunyuan Code',
id: 'hunyuan-code',
maxOutput: 4000,
pricing: {
currency: 'CNY',
input: 18,
output: 18,
input: 4,
output: 8,
},
tokens: 8000,
vision: true,
},
{
description: '混元最新 MOE 架构 FunctionCall 模型,经过高质量的 FunctionCall 数据训练,上下文窗口达 32K,在多个维度的评测指标上处于领先。',
Expand Down
61 changes: 59 additions & 2 deletions src/config/modelProviders/mistral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const Mistral: ModelProviderCard = {
enabled: true,
functionCall: true,
id: 'open-mistral-nemo',
pricing: {
input: 0.15,
output: 0.15,
},
tokens: 128_000,
},
{
Expand All @@ -20,6 +24,10 @@ const Mistral: ModelProviderCard = {
enabled: true,
functionCall: true,
id: 'mistral-small-latest',
pricing: {
input: 0.2,
output: 0.6,
},
tokens: 128_000,
},
{
Expand All @@ -29,13 +37,20 @@ const Mistral: ModelProviderCard = {
enabled: true,
functionCall: true,
id: 'mistral-large-latest',
pricing: {
input: 2,
output: 6,
},
tokens: 128_000,
},
{
description: 'Codestral是专注于代码生成的尖端生成模型,优化了中间填充和代码补全任务。',
displayName: 'Codestral',
enabled: true,
id: 'codestral-latest',
pricing: {
input: 0.2,
output: 0.6,
},
tokens: 32_768,
},
{
Expand All @@ -44,21 +59,55 @@ const Mistral: ModelProviderCard = {
displayName: 'Pixtral 12B',
enabled: true,
id: 'pixtral-12b-2409',
pricing: {
input: 0.15,
output: 0.15,
},
tokens: 128_000,
vision: true,
},
{
description:
'Ministral 3B 是Mistral的世界顶级边缘模型。',
displayName: 'Ministral 3B',
id: 'ministral-3b-latest',
pricing: {
input: 0.04,
output: 0.04,
},
tokens: 128_000,
},
{
description:
'Ministral 8B 是Mistral的性价比极高的边缘模型。',
displayName: 'Ministral 8B',
id: 'ministral-8b-latest',
pricing: {
input: 0.1,
output: 0.1,
},
tokens: 128_000,
},
{
description:
'Mistral 7B是一款紧凑但高性能的模型,擅长批量处理和简单任务,如分类和文本生成,具有良好的推理能力。',
displayName: 'Mistral 7B',
id: 'open-mistral-7b',
pricing: {
input: 0.25,
output: 0.25,
},
tokens: 32_768,
},
{
description:
'Mixtral 8x7B是一个稀疏专家模型,利用多个参数提高推理速度,适合处理多语言和代码生成任务。',
displayName: 'Mixtral 8x7B',
id: 'open-mixtral-8x7b',
pricing: {
input: 0.7,
output: 0.7,
},
tokens: 32_768,
},
{
Expand All @@ -67,17 +116,25 @@ const Mistral: ModelProviderCard = {
displayName: 'Mixtral 8x22B',
functionCall: true,
id: 'open-mixtral-8x22b',
pricing: {
input: 2,
output: 6,
},
tokens: 65_536,
},
{
description:
'Codestral Mamba是专注于代码生成的Mamba 2语言模型,为先进的代码和推理任务提供强力支持。',
displayName: 'Codestral Mamba',
id: 'open-codestral-mamba',
pricing: {
input: 0.15,
output: 0.15,
},
tokens: 256_000,
},
],
checkModel: 'open-mistral-7b',
checkModel: 'ministral-3b-latest',
description:
'Mistral 提供先进的通用、专业和研究型模型,广泛应用于复杂推理、多语言任务、代码生成等领域,通过功能调用接口,用户可以集成自定义功能,实现特定应用。',
id: 'mistral',
Expand Down
16 changes: 8 additions & 8 deletions src/config/modelProviders/moonshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const Moonshot: ModelProviderCard = {
chatModels: [
{
description:
'Moonshot V1 128K 是一款拥有超长上下文处理能力的模型,适用于生成超长文本,满足复杂的生成任务需求,能够处理多达128,000个tokens的内容,非常适合科研、学术和大型文档生成等应用场景。',
displayName: 'Moonshot V1 128K',
'Moonshot V1 8K 专为生成短文本任务设计,具有高效的处理性能,能够处理8,192个tokens,非常适合简短对话、速记和快速内容生成。',
displayName: 'Moonshot V1 8K',
enabled: true,
functionCall: true,
id: 'moonshot-v1-128k',
tokens: 128_000,
id: 'moonshot-v1-8k',
tokens: 8192,
},
{
description:
Expand All @@ -23,12 +23,12 @@ const Moonshot: ModelProviderCard = {
},
{
description:
'Moonshot V1 8K 专为生成短文本任务设计,具有高效的处理性能,能够处理8,192个tokens,非常适合简短对话、速记和快速内容生成。',
displayName: 'Moonshot V1 8K',
'Moonshot V1 128K 是一款拥有超长上下文处理能力的模型,适用于生成超长文本,满足复杂的生成任务需求,能够处理多达128,000个tokens的内容,非常适合科研、学术和大型文档生成等应用场景。',
displayName: 'Moonshot V1 128K',
enabled: true,
functionCall: true,
id: 'moonshot-v1-8k',
tokens: 8192,
id: 'moonshot-v1-128k',
tokens: 128_000,
},
],
checkModel: 'moonshot-v1-8k',
Expand Down
Loading

0 comments on commit bf59ea4

Please sign in to comment.