Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: support minimax as provider #2087

Merged
merged 25 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Expand Up @@ -100,6 +100,9 @@ OPENAI_API_KEY=sk-xxxxxxxxx

# MOONSHOT_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

### Minimax AI ####

# MINIMAX_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
############ Market Service ############
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Expand Up @@ -103,4 +103,7 @@ ENV ZEROONE_API_KEY ""
# TogetherAI
ENV TOGETHERAI_API_KEY ""

# Minimax
ENV MINIMAX_API_KEY ""

CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -129,6 +129,7 @@ We have implemented support for the following model service providers:
- **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/)
- **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/)

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 README.zh-CN.md
Expand Up @@ -128,6 +128,7 @@
- **01.AI (零一万物)**:集成了零一万物模型,系列 API 具备较快的推理速度,这不仅缩短了处理时间,同时也保持了出色的模型效果。[了解更多](https://www.lingyiwanwu.com/)
- **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/)

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

Expand Down
9 changes: 9 additions & 0 deletions docs/self-hosting/environment-variables/model-provider.mdx
Expand Up @@ -212,6 +212,15 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
- Default: -
- Example: `pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

## Minimax AI

### `MINIMAX_API_KEY`

- Type: Required
- Description: This is the API key you applied for in the Minimax AI service
- Default: -
- Example: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

## Mistral AI

### `MISTRAL_API_KEY`
Expand Down
Expand Up @@ -210,6 +210,15 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:-
- 示例:`pplx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

## Minimax AI

### `MINIMAX_API_KEY`

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

## Mistral AI

### `MISTRAL_API_KEY`
Expand Down
1 change: 1 addition & 0 deletions docs/usage/features/multi-ai-providers.mdx
Expand Up @@ -44,6 +44,7 @@ We have implemented support for the following model service providers:
- **OpenRouter**: Supports routing of models including **Claude 3**, **Gemma**, **Mistral**, **Llama2** and **Cohere**, with intelligent routing optimization to improve usage efficiency, open and flexible. [Learn more](https://openrouter.ai/)
- **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/)

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
Expand Up @@ -44,6 +44,7 @@ tags:
- **01.AI (零一万物)**:集成了零一万物模型,系列 API 具备较快的推理速度,这不仅缩短了处理时间,同时也保持了出色的模型效果。[了解更多](https://www.lingyiwanwu.com/)
- **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/)

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

