Skip to content

Commit 4d17183

Browse files
manyosocebtenzzre
andauthored
Add new remote model provider view. (#3506)
Signed-off-by: Adam Treat <[email protected]> Signed-off-by: AT <[email protected]> Signed-off-by: Jared Van Bortel <[email protected]> Co-authored-by: Jared Van Bortel <[email protected]>
1 parent 0c28ee7 commit 4d17183

File tree

12 files changed

+474
-126
lines changed

12 files changed

+474
-126
lines changed

gpt4all-chat/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
99
### Added
1010
- Whitelist Granite (non-MoE) model architecture (by [@ThiloteE](https://github.com/ThiloteE) in [#3487](https://github.com/nomic-ai/gpt4all/pull/3487))
1111
- Add support for CUDA compute 5.0 GPUs such as the GTX 750 ([#3499](https://github.com/nomic-ai/gpt4all/pull/3499))
12+
- Add a Remote Providers tab to the Add Model page ([#3506](https://github.com/nomic-ai/gpt4all/pull/3506))
1213

1314
### Changed
1415
- Substitute prettier default templates for OLMoE 7B 0924/0125 and Granite 3.1 3B/8B (by [@ThiloteE](https://github.com/ThiloteE) in [#3471](https://github.com/nomic-ai/gpt4all/pull/3471))

gpt4all-chat/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ qt_add_qml_module(chat
266266
qml/AddModelView.qml
267267
qml/AddGPT4AllModelView.qml
268268
qml/AddHFModelView.qml
269+
qml/AddRemoteModelView.qml
269270
qml/ApplicationSettings.qml
270271
qml/ChatDrawer.qml
271272
qml/ChatCollapsibleItem.qml
@@ -314,6 +315,7 @@ qt_add_qml_module(chat
314315
qml/MyTextField.qml
315316
qml/MyToolButton.qml
316317
qml/MyWelcomeButton.qml
318+
qml/RemoteModelCard.qml
317319
RESOURCES
318320
icons/antenna_1.svg
319321
icons/antenna_2.svg
@@ -344,19 +346,22 @@ qt_add_qml_module(chat
344346
icons/gpt4all-48.png
345347
icons/gpt4all.svg
346348
icons/gpt4all_transparent.svg
349+
icons/groq.svg
347350
icons/home.svg
348351
icons/image.svg
349352
icons/info.svg
350353
icons/left_panel_closed.svg
351354
icons/left_panel_open.svg
352355
icons/local-docs.svg
353356
icons/models.svg
357+
icons/mistral.svg
354358
icons/network.svg
355359
icons/nomic_logo.svg
356360
icons/notes.svg
357361
icons/paperclip.svg
358362
icons/plus.svg
359363
icons/plus_circle.svg
364+
icons/openai.svg
360365
icons/recycle.svg
361366
icons/regenerate.svg
362367
icons/search.svg

gpt4all-chat/icons/groq.svg

Lines changed: 3 additions & 0 deletions
Loading

gpt4all-chat/icons/mistral.svg

Lines changed: 1 addition & 0 deletions
Loading

gpt4all-chat/icons/openai.svg

Lines changed: 2 additions & 0 deletions
Loading

gpt4all-chat/qml/AddGPT4AllModelView.qml

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ ColumnLayout {
204204
Layout.minimumWidth: 200
205205
Layout.fillWidth: true
206206
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
207-
visible: !isOnline && !installed && !calcHash && downloadError === ""
207+
visible: !installed && !calcHash && downloadError === ""
208208
Accessible.description: qsTr("Stop/restart/start the download")
209209
onClicked: {
210210
if (!isDownloading) {
@@ -230,52 +230,6 @@ ColumnLayout {
230230
}
231231
}
232232

233-
MySettingsButton {
234-
id: installButton
235-
visible: !installed && isOnline
236-
Layout.topMargin: 20
237-
Layout.leftMargin: 20
238-
Layout.minimumWidth: 200
239-
Layout.fillWidth: true
240-
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
241-
text: qsTr("Install")
242-
font.pixelSize: theme.fontSizeLarge
243-
onClicked: {
244-
var apiKeyText = apiKey.text.trim(),
245-
baseUrlText = baseUrl.text.trim(),
246-
modelNameText = modelName.text.trim();
247-
248-
var apiKeyOk = apiKeyText !== "",
249-
baseUrlOk = !isCompatibleApi || baseUrlText !== "",
250-
modelNameOk = !isCompatibleApi || modelNameText !== "";
251-
252-
if (!apiKeyOk)
253-
apiKey.showError();
254-
if (!baseUrlOk)
255-
baseUrl.showError();
256-
if (!modelNameOk)
257-
modelName.showError();
258-
259-
if (!apiKeyOk || !baseUrlOk || !modelNameOk)
260-
return;
261-
262-
if (!isCompatibleApi)
263-
Download.installModel(
264-
filename,
265-
apiKeyText,
266-
);
267-
else
268-
Download.installCompatibleModel(
269-
modelNameText,
270-
apiKeyText,
271-
baseUrlText,
272-
);
273-
}
274-
Accessible.role: Accessible.Button
275-
Accessible.name: qsTr("Install")
276-
Accessible.description: qsTr("Install online model")
277-
}
278-
279233
ColumnLayout {
280234
spacing: 0
281235
Label {
@@ -390,69 +344,6 @@ ColumnLayout {
390344
Accessible.description: qsTr("Displayed when the file hash is being calculated")
391345
}
392346
}
393-
394-
MyTextField {
395-
id: apiKey
396-
visible: !installed && isOnline
397-
Layout.topMargin: 20
398-
Layout.leftMargin: 20
399-
Layout.minimumWidth: 200
400-
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
401-
wrapMode: Text.WrapAnywhere
402-
function showError() {
403-
messageToast.show(qsTr("ERROR: $API_KEY is empty."));
404-
apiKey.placeholderTextColor = theme.textErrorColor;
405-
}
406-
onTextChanged: {
407-
apiKey.placeholderTextColor = theme.mutedTextColor;
408-
}
409-
placeholderText: qsTr("enter $API_KEY")
410-
Accessible.role: Accessible.EditableText
411-
Accessible.name: placeholderText
412-
Accessible.description: qsTr("Whether the file hash is being calculated")
413-
}
414-
415-
MyTextField {
416-
id: baseUrl
417-
visible: !installed && isOnline && isCompatibleApi
418-
Layout.topMargin: 20
419-
Layout.leftMargin: 20
420-
Layout.minimumWidth: 200
421-
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
422-
wrapMode: Text.WrapAnywhere
423-
function showError() {
424-
messageToast.show(qsTr("ERROR: $BASE_URL is empty."));
425-
baseUrl.placeholderTextColor = theme.textErrorColor;
426-
}
427-
onTextChanged: {
428-
baseUrl.placeholderTextColor = theme.mutedTextColor;
429-
}
430-
placeholderText: qsTr("enter $BASE_URL")
431-
Accessible.role: Accessible.EditableText
432-
Accessible.name: placeholderText
433-
Accessible.description: qsTr("Whether the file hash is being calculated")
434-
}
435-
436-
MyTextField {
437-
id: modelName
438-
visible: !installed && isOnline && isCompatibleApi
439-
Layout.topMargin: 20
440-
Layout.leftMargin: 20
441-
Layout.minimumWidth: 200
442-
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
443-
wrapMode: Text.WrapAnywhere
444-
function showError() {
445-
messageToast.show(qsTr("ERROR: $MODEL_NAME is empty."))
446-
modelName.placeholderTextColor = theme.textErrorColor;
447-
}
448-
onTextChanged: {
449-
modelName.placeholderTextColor = theme.mutedTextColor;
450-
}
451-
placeholderText: qsTr("enter $MODEL_NAME")
452-
Accessible.role: Accessible.EditableText
453-
Accessible.name: placeholderText
454-
Accessible.description: qsTr("Whether the file hash is being calculated")
455-
}
456347
}
457348
}
458349
}

gpt4all-chat/qml/AddModelView.qml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ Rectangle {
8989
gpt4AllModelView.show();
9090
}
9191
}
92+
MyTabButton {
93+
text: qsTr("Remote Providers")
94+
isSelected: remoteModelView.isShown()
95+
onPressed: {
96+
remoteModelView.show();
97+
}
98+
}
9299
MyTabButton {
93100
text: qsTr("HuggingFace")
94101
isSelected: huggingfaceModelView.isShown()
@@ -112,7 +119,20 @@ Rectangle {
112119
stackLayout.currentIndex = 0;
113120
}
114121
function isShown() {
115-
return stackLayout.currentIndex === 0
122+
return stackLayout.currentIndex === 0;
123+
}
124+
}
125+
126+
AddRemoteModelView {
127+
id: remoteModelView
128+
Layout.fillWidth: true
129+
Layout.fillHeight: true
130+
131+
function show() {
132+
stackLayout.currentIndex = 1;
133+
}
134+
function isShown() {
135+
return stackLayout.currentIndex === 1;
116136
}
117137
}
118138

@@ -126,10 +146,10 @@ Rectangle {
126146
anchors.fill: parent
127147

128148
function show() {
129-
stackLayout.currentIndex = 1;
149+
stackLayout.currentIndex = 2;
130150
}
131151
function isShown() {
132-
return stackLayout.currentIndex === 1
152+
return stackLayout.currentIndex === 2;
133153
}
134154
}
135155
}

0 commit comments

Comments
 (0)