diff --git a/docs/self-hosting/advanced/auth.mdx b/docs/self-hosting/advanced/auth.mdx index d27844226790..35998358a883 100644 --- a/docs/self-hosting/advanced/auth.mdx +++ b/docs/self-hosting/advanced/auth.mdx @@ -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: @@ -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. @@ -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 diff --git a/docs/self-hosting/advanced/auth.zh-CN.mdx b/docs/self-hosting/advanced/auth.zh-CN.mdx index 86467796e6c6..9f143a081c81 100644 --- a/docs/self-hosting/advanced/auth.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth.zh-CN.mdx @@ -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`。 | 目前支持的身份验证服务有: @@ -53,7 +53,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全 ## 进阶配置 -同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。 +同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 顺序为 SSO 提供商的显示顺序。 @@ -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 提供商 diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx index 70cf0b1f1552..6a6ca7bf2a5a 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx @@ -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 ``` @@ -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` | diff --git a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx index e1fcc48427c9..276268abebf6 100644 --- a/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +++ b/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx @@ -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 ``` @@ -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` | diff --git a/docs/self-hosting/environment-variables/auth.mdx b/docs/self-hosting/environment-variables/auth.mdx index 8d2677a52936..deed6dc2d8c7 100644 --- a/docs/self-hosting/environment-variables/auth.mdx +++ b/docs/self-hosting/environment-variables/auth.mdx @@ -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` diff --git a/docs/self-hosting/environment-variables/auth.zh-CN.mdx b/docs/self-hosting/environment-variables/auth.zh-CN.mdx index 97cf2c5e207d..a92e16a7d3d6 100644 --- a/docs/self-hosting/environment-variables/auth.zh-CN.mdx +++ b/docs/self-hosting/environment-variables/auth.zh-CN.mdx @@ -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` diff --git a/docs/self-hosting/server-database/docker.zh-CN.mdx b/docs/self-hosting/server-database/docker.zh-CN.mdx index 24e1694e9d9b..911efb526240 100644 --- a/docs/self-hosting/server-database/docker.zh-CN.mdx +++ b/docs/self-hosting/server-database/docker.zh-CN.mdx @@ -20,10 +20,8 @@ tags: - 本文已经假定你了解了 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)。 @@ -165,6 +163,7 @@ $ docker run -it -d --name lobe-chat-database -p 3210:3210 \ ,将会走到自身容器的 `localhost`,此时请尝试用 `host.docker.internal` 替代 `localhost` + [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 diff --git a/package.json b/package.json index fa75c2285a50..2d5c39310bb6 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/config/modelProviders/github.ts b/src/config/modelProviders/github.ts index 3fdebcd73701..68029f47cd12 100644 --- a/src/config/modelProviders/github.ts +++ b/src/config/modelProviders/github.ts @@ -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, }, diff --git a/src/config/modelProviders/hunyuan.ts b/src/config/modelProviders/hunyuan.ts index 5499da109cc8..cde75f702d21 100644 --- a/src/config/modelProviders/hunyuan.ts +++ b/src/config/modelProviders/hunyuan.ts @@ -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,在多个维度的评测指标上处于领先。', diff --git a/src/config/modelProviders/mistral.ts b/src/config/modelProviders/mistral.ts index 06f24268b045..ca9e28bf00df 100644 --- a/src/config/modelProviders/mistral.ts +++ b/src/config/modelProviders/mistral.ts @@ -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, }, { @@ -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, }, { @@ -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, }, { @@ -44,14 +59,44 @@ 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, }, { @@ -59,6 +104,10 @@ const Mistral: ModelProviderCard = { 'Mixtral 8x7B是一个稀疏专家模型,利用多个参数提高推理速度,适合处理多语言和代码生成任务。', displayName: 'Mixtral 8x7B', id: 'open-mixtral-8x7b', + pricing: { + input: 0.7, + output: 0.7, + }, tokens: 32_768, }, { @@ -67,6 +116,10 @@ const Mistral: ModelProviderCard = { displayName: 'Mixtral 8x22B', functionCall: true, id: 'open-mixtral-8x22b', + pricing: { + input: 2, + output: 6, + }, tokens: 65_536, }, { @@ -74,10 +127,14 @@ const Mistral: ModelProviderCard = { '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', diff --git a/src/config/modelProviders/moonshot.ts b/src/config/modelProviders/moonshot.ts index e72cb554d69c..55e731ba64b7 100644 --- a/src/config/modelProviders/moonshot.ts +++ b/src/config/modelProviders/moonshot.ts @@ -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: @@ -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', diff --git a/src/config/modelProviders/siliconcloud.ts b/src/config/modelProviders/siliconcloud.ts index 0966bd4d3d25..b531cf14b1cc 100644 --- a/src/config/modelProviders/siliconcloud.ts +++ b/src/config/modelProviders/siliconcloud.ts @@ -95,7 +95,6 @@ const SiliconCloud: ModelProviderCard = { { description: 'Qwen2.5-Math 专注于数学领域的问题求解,为高难度题提供专业解答。', displayName: 'Qwen2.5 Math 72B', - enabled: true, id: 'Qwen/Qwen2.5-Math-72B-Instruct', pricing: { currency: 'CNY', @@ -107,7 +106,6 @@ const SiliconCloud: ModelProviderCard = { { description: 'Qwen2.5-Coder 专注于代码编写。', displayName: 'Qwen2.5 Coder 7B', - enabled: true, id: 'Qwen/Qwen2.5-Coder-7B-Instruct', pricing: { currency: 'CNY', @@ -270,6 +268,18 @@ const SiliconCloud: ModelProviderCard = { }, tokens: 32_768, }, + { + description: 'Llama 3.1 Nemotron 70B 是由 NVIDIA 定制的大型语言模型,旨在提高 LLM 生成的响应对用户查询的帮助程度。', + displayName: 'Llama 3.1 Nemotron 70B', + enabled: true, + id: 'nvidia/Llama-3.1-Nemotron-70B-Instruct', + pricing: { + currency: 'CNY', + input: 4.13, + output: 4.13, + }, + tokens: 32_768, + }, ], checkModel: 'Qwen/Qwen2.5-7B-Instruct', description: 'SiliconCloud,基于优秀开源基础模型的高性价比 GenAI 云服务', diff --git a/src/config/modelProviders/stepfun.ts b/src/config/modelProviders/stepfun.ts index 1e4a022484cb..1a0026f21fd9 100644 --- a/src/config/modelProviders/stepfun.ts +++ b/src/config/modelProviders/stepfun.ts @@ -5,27 +5,20 @@ import { ModelProviderCard } from '@/types/llm'; const Stepfun: ModelProviderCard = { chatModels: [ { - description: '支持大规模上下文交互,适合复杂对话场景。', - displayName: 'Step 2 16K', + description: '高速模型,适合实时对话。', + displayName: 'Step 1 Flash', enabled: true, functionCall: true, - id: 'step-2-16k', - tokens: 16_000, - }, - { - description: '具备超长上下文处理能力,尤其适合长文档分析。', - displayName: 'Step 1 256K', - functionCall: true, - id: 'step-1-256k', - tokens: 256_000, + id: 'step-1-flash', + tokens: 8000, }, { - description: '平衡性能与成本,适合一般场景。', - displayName: 'Step 1 128K', + description: '小型模型,适合轻量级任务。', + displayName: 'Step 1 8K', enabled: true, functionCall: true, - id: 'step-1-128k', - tokens: 128_000, + id: 'step-1-8k', + tokens: 8000, }, { description: '支持中等长度的对话,适用于多种应用场景。', @@ -36,29 +29,27 @@ const Stepfun: ModelProviderCard = { tokens: 32_000, }, { - description: '小型模型,适合轻量级任务。', - displayName: 'Step 1 8K', + description: '平衡性能与成本,适合一般场景。', + displayName: 'Step 1 128K', enabled: true, functionCall: true, - id: 'step-1-8k', - tokens: 8000, + id: 'step-1-128k', + tokens: 128_000, }, { - description: '高速模型,适合实时对话。', - displayName: 'Step 1 Flash', - enabled: true, + description: '具备超长上下文处理能力,尤其适合长文档分析。', + displayName: 'Step 1 256K', functionCall: true, - id: 'step-1-flash', - tokens: 8000, + id: 'step-1-256k', + tokens: 256_000, }, { - description: '支持视觉输入,增强多模态交互体验。', - displayName: 'Step 1V 32K', + description: '支持大规模上下文交互,适合复杂对话场景。', + displayName: 'Step 2 16K', enabled: true, functionCall: true, - id: 'step-1v-32k', - tokens: 32_000, - vision: true, + id: 'step-2-16k', + tokens: 16_000, }, { description: '小型视觉模型,适合基本的图文任务。', @@ -69,6 +60,15 @@ const Stepfun: ModelProviderCard = { tokens: 8000, vision: true, }, + { + description: '支持视觉输入,增强多模态交互体验。', + displayName: 'Step 1V 32K', + enabled: true, + functionCall: true, + id: 'step-1v-32k', + tokens: 32_000, + vision: true, + }, ], checkModel: 'step-1-flash', description: diff --git a/src/config/modelProviders/togetherai.ts b/src/config/modelProviders/togetherai.ts index 1446f2c1a3e8..2ff5f5d16ec4 100644 --- a/src/config/modelProviders/togetherai.ts +++ b/src/config/modelProviders/togetherai.ts @@ -1,14 +1,45 @@ import { ModelProviderCard } from '@/types/llm'; -// ref :https://docs.together.ai/docs/chat-models -// ref :https://www.together.ai/pricing +// ref: https://docs.together.ai/docs/chat-models +// ref: https://www.together.ai/pricing const TogetherAI: ModelProviderCard = { chatModels: [ + { + description: 'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。', + displayName: 'Llama 3.2 3B Instruct Turbo', + enabled: true, + id: 'meta-llama/Llama-3.2-3B-Instruct-Turbo', + tokens: 131_072, + }, + { + description: 'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。', + displayName: 'Llama 3.2 11B Vision Instruct Turbo (Free)', + enabled: true, + id: 'meta-llama/Llama-Vision-Free', + tokens: 131_072, + vision: true, + }, + { + description: 'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。', + displayName: 'Llama 3.2 11B Vision Instruct Turbo', + id: 'meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo', + tokens: 131_072, + vision: true, + }, + { + description: 'LLaMA 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。', + displayName: 'Llama 3.2 90B Vision Instruct Turbo', + enabled: true, + id: 'meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo', + tokens: 131_072, + vision: true, + }, { description: 'Llama 3.1 8B 模型采用FP8量化,支持高达131,072个上下文标记,是开源模型中的佼佼者,适合复杂任务,表现优异于许多行业基准。', displayName: 'Llama 3.1 8B Instruct Turbo', enabled: true, + functionCall: true, id: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', tokens: 131_072, }, @@ -17,6 +48,7 @@ const TogetherAI: ModelProviderCard = { 'Llama 3.1 70B 模型经过精细调整,适用于高负载应用,量化至FP8提供更高效的计算能力和准确性,确保在复杂场景中的卓越表现。', displayName: 'Llama 3.1 70B Instruct Turbo', enabled: true, + functionCall: true, id: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo', tokens: 131_072, }, @@ -25,8 +57,9 @@ const TogetherAI: ModelProviderCard = { '405B 的 Llama 3.1 Turbo 模型,为大数据处理提供超大容量的上下文支持,在超大规模的人工智能应用中表现突出。', displayName: 'Llama 3.1 405B Instruct Turbo', enabled: true, + functionCall: true, id: 'meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo', - tokens: 8192, + tokens: 130_815, }, { description: 'Llama 3 8B Instruct Turbo 是一款高效能的大语言模型,支持广泛的应用场景。', @@ -54,14 +87,14 @@ const TogetherAI: ModelProviderCard = { tokens: 8192, }, { - description: 'LLaMA-3 Chat (8B) 提供多语言支持,涵盖丰富的领域知识。', - displayName: 'LLaMA-3 Chat (8B)', + description: 'Llama 3 8B Instruct Reference 提供多语言支持,涵盖丰富的领域知识。', + displayName: 'Llama 3 8B Instruct Reference', id: 'meta-llama/Llama-3-8b-chat-hf', tokens: 8192, }, { - description: 'LLaMA-3 Chat (70B) 是功能强大的聊天模型,支持复杂的对话需求。', - displayName: 'LLaMA-3 Chat (70B)', + description: 'Llama 3 70B Instruct Reference 是功能强大的聊天模型,支持复杂的对话需求。', + displayName: 'Llama 3 70B Instruct Reference', id: 'meta-llama/Llama-3-70b-chat-hf', tokens: 8192, }, @@ -71,6 +104,12 @@ const TogetherAI: ModelProviderCard = { id: 'meta-llama/Llama-2-13b-chat-hf', tokens: 4096, }, + { + description: 'LLaMA-2 提供优秀的语言处理能力和出色的交互体验。', + displayName: 'LLaMA-2 (70B)', + id: 'meta-llama/Llama-2-70b-hf', + tokens: 4096, + }, { description: 'Gemma 2 9B 由Google开发,提供高效的指令响应和综合能力。', displayName: 'Gemma 2 9B', @@ -107,16 +146,30 @@ const TogetherAI: ModelProviderCard = { { description: 'Mistral (7B) Instruct 以高性能著称,适用于多种语言任务。', displayName: 'Mistral (7B) Instruct', + functionCall: true, id: 'mistralai/Mistral-7B-Instruct-v0.1', tokens: 8192, }, + { + description: 'Mistral 7B是一款紧凑但高性能的模型,擅长批量处理和简单任务,如分类和文本生成,具有良好的推理能力。', + displayName: 'Mistral (7B)', + id: 'mistralai/Mistral-7B-v0.1', + tokens: 8192, + }, { description: 'Mixtral-8x7B Instruct (46.7B) 提供高容量的计算框架,适合大规模数据处理。', displayName: 'Mixtral-8x7B Instruct (46.7B)', enabled: true, + functionCall: true, id: 'mistralai/Mixtral-8x7B-Instruct-v0.1', tokens: 32_768, }, + { + description: 'Mixtral 8x7B是一个稀疏专家模型,利用多个参数提高推理速度,适合处理多语言和代码生成任务。', + displayName: 'Mixtral-8x7B (46.7B)', + id: 'mistralai/Mixtral-8x7B-v0.1', + tokens: 32_768, + }, { description: 'Mixtral-8x22B Instruct (141B) 是一款超级大语言模型,支持极高的处理需求。', displayName: 'Mixtral-8x22B Instruct (141B)', @@ -131,10 +184,23 @@ const TogetherAI: ModelProviderCard = { id: 'deepseek-ai/deepseek-llm-67b-chat', tokens: 4096, }, + { + description: 'Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。', + displayName: 'Qwen 2.5 7B Instruct Turbo', + enabled: true, + id: 'Qwen/Qwen2.5-7B-Instruct-Turbo', + tokens: 32_768, + }, + { + description: 'Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。', + displayName: 'Qwen 2.5 72B Instruct Turbo', + enabled: true, + id: 'Qwen/Qwen2.5-72B-Instruct-Turbo', + tokens: 32_768, + }, { description: 'Qwen 2 Instruct (72B) 为企业级应用提供精准的指令理解和响应。', displayName: 'Qwen 2 Instruct (72B)', - enabled: true, id: 'Qwen/Qwen2-72B-Instruct', tokens: 32_768, }, @@ -187,7 +253,7 @@ const TogetherAI: ModelProviderCard = { tokens: 32_768, }, ], - checkModel: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', + checkModel: 'meta-llama/Llama-Vision-Free', description: 'Together AI 致力于通过创新的 AI 模型实现领先的性能,提供广泛的自定义能力,包括快速扩展支持和直观的部署流程,满足企业的各种需求。', id: 'togetherai', diff --git a/src/config/modelProviders/wenxin.ts b/src/config/modelProviders/wenxin.ts index 8e977c94cc27..2641ef05d3ee 100644 --- a/src/config/modelProviders/wenxin.ts +++ b/src/config/modelProviders/wenxin.ts @@ -71,7 +71,7 @@ const BaiduWenxin: ModelProviderCard = { '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀', displayName: 'ERNIE 4.0 Turbo 8K', enabled: true, - id: 'ERNIE-4.0-Turbo-8K', + id: 'ERNIE-4.0-Turbo-8K-Latest', pricing: { currency: 'CNY', input: 20, diff --git a/src/config/modelProviders/zeroone.ts b/src/config/modelProviders/zeroone.ts index daa2b4f1e146..706a67966f8a 100644 --- a/src/config/modelProviders/zeroone.ts +++ b/src/config/modelProviders/zeroone.ts @@ -16,43 +16,40 @@ const ZeroOne: ModelProviderCard = { tokens: 16_384, }, { - description: '全新千亿参数模型,提供超强问答及文本生成能力。', - displayName: 'Yi Large', + description: '小而精悍,轻量极速模型。提供强化数学运算和代码编写能力。', + displayName: 'Yi Spark', enabled: true, - id: 'yi-large', + id: 'yi-spark', pricing: { currency: 'CNY', - input: 20, - output: 20, + input: 1, + output: 1, }, - tokens: 32_768, + tokens: 16_384, }, { - description: - '在 yi-large 模型的基础上支持并强化了工具调用的能力,适用于各种需要搭建 agent 或 workflow 的业务场景。', - displayName: 'Yi Large FC', + description: '中型尺寸模型升级微调,能力均衡,性价比高。深度优化指令遵循能力。', + displayName: 'Yi Medium', enabled: true, - functionCall: true, - id: 'yi-large-fc', + id: 'yi-medium', pricing: { currency: 'CNY', - input: 20, - output: 20, + input: 2.5, + output: 2.5, }, - tokens: 32_768, + tokens: 16_384, }, { - description: - '基于 yi-large 超强模型的高阶服务,结合检索与生成技术提供精准答案,实时全网检索信息服务。', - displayName: 'Yi Large RAG', + description: '200K 超长上下文窗口,提供长文本深度理解和生成能力。', + displayName: 'Yi Medium 200K', enabled: true, - id: 'yi-large-rag', + id: 'yi-medium-200k', pricing: { currency: 'CNY', - input: 25, - output: 25, + input: 12, + output: 12, }, - tokens: 16_384, + tokens: 200_000, }, { description: '超高性价比、卓越性能。根据性能和推理速度、成本,进行平衡性高精度调优。', @@ -67,40 +64,42 @@ const ZeroOne: ModelProviderCard = { tokens: 16_384, }, { - description: '中型尺寸模型升级微调,能力均衡,性价比高。深度优化指令遵循能力。', - displayName: 'Yi Medium', + description: + '基于 yi-large 超强模型的高阶服务,结合检索与生成技术提供精准答案,实时全网检索信息服务。', + displayName: 'Yi Large RAG', enabled: true, - id: 'yi-medium', + id: 'yi-large-rag', pricing: { currency: 'CNY', - input: 2.5, - output: 2.5, + input: 25, + output: 25, }, tokens: 16_384, }, { - description: '200K 超长上下文窗口,提供长文本深度理解和生成能力。', - displayName: 'Yi Medium 200K', + description: + '在 yi-large 模型的基础上支持并强化了工具调用的能力,适用于各种需要搭建 agent 或 workflow 的业务场景。', + displayName: 'Yi Large FC', enabled: true, - id: 'yi-medium-200k', + functionCall: true, + id: 'yi-large-fc', pricing: { currency: 'CNY', - input: 12, - output: 12, + input: 20, + output: 20, }, - tokens: 200_000, + tokens: 32_768, }, { - description: '小而精悍,轻量极速模型。提供强化数学运算和代码编写能力。', - displayName: 'Yi Spark', - enabled: true, - id: 'yi-spark', + description: '全新千亿参数模型,提供超强问答及文本生成能力。', + displayName: 'Yi Large', + id: 'yi-large', pricing: { currency: 'CNY', - input: 1, - output: 1, + input: 20, + output: 20, }, - tokens: 16_384, + tokens: 32_768, }, { description: '复杂视觉任务模型,提供高性能图片理解、分析能力。', diff --git a/src/config/modelProviders/zhipu.ts b/src/config/modelProviders/zhipu.ts index 887e10d9d8ed..82872a147ad8 100644 --- a/src/config/modelProviders/zhipu.ts +++ b/src/config/modelProviders/zhipu.ts @@ -6,54 +6,53 @@ import { ModelProviderCard } from '@/types/llm'; const ZhiPu: ModelProviderCard = { chatModels: [ { - description: - 'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。', - displayName: 'GLM-4-AllTools', + description: 'GLM-4-Flash 是处理简单任务的理想选择,速度最快且免费。', + displayName: 'GLM-4-Flash', enabled: true, functionCall: true, - id: 'glm-4-alltools', + id: 'glm-4-flash', pricing: { currency: 'CNY', - input: 100, - output: 100, + input: 0, + output: 0, }, tokens: 128_000, }, { - description: - 'GLM-4-Plus 作为高智能旗舰,具备强大的处理长文本和复杂任务的能力,性能全面提升。', - displayName: 'GLM-4-Plus', + description: 'GLM-4-FlashX 是Flash的增强版本,超快推理速度。', + displayName: 'GLM-4-FlashX', enabled: true, functionCall: true, - id: 'glm-4-plus', + id: 'glm-4-flashx', pricing: { currency: 'CNY', - input: 50, - output: 50, + input: 0.1, + output: 0.1, }, tokens: 128_000, }, { - description: 'GLM-4-0520 是最新模型版本,专为高度复杂和多样化任务设计,表现卓越。', - displayName: 'GLM-4-0520', + description: 'GLM-4-Long 支持超长文本输入,适合记忆型任务与大规模文档处理。', + displayName: 'GLM-4-Long', functionCall: true, - id: 'glm-4-0520', + id: 'glm-4-long', pricing: { currency: 'CNY', - input: 100, - output: 100, + input: 1, + output: 1, }, - tokens: 128_000, + tokens: 1_024_000, }, { - description: 'GLM-4 是发布于2024年1月的旧旗舰版本,目前已被更强的 GLM-4-0520 取代。', - displayName: 'GLM-4', + description: 'GLM-4-Air 是性价比高的版本,性能接近GLM-4,提供快速度和实惠的价格。', + displayName: 'GLM-4-Air', + enabled: true, functionCall: true, - id: 'glm-4', + id: 'glm-4-air', pricing: { currency: 'CNY', - input: 100, - output: 100, + input: 1, + output: 1, }, tokens: 128_000, }, @@ -71,54 +70,53 @@ const ZhiPu: ModelProviderCard = { tokens: 8192, }, { - description: 'GLM-4-Air 是性价比高的版本,性能接近GLM-4,提供快速度和实惠的价格。', - displayName: 'GLM-4-Air', - enabled: true, + description: + 'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。', + displayName: 'GLM-4-AllTools', functionCall: true, - id: 'glm-4-air', + id: 'glm-4-alltools', pricing: { currency: 'CNY', - input: 1, - output: 1, + input: 100, + output: 100, }, tokens: 128_000, }, { - description: 'GLM-4-Long 支持超长文本输入,适合记忆型任务与大规模文档处理。', - displayName: 'GLM-4-Long', + description: + 'GLM-4-Plus 作为高智能旗舰,具备强大的处理长文本和复杂任务的能力,性能全面提升。', + displayName: 'GLM-4-Plus', enabled: true, functionCall: true, - id: 'glm-4-long', + id: 'glm-4-plus', pricing: { currency: 'CNY', - input: 1, - output: 1, + input: 50, + output: 50, }, - tokens: 1_024_000, + tokens: 128_000, }, { - description: 'GLM-4-FlashX 是Flash的增强版本,超快推理速度。', - displayName: 'GLM-4-FlashX', - enabled: true, + description: 'GLM-4-0520 是最新模型版本,专为高度复杂和多样化任务设计,表现卓越。', + displayName: 'GLM-4-0520', functionCall: true, - id: 'glm-4-flashx', + id: 'glm-4-0520', pricing: { currency: 'CNY', - input: 0.1, - output: 0.1, + input: 100, + output: 100, }, tokens: 128_000, }, { - description: 'GLM-4-Flash 是处理简单任务的理想选择,速度最快且免费。', - displayName: 'GLM-4-Flash', - enabled: true, + description: 'GLM-4 是发布于2024年1月的旧旗舰版本,目前已被更强的 GLM-4-0520 取代。', + displayName: 'GLM-4', functionCall: true, - id: 'glm-4-flash', + id: 'glm-4', pricing: { currency: 'CNY', - input: 0, - output: 0, + input: 100, + output: 100, }, tokens: 128_000, }, @@ -151,7 +149,6 @@ const ZhiPu: ModelProviderCard = { description: 'CodeGeeX-4 是强大的AI编程助手,支持多种编程语言的智能问答与代码补全,提升开发效率。', displayName: 'CodeGeeX-4', - enabled: true, id: 'codegeex-4', pricing: { currency: 'CNY', diff --git a/src/libs/next-auth/sso-providers/index.ts b/src/libs/next-auth/sso-providers/index.ts index 3e4acea1baab..ec9e1682fb84 100644 --- a/src/libs/next-auth/sso-providers/index.ts +++ b/src/libs/next-auth/sso-providers/index.ts @@ -7,6 +7,7 @@ import CloudflareZeroTrust from './cloudflare-zero-trust'; import GenericOIDC from './generic-oidc'; import Github from './github'; import Logto from './logto'; +import MicrosoftEntraID from './microsoft-entra-id'; import Zitadel from './zitadel'; export const ssoProviders = [ @@ -20,4 +21,5 @@ export const ssoProviders = [ Logto, CloudflareZeroTrust, Casdoor, + MicrosoftEntraID, ]; diff --git a/src/libs/next-auth/sso-providers/microsoft-entra-id.ts b/src/libs/next-auth/sso-providers/microsoft-entra-id.ts new file mode 100644 index 000000000000..7b5a158e6fd9 --- /dev/null +++ b/src/libs/next-auth/sso-providers/microsoft-entra-id.ts @@ -0,0 +1,15 @@ +import MicrosoftEntraID from 'next-auth/providers/microsoft-entra-id'; + +import { CommonProviderConfig } from './sso.config'; + +const provider = { + id: 'microsoft-entra-id', + provider: MicrosoftEntraID({ + ...CommonProviderConfig, + // Specify auth scope, at least include 'openid email' + // all scopes in Azure AD ref: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#openid-connect-scopes + authorization: { params: { scope: 'openid email profile' } }, + }), +}; + +export default provider;