Skip to content

Commit

Permalink
✨ feat: support groq as a model provider (lobehub#1569)
Browse files Browse the repository at this point in the history
* ✨ feat: support model provider groq (lobehub#1562)

* add Groq localization (lobehub#1570)

* 🐛 fix: fix groq logo and document

* 🌐 style: add i18n

---------

Co-authored-by: Jiaqi Cai <45190310+jcdiv47@users.noreply.github.com>
Co-authored-by: PedroZ <sdustpedro@gmail.com>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 04b9c1d commit a04c364
Show file tree
Hide file tree
Showing 75 changed files with 577 additions and 21 deletions.
16 changes: 11 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,25 @@ OPENAI_API_KEY=sk-xxxxxxxxx
########### Mistral AI Service ##########
########################################

#MISTRAL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# MISTRAL_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
######### Perplexity Service ##########
######### Perplexity Service ###########
########################################

#PERPLEXITY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# PERPLEXITY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
######### Anthropic Service ##########
######### Anthropic Service ############
########################################

#ANTHROPIC_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# ANTHROPIC_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
############ Groq Service ##############
########################################

# GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

########################################
############ Market Service ############
Expand Down
11 changes: 9 additions & 2 deletions docs/self-hosting/environment-variables/model-provider.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Callout } from 'nextra/components';

# Model Service Providers

When deploying LobeChat, a rich set of environment variables related to model service providers is provided, allowing you to easily define the model service providers to be enabled in LobeChat.
Expand Down Expand Up @@ -163,6 +161,15 @@ When using the `turn` mode, the API Keys will be retrieved in a round-robin mann
- Default: -
- Example: `sk-ant-apixx-xxxxxxxxx-xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx`

## Groq AI

### `GROQ_API_KEY`

- Type: Required
- Description: This is the API key you applied from Groq AI
- Default: -
- Example: `gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

## Mistral AI

### `MISTRAL_API_KEY`
Expand Down
11 changes: 9 additions & 2 deletions docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Callout } from 'nextra/components';

# 模型服务商

LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,你可以使用这些环境变量轻松定义需要在 LobeChat 中开启的模型服务商。
Expand Down Expand Up @@ -170,4 +168,13 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:-
- 示例:`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=`

## Groq AI

### `GROQ_API_KEY`

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

[azure-api-verion-url]: https://docs.microsoft.com/zh-cn/azure/developer/javascript/api-reference/es-modules/azure-sdk/ai-translation/translationconfiguration?view=azure-node-latest#api-version
1 change: 1 addition & 0 deletions locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "أزور",
"bedrock": "بيدروك لأمازون ويب سيرفيس",
"google": "جوجل",
"groq": "Groq",
"mistral": "Mistral AI",
"moonshot": "مونشوت الذكاء الاصطناعي",
"ollama": "أولاما",
Expand Down
6 changes: 6 additions & 0 deletions locales/ar/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
"AzureBizError": "حدث خطأ في طلب خدمة Azure AI، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"BedrockBizError": "حدث خطأ في طلب خدمة Bedrock، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"GoogleBizError": "حدث خطأ في طلب خدمة Google، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"GroqBizError": "حدث خطأ في خدمة Groq ، يرجى التحقق من المعلومات التالية أو إعادة المحاولة",
"InvalidAccessCode": "كلمة المرور غير صحيحة أو فارغة، يرجى إدخال كلمة مرور الوصول الصحيحة أو إضافة مفتاح API مخصص",
"InvalidAnthropicAPIKey": "مفتاح Anthropic API غير صحيح أو فارغ، يرجى التحقق من مفتاح Anthropic API وإعادة المحاولة",
"InvalidAzureAPIKey": "مفتاح Azure API غير صحيح أو فارغ، يرجى التحقق من مفتاح Azure API وإعادة المحاولة",
"InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة",
"InvalidGoogleAPIKey": "مفتاح Google API غير صحيح أو فارغ، يرجى التحقق من مفتاح Google API وإعادة المحاولة",
"InvalidGroqAPIKey": "مفتاح Groq API غير صحيح أو فارغ، يرجى التحقق من مفتاح Groq API وإعادة المحاولة",
"InvalidMistralAPIKey": "مفتاح Mistral AI API غير صحيح أو فارغ، يرجى التحقق من مفتاح Mistral API وإعادة المحاولة",
"InvalidMoonshotAPIKey": "مفتاح API لـ Moonshot AI غير صحيح أو فارغ، يرجى التحقق من مفتاح API لـ Moonshot وإعادة المحاولة",
"InvalidOllamaArgs": "تكوين Ollama غير صحيح، يرجى التحقق من تكوين Ollama وإعادة المحاولة",
Expand Down Expand Up @@ -91,6 +93,10 @@
"description": "أدخل مفتاح Google API الخاص بك لبدء الجلسة. لن يقوم التطبيق بتسجيل مفتاح الواجهة البرمجية الخاص بك",
"title": "استخدام مفتاح Google API المخصص"
},
"Groq": {
"description": "قم بإدخال مفتاح API الخاص بك لـ Groq للبدء في الجلسة. لن يتم تسجيل مفتاح الخاص بك من قبل التطبيق",
"title": "استخدام مفتاح API الخاص بـ Groq المخصص"
},
"Mistral": {
"description": "أدخل مفتاح Mistral AI API الخاص بك لبدء الجلسة. لن يتم تسجيل مفتاح الواجهة البرمجية الخاص بك من قبل التطبيق",
"title": "استخدام مفتاح Mistral AI API المخصص"
Expand Down
8 changes: 8 additions & 0 deletions locales/ar/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"title": "مفتاح واجهة برمجة التطبيقات"
}
},
"Groq": {
"title": "Groq",
"token": {
"desc": "أدخل مفتاح API الخاص بـ Groq",
"placeholder": "مفتاح API Groq",
"title": "مفتاح API"
}
},
"Mistral": {
"title": "Mistral AI",
"token": {
Expand Down
1 change: 1 addition & 0 deletions locales/de-DE/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "Azure",
"bedrock": "AWS Bedrock",
"google": "Google",
"groq": "Groq",
"mistral": "Mistral KI",
"moonshot": "Moonshot KI",
"ollama": "Ollama",
Expand Down
6 changes: 6 additions & 0 deletions locales/de-DE/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
"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.",
"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.",
"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.",
"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 Down Expand Up @@ -91,6 +93,10 @@
"description": "Geben Sie Ihren Google API-Schlüssel ein, um die Sitzung zu starten. Die Anwendung speichert Ihren API-Schlüssel nicht.",
"title": "Verwenden von benutzerdefinierten Google API-Schlüssel"
},
"Groq": {
"description": "Geben Sie Ihren individuellen Groq-API-Schlüssel ein, um die Sitzung zu starten. Die Anwendung speichert Ihren API-Schlüssel nicht.",
"title": "Verwenden Sie einen benutzerdefinierten Groq-API-Schlüssel"
},
"Mistral": {
"description": "Geben Sie Ihren eigenen Mistral AI-API-Schlüssel ein, um die Sitzung zu starten. Die App speichert Ihren API-Schlüssel nicht.",
"title": "Verwenden Sie einen benutzerdefinierten Mistral AI-API-Schlüssel"
Expand Down
8 changes: 8 additions & 0 deletions locales/de-DE/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"title": "API-Schlüssel"
}
},
"Groq": {
"title": "Groq",
"token": {
"desc": "Geben Sie den API-Schlüssel von Groq ein",
"placeholder": "Groq API-Schlüssel",
"title": "API-Schlüssel"
}
},
"Mistral": {
"title": "Mistral KI",
"token": {
Expand Down
1 change: 1 addition & 0 deletions locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "Azure",
"bedrock": "AWS Bedrock",
"google": "Google",
"groq": "Groq",
"mistral": "Mistral AI",
"moonshot": "Moonshot AI",
"ollama": "Ollama",
Expand Down
6 changes: 6 additions & 0 deletions locales/en-US/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
"AzureBizError": "Error requesting Azure AI service. Please troubleshoot or retry based on the following information.",
"BedrockBizError": "Error requesting Bedrock service. Please troubleshoot or retry based on the following information.",
"GoogleBizError": "Error requesting Google service. Please troubleshoot or retry based on the following information.",
"GroqBizError": "Error occurred while requesting Groq service. Please troubleshoot based on the following information or retry.",
"InvalidAccessCode": "Invalid access code or empty. Please enter the correct access code or add a custom API Key.",
"InvalidAnthropicAPIKey": "The Anthropic API Key is incorrect or empty. Please check the Anthropic API Key and retry.",
"InvalidAzureAPIKey": "Azure API Key is incorrect or empty. Please check the Azure API Key and retry.",
"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.",
"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 Down Expand Up @@ -91,6 +93,10 @@
"description": "Enter your Google API Key to start the session. The app will not store your API Key.",
"title": "Use custom Google API Key"
},
"Groq": {
"description": "Enter your Groq API Key to start the session. The application will not store your API Key.",
"title": "Use Custom Groq API Key"
},
"Mistral": {
"description": "Enter your Mistral AI API Key to start the session. The application will not store your API Key.",
"title": "Use Custom Mistral AI API Key"
Expand Down
8 changes: 8 additions & 0 deletions locales/en-US/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"title": "API Key"
}
},
"Groq": {
"title": "Groq",
"token": {
"desc": "Enter the API Key from Groq",
"placeholder": "Groq API Key",
"title": "API Key"
}
},
"Mistral": {
"title": "Mistral AI",
"token": {
Expand Down
1 change: 1 addition & 0 deletions locales/es-ES/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "Azure",
"bedrock": "AWS Bedrock",
"google": "Google",
"groq": "Groq",
"mistral": "Mistral IA",
"moonshot": "Moonshot IA",
"ollama": "Ollama",
Expand Down
6 changes: 6 additions & 0 deletions locales/es-ES/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
"AzureBizError": "Se produjo un error al solicitar el servicio de Azure AI, por favor, verifica la siguiente información o inténtalo de nuevo",
"BedrockBizError": "Se produjo un error al solicitar el servicio de Bedrock, por favor, verifica la siguiente información o inténtalo de nuevo",
"GoogleBizError": "Se produjo un error al solicitar el servicio de Google, por favor, verifica la siguiente información o inténtalo de nuevo",
"GroqBizError": "Se produjo un error al solicitar el servicio Groq. Por favor, revise la siguiente información o inténtelo de nuevo",
"InvalidAccessCode": "La contraseña no es válida o está vacía. Por favor, introduce una contraseña de acceso válida o añade una clave API personalizada",
"InvalidAnthropicAPIKey": "La clave de API de Anthropic es incorrecta o está vacía. Por favor, revisa la clave de API de Anthropic e inténtalo de nuevo.",
"InvalidAzureAPIKey": "La clave de API de Azure es incorrecta o está vacía, por favor, verifica la clave de API de Azure e inténtalo de nuevo",
"InvalidBedrockCredentials": "La autenticación de Bedrock no se ha completado con éxito, por favor, verifica AccessKeyId/SecretAccessKey e inténtalo de nuevo",
"InvalidGoogleAPIKey": "La clave de API de Google es incorrecta o está vacía, por favor, verifica la clave de API de Google e inténtalo de nuevo",
"InvalidGroqAPIKey": "La clave de API de Groq es incorrecta o está vacía. Por favor, revisa la clave de API de Groq e inténtalo de nuevo.",
"InvalidMistralAPIKey": "La clave de API de Mistral AI es incorrecta o está vacía. Por favor, revise la clave de API de Mistral y vuelva a intentarlo.",
"InvalidMoonshotAPIKey": "La clave de API de Moonshot AI no es válida o está vacía. Por favor, revise la clave de API de Moonshot e inténtelo de nuevo.",
"InvalidOllamaArgs": "La configuración de Ollama no es válida, por favor revisa la configuración de Ollama e inténtalo de nuevo",
Expand Down Expand Up @@ -91,6 +93,10 @@
"description": "Ingresa tu clave de API de Google para comenzar la sesión. La aplicación no guardará tu clave de API",
"title": "Usar clave de API personalizada de Google"
},
"Groq": {
"description": "Ingresa tu clave de API de Groq para comenzar la sesión. La aplicación no almacenará tu clave de API",
"title": "Usar clave de API personalizada de Groq"
},
"Mistral": {
"description": "Ingrese su clave de API de Mistral AI para comenzar la sesión. La aplicación no almacenará su clave de API.",
"title": "Usar clave de API personalizada de Mistral AI"
Expand Down
8 changes: 8 additions & 0 deletions locales/es-ES/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"title": "Clave API"
}
},
"Groq": {
"title": "Groq",
"token": {
"desc": "Ingresa la clave API de Groq",
"placeholder": "Clave API de Groq",
"title": "Clave API"
}
},
"Mistral": {
"title": "Mistral AI",
"token": {
Expand Down
1 change: 1 addition & 0 deletions locales/fr-FR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "Azure",
"bedrock": "AWS Bedrock",
"google": "Google",
"groq": "Groq",
"mistral": "Mistral AI",
"moonshot": "Moonshot IA",
"ollama": "Ollama",
Expand Down
6 changes: 6 additions & 0 deletions locales/fr-FR/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
"AzureBizError": "Erreur lors de la demande de service Azure AI, veuillez vérifier les informations ci-dessous ou réessayer",
"BedrockBizError": "Erreur lors de la demande de service Bedrock, veuillez vérifier les informations ci-dessous ou réessayer",
"GoogleBizError": "Erreur lors de la demande de service Google, veuillez vérifier les informations ci-dessous ou réessayer",
"GroqBizError": "Une erreur s'est produite lors de la demande de service Groq. Veuillez vérifier les informations ci-dessous ou réessayer.",
"InvalidAccessCode": "Le mot de passe est incorrect ou vide. Veuillez saisir le mot de passe d'accès correct ou ajouter une clé API personnalisée.",
"InvalidAnthropicAPIKey": "La clé API Anthropic est incorrecte ou manquante. Veuillez vérifier la clé API Anthropic et réessayer.",
"InvalidAzureAPIKey": "Clé API Azure incorrecte ou vide, veuillez vérifier la clé API Azure et réessayer",
"InvalidBedrockCredentials": "L'authentification Bedrock a échoué, veuillez vérifier AccessKeyId/SecretAccessKey et réessayer",
"InvalidGoogleAPIKey": "Clé API Google incorrecte ou vide, veuillez vérifier la clé API Google et réessayer",
"InvalidGroqAPIKey": "Clé API Groq incorrecte ou vide, veuillez vérifier la clé API Groq et réessayer",
"InvalidMistralAPIKey": "Clé API Mistral AI incorrecte ou manquante. Veuillez vérifier la clé API Mistral et réessayer.",
"InvalidMoonshotAPIKey": "Clé API Moonshot AI incorrecte ou manquante. Veuillez vérifier la clé API Moonshot et réessayer.",
"InvalidOllamaArgs": "La configuration d'Ollama n'est pas valide, veuillez vérifier la configuration d'Ollama et réessayer",
Expand Down Expand Up @@ -91,6 +93,10 @@
"description": "Entrez votre clé API Google pour commencer la session. L'application ne conservera pas votre clé API",
"title": "Utiliser une clé API Google personnalisée"
},
"Groq": {
"description": "Entrez votre clé d'API Groq pour commencer la session. L'application ne stockera pas votre clé d'API.",
"title": "Utiliser une clé d'API Groq personnalisée"
},
"Mistral": {
"description": "Entrez votre clé API Mistral AI pour commencer la session. L'application ne stockera pas votre clé API.",
"title": "Utiliser une clé API Mistral AI personnalisée"
Expand Down
8 changes: 8 additions & 0 deletions locales/fr-FR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"title": "Clé API"
}
},
"Groq": {
"title": "Groq",
"token": {
"desc": "Entrez la clé API de Groq",
"placeholder": "Clé API Groq",
"title": "Clé API"
}
},
"Mistral": {
"title": "Mistral AI",
"token": {
Expand Down
1 change: 1 addition & 0 deletions locales/it-IT/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"azure": "Azure",
"bedrock": "AWS Bedrock",
"google": "Google",
"groq": "Groq",
"mistral": "Mistral AI",
"moonshot": "Moonshot AI",
"ollama": "Ollama",
Expand Down
Loading

0 comments on commit a04c364

Please sign in to comment.