diff --git a/gpt4all-chat/qml/AddRemoteModelView.qml b/gpt4all-chat/qml/AddRemoteModelView.qml index 547334a7..16de46ec 100644 --- a/gpt4all-chat/qml/AddRemoteModelView.qml +++ b/gpt4all-chat/qml/AddRemoteModelView.qml @@ -62,6 +62,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)); + } + } } RemoteModelCard { Layout.preferredWidth: 600 diff --git a/gpt4all-chat/qml/RemoteModelCard.qml b/gpt4all-chat/qml/RemoteModelCard.qml index 8bcc09d3..c96929d1 100644 --- a/gpt4all-chat/qml/RemoteModelCard.qml +++ b/gpt4all-chat/qml/RemoteModelCard.qml @@ -23,6 +23,9 @@ Rectangle { property alias providerDesc: providerDescLabel.helpText property string providerBaseUrl: "" property bool providerIsCustom: false + property var filterModels: function(names) { + return names; + }; color: theme.conversationBackground radius: 10 @@ -103,7 +106,7 @@ Rectangle { onTextChanged: { apiKeyField.placeholderTextColor = theme.mutedTextColor; if (!providerIsCustom) { - myModelList.model = ModelList.remoteModelList(apiKeyField.text, providerBaseUrl); + myModelList.model = filterModels(ModelList.remoteModelList(apiKeyField.text, providerBaseUrl)); myModelList.currentIndex = -1; } }