Skip to content

Commit

Permalink
✨ feat: Support DeepSeek as new model provider (lobehub#2446)
Browse files Browse the repository at this point in the history
* ✨ feat: support DeepSeek as provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* ✨ feat: Support DeepSeek as new model provider

* 💄 style: Translate some content

* ✨ feat: Support DeepSeek as new model provider

* 🐛 fix: Clean up the code and resolve a bug
  • Loading branch information
RubuJam committed May 14, 2024
1 parent a77f4fb commit 18028f3
Show file tree
Hide file tree
Showing 73 changed files with 731 additions and 37 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ OPENAI_API_KEY=sk-xxxxxxxxx

# MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

### DeepSeek AI ####

# DEEPSEEK_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
############ Market Service ############
########################################
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@ ENV TOGETHERAI_API_KEY ""
# Minimax
ENV MINIMAX_API_KEY ""

# DeepSeek
ENV DEEPSEEK_API_KEY ""

CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ 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/)

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).

Expand Down
2 changes: 2 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
- **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/)


同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)

Expand Down
23 changes: 16 additions & 7 deletions docs/self-hosting/environment-variables/model-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,23 @@ 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`

- Type: Required
- Description: This is the API key you applied for in the OpenRouter AI service
- Default: -
- Example: `sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
- Example: `sk-or-v1-xxxxxx...xxxxxx=`

### `OPENROUTER_MODEL_LIST`

Expand All @@ -169,7 +178,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: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- Example: `xxxxxx...xxxxxx`

### `TOGETHERAI_MODEL_LIST`

Expand Down Expand Up @@ -210,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 from Perplexity AI
- Default: -
- Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- Example: `pplx-xxxxxx...xxxxxx`

## Minimax AI

Expand All @@ -219,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 Minimax AI service
- Default: -
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- Example: `xxxxxx...xxxxxx`

## Mistral AI

Expand All @@ -228,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 for in the Mistral AI service
- Default: -
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
- Example: `xxxxxx...xxxxxx=`

## Groq AI

Expand All @@ -237,7 +246,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_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- Example: `gsk_xxxxxx...xxxxxx`

## ZHIPU AI

Expand All @@ -255,6 +264,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: -
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`xxxxxx...xxxxxx`

[model-list]: /docs/self-hosting/advanced/model-list
23 changes: 16 additions & 7 deletions docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,23 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:`us-east-1`
- 示例:`us-east-1`

## DeepSeek AI

### `DEEPSEEK_API_KEY`

- 类型:必选
- 描述:这是你在 DeepSeek AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`sk-xxxxxx...xxxxxx`

## OpenRouter AI

### `OPENROUTER_API_KEY`

- 类型:必选
- 描述:这是你在 OpenRouter AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
- 示例:`sk-or-v1-xxxxxx...xxxxxx=`

### `OPENROUTER_MODEL_LIST`

Expand All @@ -167,7 +176,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 TogetherAI 服务中申请的 API 密钥
- 默认值:-
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`xxxxxx...xxxxxx`

### `TOGETHERAI_MODEL_LIST`

Expand Down Expand Up @@ -208,7 +217,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 Perplexity AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`pplx-xxxxxx...xxxxxx`

## Minimax AI

Expand All @@ -217,7 +226,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 Minimax AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`xxxxxx...xxxxxx`

## Mistral AI

Expand All @@ -226,7 +235,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 Mistral AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`
- 示例:`xxxxxx...xxxxxx=`

## Groq AI

Expand All @@ -235,7 +244,7 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在 Groq AI 服务中申请的 API 密钥
- 默认值:-
- 示例:`gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`gsk_xxxxxx...xxxxxx`

## 智谱 AI

Expand All @@ -253,6 +262,6 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 类型:必选
- 描述:这是你在零一万物服务中申请的 API 密钥
- 默认值:-
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- 示例:`xxxxxx...xxxxxx`

[model-list]: /docs/self-hosting/advanced/model-list
1 change: 1 addition & 0 deletions docs/usage/features/multi-ai-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ 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/)

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).

Expand Down
1 change: 1 addition & 0 deletions docs/usage/features/multi-ai-providers.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ 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/)