Expand Down
2 changes: 2 additions & 0 deletions locales/ar/error.json
Expand Up @@ -45,6 +45,7 @@
"InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة",
"InvalidGoogleAPIKey": "مفتاح Google API غير صحيح أو فارغ، يرجى التحقق من مفتاح Google API وإعادة المحاولة",
"InvalidGroqAPIKey": "مفتاح Groq API غير صحيح أو فارغ، يرجى التحقق من مفتاح Groq API وإعادة المحاولة",
"InvalidMinimaxAPIKey": "مفتاح Minimax API غير صحيح أو فارغ، يرجى التحقق من مفتاح Minimax API وإعادة المحاولة",
"InvalidMistralAPIKey": "مفتاح Mistral AI API غير صحيح أو فارغ، يرجى التحقق من مفتاح Mistral API وإعادة المحاولة",
"InvalidMoonshotAPIKey": "مفتاح API لـ Moonshot AI غير صحيح أو فارغ، يرجى التحقق من مفتاح API لـ Moonshot وإعادة المحاولة",
"InvalidOllamaArgs": "تكوين Ollama غير صحيح، يرجى التحقق من تكوين Ollama وإعادة المحاولة",
Expand All @@ -54,6 +55,7 @@
"InvalidZeroOneAPIKey": "مفتاح ZeroOne API غير صحيح أو فارغ، يرجى التحقق من مفتاح ZeroOne API وإعادة المحاولة",
"InvalidZhipuAPIKey": "مفتاح Zhipu API غير صحيح أو فارغ، يرجى التحقق من مفتاح Zhipu API وإعادة المحاولة",
"LocationNotSupportError": "عذرًا، لا يدعم موقعك الحالي خدمة هذا النموذج، قد يكون ذلك بسبب قيود المنطقة أو عدم توفر الخدمة. يرجى التحقق مما إذا كان الموقع الحالي يدعم استخدام هذه الخدمة، أو محاولة استخدام معلومات الموقع الأخرى.",
"MinimaxBizError": "حدث خطأ في طلب خدمة Minimax، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"MistralBizError": "طلب خدمة Mistral AI خاطئ، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"MoonshotBizError": "حدث خطأ في خدمة جانب القمر، يرجى التحقق من المعلومات أدناه أو إعادة المحاولة",
"NoOpenAIAPIKey": "مفتاح API الخاص بـ OpenAI فارغ، يرجى إضافة مفتاح API الخاص بـ OpenAI",
Expand Down
12 changes: 12 additions & 0 deletions locales/ar/modelProvider.json
Expand Up @@ -95,6 +95,18 @@
"title": "استخدام مفتاح API الخاص بـ Groq المخصص"
}
},
"minimax": {
"title": "Minimax",
"token": {
"desc": "أدخل مفتاح API الخاص بـ Minimax",
"placeholder": "مفتاح API Minimax",
"title": "مفتاح API"
},
"unlock": {
"description": "قم بإدخال مفتاح API Minimax الخاص بك لبدء الجلسة. لن يتم تسجيل مفتاح الـ API الخاص بك من قبل التطبيق",
"title": "استخدام مفتاح API Minimax المخصص"
}
},
"mistral": {
"title": "Mistral AI",
"token": {
Expand Down
2 changes: 2 additions & 0 deletions locales/bg-BG/error.json
Expand Up @@ -45,6 +45,7 @@
"InvalidBedrockCredentials": "Удостоверяването на Bedrock е неуспешно. Моля, проверете AccessKeyId/SecretAccessKey и опитайте отново.",
"InvalidGoogleAPIKey": "API ключът на Google е неправилен или празен. Моля, проверете API ключа на Google и опитайте отново.",
"InvalidGroqAPIKey": "API ключът на Groq е неправилен или празен. Моля, проверете API ключа на Groq и опитайте отново.",
"InvalidMinimaxAPIKey": "Невалиден или липсващ ключ за Minimax API, моля проверете ключа за Minimax API и опитайте отново",
"InvalidMistralAPIKey": "Неправилен или празен API ключ на Mistral AI. Моля, проверете вашия API ключ на Mistral и опитайте отново.",
"InvalidMoonshotAPIKey": "API ключът на Moonshot AI е неправилен или празен, моля, проверете API ключа на Moonshot и опитайте отново.",
"InvalidOllamaArgs": "Невалидна конфигурация на Ollama, моля, проверете конфигурацията на Ollama и опитайте отново",
Expand All @@ -54,6 +55,7 @@
"InvalidZeroOneAPIKey": "API ключът на 01-AI е неправилен или празен. Моля, проверете API ключа на 01-AI и опитайте отново.",
"InvalidZhipuAPIKey": "API ключът на Zhipu е неправилен или празен. Моля, проверете API ключа на Zhipu и опитайте отново.",
"LocationNotSupportError": "Съжаляваме, вашето текущо местоположение не поддържа тази услуга на модела. Това може да се дължи на регионални ограничения или на недостъпност на услугата. Моля, потвърдете дали текущото местоположение поддържа използването на тази услуга или опитайте да използвате друго местоположение.",
"MinimaxBizError": "Грешка при заявка към услугата Minimax, моля проверете информацията по-долу или опитайте отново",
"MistralBizError": "Възникна грешка при заявка към услугата Mistral AI. Моля, отстранете неизправностите въз основа на следната информация или опитайте отново.",
"MoonshotBizError": "Възникна грешка с услугата Moonshot, моля, отстранете неизправностите или опитайте отново въз основа на следната информация.",
"NoOpenAIAPIKey": "API ключът на OpenAI е празен, моля, добавете персонализиран API ключ на OpenAI",
Expand Down
12 changes: 12 additions & 0 deletions locales/bg-BG/modelProvider.json
Expand Up @@ -95,6 +95,18 @@
"title": "Използване на персонализиран Groq API ключ"
}
},
"minimax": {
"title": "Минимакс",
"token": {
"desc": "Въведете API ключ от Минимакс",
"placeholder": "API ключ на Минимакс",
"title": "API ключ"
},
"unlock": {
"description": "Само въведете вашия API ключ от Минимакс, за да започнете сесия. Приложението няма да запази вашия API ключ",
"title": "Използване на персонализиран API ключ от Минимакс"
}
},
"mistral": {
"title": "Mistral AI",
"token": {
Expand Down
2 changes: 2 additions & 0 deletions locales/de-DE/error.json
Expand Up @@ -45,6 +45,7 @@
"InvalidBedrockCredentials": "Die Bedrock-Authentifizierung ist fehlgeschlagen. Bitte überprüfen Sie AccessKeyId/SecretAccessKey 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.",
"InvalidMistralAPIKey": "Der Mistral AI-API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Mistral-API-Schlüssel und versuchen Sie es erneut.",
"InvalidMoonshotAPIKey": "Ungültiger oder leerer Moonshot AI API-Schlüssel. Bitte überprüfen Sie den Moonshot API-Schlüssel und versuchen Sie es erneut.",
"InvalidOllamaArgs": "Ollama-Konfiguration ist ungültig. Bitte überprüfen Sie die Ollama-Konfiguration und versuchen Sie es erneut.",
Expand All @@ -54,6 +55,7 @@
"InvalidZeroOneAPIKey": "Ungültiger oder leerer ZeroOne-API-Schlüssel. Bitte überprüfen Sie den ZeroOne-API-Schlüssel und versuchen Sie es erneut.",
"InvalidZhipuAPIKey": "Der Zhipu API-Schlüssel ist ungültig oder leer. Bitte überprüfen Sie den Zhipu API-Schlüssel und versuchen Sie es erneut.",
"LocationNotSupportError": "Entschuldigung, Ihr Standort unterstützt diesen Modellservice möglicherweise aufgrund von regionalen Einschränkungen oder nicht aktivierten Diensten nicht. Bitte überprüfen Sie, ob der aktuelle Standort die Verwendung dieses Dienstes unterstützt, oder versuchen Sie, andere Standortinformationen zu verwenden.",
"MinimaxBizError": "Fehler beim Abrufen des Minimax-Dienstes. Bitte überprüfen Sie die folgenden Informationen und versuchen Sie es erneut.",
"MistralBizError": "Beim Anfordern des Mistral AI-Dienstes ist ein Fehler aufgetreten. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"MoonshotBizError": "Fehler beim Abrufen des Dark Side of the Moon-Services. Bitte überprüfen Sie die folgenden Informationen oder versuchen Sie es erneut.",
"NoOpenAIAPIKey": "Der OpenAI-API-Schlüssel ist leer. Bitte fügen Sie einen benutzerdefinierten OpenAI-API-Schlüssel hinzu",
Expand Down
12 changes: 12 additions & 0 deletions locales/de-DE/modelProvider.json
Expand Up @@ -95,6 +95,18 @@
"title": "Verwenden Sie einen individuellen Groq-API-Schlüssel"
}
},
"minimax": {
"title": "Minimax",
"token": {
"desc": "Geben Sie Ihren API-Schlüssel von Minimax ein",
"placeholder": "Minimax API-Schlüssel",
"title": "API-Schlüssel"
},
"unlock": {
"description": "Geben Sie Ihren Minimax API-Schlüssel ein, um die Sitzung zu starten. Die Anwendung speichert Ihren API-Schlüssel nicht.",
"title": "Verwenden Sie einen benutzerdefinierten Minimax API-Schlüssel"
}
},
"mistral": {
"title": "Mistral AI",
"token": {
Expand Down
2 changes: 2 additions & 0 deletions locales/en-US/error.json
Expand Up @@ -45,6 +45,7 @@
"InvalidBedrockCredentials": "Bedrock authentication failed. Please check the AccessKeyId/SecretAccessKey and retry.",
"InvalidGoogleAPIKey": "Google API Key is incorrect or empty. Please check the Google API Key and retry.",
"InvalidGroqAPIKey": "Groq API Key is incorrect or empty. Please check the Groq API Key and retry.",
"InvalidMinimaxAPIKey": "Incorrect or empty Minimax API Key, please check the Minimax API Key and try again",
"InvalidMistralAPIKey": "Incorrect or empty Mistral AI API Key. Please check your Mistral API Key and try again.",
"InvalidMoonshotAPIKey": "The Moonshot AI API Key is incorrect or empty, please check the Moonshot API Key and try again.",
"InvalidOllamaArgs": "Invalid Ollama configuration, please check Ollama configuration and try again",
Expand All @@ -54,6 +55,7 @@
"InvalidZeroOneAPIKey": "01-AI API Key is incorrect or empty. Please check the 01-AI API Key and retry.",
"InvalidZhipuAPIKey": "Zhipu API Key is incorrect or empty. Please check the Zhipu API Key and retry.",
"LocationNotSupportError": "We're sorry, your current location does not support this model service. This may be due to regional restrictions or the service not being available. Please confirm if the current location supports using this service, or try using a different location.",
"MinimaxBizError": "Error occurred while requesting Minimax service, please troubleshoot or retry based on the following information",
"MistralBizError": "Error occurred while requesting Mistral AI service. Please troubleshoot based on the following information or retry.",
"MoonshotBizError": "There was an error with the Moonshot service, please troubleshoot or retry based on the following information.",
"NoOpenAIAPIKey": "OpenAI API Key is empty, please add a custom OpenAI API Key",
Expand Down
12 changes: 12 additions & 0 deletions locales/en-US/modelProvider.json
Expand Up @@ -95,6 +95,18 @@
"title": "Use Custom Groq API Key"
}
},
"minimax": {
"title": "Minimax",
"token": {
"desc": "Enter your API Key from Minimax",
"placeholder": "Minimax API Key",
"title": "API Key"
},
"unlock": {
"description": "Enter your Minimax API Key to start the session. The app will not store your API Key.",
"title": "Use Custom Minimax API Key"
}
},
"mistral": {
"title": "Mistral AI",
"token": {
Expand Down