From 4f97e8fef0a2102e12cb5720c006ee1078a010ba Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Mon, 24 Feb 2025 14:01:02 -0500 Subject: [PATCH] add whitelists for Groq and Mistral Signed-off-by: Jared Van Bortel --- gpt4all-chat/qml/AddRemoteModelView.qml | 71 +++++++++++++++++++++---- gpt4all-chat/qml/RemoteModelCard.qml | 9 ++-- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/gpt4all-chat/qml/AddRemoteModelView.qml b/gpt4all-chat/qml/AddRemoteModelView.qml index 75d5d4df..bca28199 100644 --- a/gpt4all-chat/qml/AddRemoteModelView.qml +++ b/gpt4all-chat/qml/AddRemoteModelView.qml @@ -55,6 +55,22 @@ ColumnLayout { providerName: qsTr("Groq") providerImage: "qrc:/gpt4all/icons/groq.svg" providerDesc: qsTr('Groq offers a high-performance AI inference engine designed for low-latency and efficient processing. Optimized for real-time applications, Groq’s technology is ideal for users who need fast responses from open large language models and other AI workloads.

Get your API key: https://groq.com/') + modelWhitelist: [ + // last updated 2025-02-24 + "deepseek-r1-distill-llama-70b", + "deepseek-r1-distill-qwen-32b", + "gemma2-9b-it", + "llama-3.1-8b-instant", + "llama-3.2-1b-preview", + "llama-3.2-3b-preview", + "llama-3.3-70b-specdec", + "llama-3.3-70b-versatile", + "llama3-70b-8192", + "llama3-8b-8192", + "mixtral-8x7b-32768", + "qwen-2.5-32b", + "qwen-2.5-coder-32b", + ] } RemoteModelCard { width: parent.childWidth @@ -63,15 +79,15 @@ ColumnLayout { providerName: qsTr("OpenAI") providerImage: "qrc:/gpt4all/icons/openai.svg" providerDesc: qsTr('OpenAI provides access to advanced AI models, including GPT-4 supporting a wide range of applications, from conversational AI to content generation and code completion.

Get your API key: https://openai.com/') - Component.onCompleted: { - filterModels = function(names) { - // Define a whitelist of allowed names - var whitelist = ["gpt-3.5-turbo", "gpt-4o", "gpt-4", "gpt-4-turbo", "gpt-4-32k", "gpt-3.5-turbo-16k"]; - - // Filter names based on the whitelist - return names.filter(name => whitelist.includes(name)); - } - } + modelWhitelist: [ + // last updated 2025-02-24 + "gpt-3.5-turbo", + "gpt-3.5-turbo-16k", + "gpt-4", + "gpt-4-32k", + "gpt-4-turbo", + "gpt-4o", + ] } RemoteModelCard { width: parent.childWidth @@ -80,6 +96,43 @@ ColumnLayout { providerName: qsTr("Mistral") providerImage: "qrc:/gpt4all/icons/mistral.svg" providerDesc: qsTr('Mistral AI specializes in efficient, open-weight language models optimized for various natural language processing tasks. Their models are designed for flexibility and performance, making them a solid option for applications requiring scalable AI solutions.

Get your API key: https://mistral.ai/') + modelWhitelist: [ + // last updated 2025-02-24 + "codestral-2405", + "codestral-2411-rc5", + "codestral-2412", + "codestral-2501", + "codestral-latest", + "codestral-mamba-2407", + "codestral-mamba-latest", + "ministral-3b-2410", + "ministral-3b-latest", + "ministral-8b-2410", + "ministral-8b-latest", + "mistral-large-2402", + "mistral-large-2407", + "mistral-large-2411", + "mistral-large-latest", + "mistral-medium-2312", + "mistral-medium-latest", + "mistral-saba-2502", + "mistral-saba-latest", + "mistral-small-2312", + "mistral-small-2402", + "mistral-small-2409", + "mistral-small-2501", + "mistral-small-latest", + "mistral-tiny-2312", + "mistral-tiny-2407", + "mistral-tiny-latest", + "open-codestral-mamba", + "open-mistral-7b", + "open-mistral-nemo", + "open-mistral-nemo-2407", + "open-mixtral-8x22b", + "open-mixtral-8x22b-2404", + "open-mixtral-8x7b", + ] } RemoteModelCard { width: parent.childWidth diff --git a/gpt4all-chat/qml/RemoteModelCard.qml b/gpt4all-chat/qml/RemoteModelCard.qml index f7e8d4fb..e8c63765 100644 --- a/gpt4all-chat/qml/RemoteModelCard.qml +++ b/gpt4all-chat/qml/RemoteModelCard.qml @@ -23,9 +23,7 @@ Rectangle { property alias providerDesc: providerDescLabel.text property string providerBaseUrl: "" property bool providerIsCustom: false - property var filterModels: function(names) { - return names; - }; + property var modelWhitelist: null color: theme.conversationBackground radius: 10 @@ -109,7 +107,10 @@ Rectangle { onTextChanged: { apiKeyField.placeholderTextColor = theme.mutedTextColor; if (!providerIsCustom) { - myModelList.model = filterModels(ModelList.remoteModelList(apiKeyField.text, providerBaseUrl)); + let models = ModelList.remoteModelList(apiKeyField.text, providerBaseUrl); + if (modelWhitelist !== null) + models = models.filter(m => modelWhitelist.includes(m)); + myModelList.model = models; myModelList.currentIndex = -1; } }