同时,我们也在计划支持更多的模型服务商,如 Replicate 和 Perplexity 等,以进一步丰富我们的服务商库。如果你希望让 LobeChat 支持你喜爱的服务商,欢迎加入我们的[社区讨论](https://github.com/lobehub/lobe-chat/discussions/1284)

Expand Down
2 changes: 2 additions & 0 deletions locales/ar/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@
"AnthropicBizError": "خطأ في طلب خدمة Anthropic AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"AzureBizError": "حدث خطأ في طلب خدمة Azure AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"BedrockBizError": "حدث خطأ في طلب خدمة Bedrock، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"DeepSeekBizError": "خطأ في طلب خدمة DeepSeek، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"GoogleBizError": "حدث خطأ في طلب خدمة Google، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"GroqBizError": "حدث خطأ في خدمة Groq ، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"InvalidAccessCode": "كلمة المرور غير صحيحة أو فارغة، يرجى إدخال كلمة مرور الوصول الصحيحة أو إضافة مفتاح API مخصص",
"InvalidAnthropicAPIKey": "مفتاح Anthropic API غير صحيح أو فارغ، يرجى التحقق من مفتاح Anthropic API وإعادة المحاولة",
"InvalidAzureAPIKey": "مفتاح Azure API غير صحيح أو فارغ، يرجى التحقق من مفتاح Azure API وإعادة المحاولة",
"InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة",
"InvalidClerkUser": "عذرًا، لم تقم بتسجيل الدخول بعد، يرجى تسجيل الدخول أو التسجيل للمتابعة",
"InvalidDeepSeekAPIKey": "مفتاح DeepSeek API غير صحيح أو فارغ، يرجى التحقق من مفتاح DeepSeek API وإعادة المحاولة",
"InvalidGoogleAPIKey": "مفتاح Google API غير صحيح أو فارغ، يرجى التحقق من مفتاح Google API وإعادة المحاولة",
"InvalidGroqAPIKey": "مفتاح Groq API غير صحيح أو فارغ، يرجى التحقق من مفتاح Groq API وإعادة المحاولة",
"InvalidMinimaxAPIKey": "مفتاح Minimax API غير صحيح أو فارغ، يرجى التحقق من مفتاح Minimax API وإعادة المحاولة",
Expand Down
12 changes: 12 additions & 0 deletions locales/ar/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@
"title": "استخدام معلومات المصادقة الخاصة بـ Bedrock المخصصة"
}
},
"deepseek": {
"title": "DeepSeek",
"token": {
"desc": "أدخل مفتاح API الخاص بـ DeepSeek",
"placeholder": "مفتاح API DeepSeek",
"title": "مفتاح API"
},
"unlock": {
"description": "قم بإدخال مفتاح API DeepSeek الخاص بك لبدء الجلسة. لن يتم تسجيل مفتاح الـ API الخاص بك",
"title": "استخدام مفتاح API خاص بـ DeepSeek"
}
},
"google": {
"title": "Google",
"token": {
Expand Down
2 changes: 2 additions & 0 deletions locales/bg-BG/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@
"AnthropicBizError": "Грешка при заявка към услугата Anthropic. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.",
"AzureBizError": "Грешка при заявка към услугата Azure AI. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.",
"BedrockBizError": "Грешка при заявка към услугата Bedrock. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.",
"DeepSeekBizError": "Грешка при заявка към услугата DeepSeek. Моля, проверете информацията по-долу и опитайте отново.",
"GoogleBizError": "Грешка при заявка към услугата Google. Моля, отстранете неизправностите или опитайте отново въз основа на следната информация.",
"GroqBizError": "Възникна грешка при заявка към услугата Groq. Моля, отстранете неизправностите въз основа на следната информация или опитайте отново.",
"InvalidAccessCode": "Невалиден или празен код за достъп. Моля, въведете правилния код за достъп или добавете персонализиран API ключ.",
"InvalidAnthropicAPIKey": "API ключът на Anthropic е неправилен или празен. Моля, проверете API ключа на Anthropic и опитайте отново.",
"InvalidAzureAPIKey": "API ключът на Azure е неправилен или празен. Моля, проверете API ключа на Azure и опитайте отново.",
"InvalidBedrockCredentials": "Удостоверяването на Bedrock е неуспешно. Моля, проверете AccessKeyId/SecretAccessKey и опитайте отново.",
"InvalidClerkUser": "很抱歉,你当前尚未登录,请先登录或注册账号后继续操作",
"InvalidDeepSeekAPIKey": "Невалиден ключ за достъп до DeepSeek API или е празен. Моля, проверете ключа за достъп до DeepSeek API и опитайте отново.",
"InvalidGoogleAPIKey": "API ключът на Google е неправилен или празен. Моля, проверете API ключа на Google и опитайте отново.",
"InvalidGroqAPIKey": "API ключът на Groq е неправилен или празен. Моля, проверете API ключа на Groq и опитайте отново.",
"InvalidMinimaxAPIKey": "Невалиден или липсващ ключ за Minimax API, моля проверете ключа за Minimax API и опитайте отново",
Expand Down
12 changes: 12 additions & 0 deletions locales/bg-BG/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@
"title": "Използване на персонализирана информация за удостоверяване на Bedrock"
}
},
"deepseek": {
"title": "DeepSeek",
"token": {
"desc": "Въведете API ключ от DeepSeek",
"placeholder": "API ключ на DeepSeek",
"title": "API ключ"
},
"unlock": {
"description": "Само въведете вашия API ключ от DeepSeek, за да започнете сесията. Приложението няма да запази вашия API ключ",
"title": "Използване на персонализиран API ключ от DeepSeek"
}
},
"google": {
"title": "Google",
"token": {
Expand Down
2 changes: 2 additions & 0 deletions locales/de-DE/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@
"AnthropicBizError": "Fehler beim Anfordern des Anthropic AI-Dienstes. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"AzureBizError": "Es ist ein Fehler bei der Anforderung des Azure AI-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"BedrockBizError": "Es ist ein Fehler bei der Anforderung des Bedrock-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"DeepSeekBizError": "Fehler bei der Anforderung des DeepSeek-Dienstes. Bitte überprüfen Sie die folgenden Informationen und versuchen Sie es erneut.",
"GoogleBizError": "Es ist ein Fehler bei der Anforderung des Google-Dienstes aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"GroqBizError": "Die Anfrage an den Groq-Dienst ist fehlgeschlagen. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"InvalidAccessCode": "Das Passwort ist ungültig oder leer. Bitte geben Sie das richtige Zugangspasswort ein oder fügen Sie einen benutzerdefinierten API-Schlüssel hinzu.",
"InvalidAnthropicAPIKey": "Ungültiger oder leerer Anthropic API-Schlüssel. Bitte überprüfen Sie den Anthropic API-Schlüssel und versuchen Sie es erneut.",
"InvalidAzureAPIKey": "Der Azure API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Azure API-Schlüssel und versuchen Sie es erneut.",
"InvalidBedrockCredentials": "Die Bedrock-Authentifizierung ist fehlgeschlagen. Bitte überprüfen Sie AccessKeyId/SecretAccessKey und versuchen Sie es erneut.",
"InvalidClerkUser": "Entschuldigung, du bist derzeit nicht angemeldet. Bitte melde dich an oder registriere ein Konto, um fortzufahren.",
"InvalidDeepSeekAPIKey": "DeepSeek-API-Schlüssel ungültig oder leer. Bitte überprüfen Sie den DeepSeek-API-Schlüssel und versuchen Sie es erneut.",
"InvalidGoogleAPIKey": "Der Google API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Google API-Schlüssel und versuchen Sie es erneut.",
"InvalidGroqAPIKey": "Der Groq API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Groq API-Schlüssel und versuchen Sie es erneut.",
"InvalidMinimaxAPIKey": "Ungültiger oder leerer Minimax-API-Schlüssel. Bitte überprüfen Sie den Minimax-API-Schlüssel und versuchen Sie es erneut.",
Expand Down
12 changes: 12 additions & 0 deletions locales/de-DE/modelProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@
"title": "Verwenden Sie benutzerdefinierte Bedrock-Authentifizierungsinformationen"
}
},
"deepseek": {
"title": "DeepSeek",
"token": {
"desc": "Geben Sie Ihren API-Schlüssel von DeepSeek ein",
"placeholder": "DeepSeek API-Schlüssel",
"title": "API-Schlüssel"
},
"unlock": {
"description": "Geben Sie Ihren DeepSeek API-Schlüssel ein, um die Sitzung zu starten. Die App speichert Ihren API-Schlüssel nicht.",
"title": "Verwenden Sie einen benutzerdefinierten DeepSeek API-Schlüssel"
}
},
"google": {
"title": "Google",
"token": {
Expand Down

0 comments on commit 18028f3

Please sign in to comment.