Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
4002ead6
Commit
4002ead6
authored
May 19, 2024
by
Jun Siang Cheah
Browse files
feat: store model configs in the database
parent
1bacd5d9
Changes
50
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
30 deletions
+20
-30
src/lib/i18n/locales/sr-RS/translation.json
src/lib/i18n/locales/sr-RS/translation.json
+2
-1
src/lib/i18n/locales/sv-SE/translation.json
src/lib/i18n/locales/sv-SE/translation.json
+2
-1
src/lib/i18n/locales/tr-TR/translation.json
src/lib/i18n/locales/tr-TR/translation.json
+2
-1
src/lib/i18n/locales/uk-UA/translation.json
src/lib/i18n/locales/uk-UA/translation.json
+2
-1
src/lib/i18n/locales/vi-VN/translation.json
src/lib/i18n/locales/vi-VN/translation.json
+2
-1
src/lib/i18n/locales/zh-CN/translation.json
src/lib/i18n/locales/zh-CN/translation.json
+2
-1
src/lib/i18n/locales/zh-TW/translation.json
src/lib/i18n/locales/zh-TW/translation.json
+2
-1
src/lib/stores/index.ts
src/lib/stores/index.ts
+2
-21
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+2
-1
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+2
-1
No files found.
src/lib/i18n/locales/sr-RS/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"Напредни параметри"
,
"Advanced Parameters"
:
"Напредни параметри"
,
"all"
:
"сви"
,
"all"
:
"сви"
,
"All Documents"
:
"Сви документи"
,
"All Documents"
:
"Сви документи"
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"Сви корисници"
,
"All Users"
:
"Сви корисници"
,
"Allow"
:
"Дозволи"
,
"Allow"
:
"Дозволи"
,
"Allow Chat Deletion"
:
"Дозволи брисање ћаскања"
,
"Allow Chat Deletion"
:
"Дозволи брисање ћаскања"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"Изабери модел"
,
"Select a model"
:
"Изабери модел"
,
"Select an Ollama instance"
:
"Изабери Ollama инстанцу"
,
"Select an Ollama instance"
:
"Изабери Ollama инстанцу"
,
"Select model"
:
"Изабери модел"
,
"Select model"
:
"Изабери модел"
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"Пошаљи поруку"
,
"Send a Message"
:
"Пошаљи поруку"
,
"Send message"
:
"Пошаљи поруку"
,
"Send message"
:
"Пошаљи поруку"
,
...
...
src/lib/i18n/locales/sv-SE/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"Avancerade parametrar"
,
"Advanced Parameters"
:
"Avancerade parametrar"
,
"all"
:
"alla"
,
"all"
:
"alla"
,
"All Documents"
:
""
,
"All Documents"
:
""
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"Alla användare"
,
"All Users"
:
"Alla användare"
,
"Allow"
:
"Tillåt"
,
"Allow"
:
"Tillåt"
,
"Allow Chat Deletion"
:
"Tillåt chattborttagning"
,
"Allow Chat Deletion"
:
"Tillåt chattborttagning"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"Välj en modell"
,
"Select a model"
:
"Välj en modell"
,
"Select an Ollama instance"
:
"Välj en Ollama-instans"
,
"Select an Ollama instance"
:
"Välj en Ollama-instans"
,
"Select model"
:
""
,
"Select model"
:
""
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"Skicka ett meddelande"
,
"Send a Message"
:
"Skicka ett meddelande"
,
"Send message"
:
"Skicka meddelande"
,
"Send message"
:
"Skicka meddelande"
,
...
...
src/lib/i18n/locales/tr-TR/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"Gelişmiş Parametreler"
,
"Advanced Parameters"
:
"Gelişmiş Parametreler"
,
"all"
:
"tümü"
,
"all"
:
"tümü"
,
"All Documents"
:
"Tüm Belgeler"
,
"All Documents"
:
"Tüm Belgeler"
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"Tüm Kullanıcılar"
,
"All Users"
:
"Tüm Kullanıcılar"
,
"Allow"
:
"İzin ver"
,
"Allow"
:
"İzin ver"
,
"Allow Chat Deletion"
:
"Sohbet Silmeye İzin Ver"
,
"Allow Chat Deletion"
:
"Sohbet Silmeye İzin Ver"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"Bir model seç"
,
"Select a model"
:
"Bir model seç"
,
"Select an Ollama instance"
:
"Bir Ollama örneği seçin"
,
"Select an Ollama instance"
:
"Bir Ollama örneği seçin"
,
"Select model"
:
"Model seç"
,
"Select model"
:
"Model seç"
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"Bir Mesaj Gönder"
,
"Send a Message"
:
"Bir Mesaj Gönder"
,
"Send message"
:
"Mesaj gönder"
,
"Send message"
:
"Mesaj gönder"
,
...
...
src/lib/i18n/locales/uk-UA/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"Розширені параметри"
,
"Advanced Parameters"
:
"Розширені параметри"
,
"all"
:
"всі"
,
"all"
:
"всі"
,
"All Documents"
:
"Усі документи"
,
"All Documents"
:
"Усі документи"
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"Всі користувачі"
,
"All Users"
:
"Всі користувачі"
,
"Allow"
:
"Дозволити"
,
"Allow"
:
"Дозволити"
,
"Allow Chat Deletion"
:
"Дозволити видалення чату"
,
"Allow Chat Deletion"
:
"Дозволити видалення чату"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"Виберіть модель"
,
"Select a model"
:
"Виберіть модель"
,
"Select an Ollama instance"
:
"Виберіть екземпляр Ollama"
,
"Select an Ollama instance"
:
"Виберіть екземпляр Ollama"
,
"Select model"
:
"Вибрати модель"
,
"Select model"
:
"Вибрати модель"
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"Надіслати повідомлення"
,
"Send a Message"
:
"Надіслати повідомлення"
,
"Send message"
:
"Надіслати повідомлення"
,
"Send message"
:
"Надіслати повідомлення"
,
...
...
src/lib/i18n/locales/vi-VN/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"Các tham số Nâng cao"
,
"Advanced Parameters"
:
"Các tham số Nâng cao"
,
"all"
:
"tất cả"
,
"all"
:
"tất cả"
,
"All Documents"
:
""
,
"All Documents"
:
""
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"Danh sách người sử dụng"
,
"All Users"
:
"Danh sách người sử dụng"
,
"Allow"
:
"Cho phép"
,
"Allow"
:
"Cho phép"
,
"Allow Chat Deletion"
:
"Cho phép Xóa nội dung chat"
,
"Allow Chat Deletion"
:
"Cho phép Xóa nội dung chat"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"Chọn mô hình"
,
"Select a model"
:
"Chọn mô hình"
,
"Select an Ollama instance"
:
"Chọn một thực thể Ollama"
,
"Select an Ollama instance"
:
"Chọn một thực thể Ollama"
,
"Select model"
:
""
,
"Select model"
:
""
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"Gửi yêu cầu"
,
"Send a Message"
:
"Gửi yêu cầu"
,
"Send message"
:
"Gửi yêu cầu"
,
"Send message"
:
"Gửi yêu cầu"
,
...
...
src/lib/i18n/locales/zh-CN/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"高级参数"
,
"Advanced Parameters"
:
"高级参数"
,
"all"
:
"所有"
,
"all"
:
"所有"
,
"All Documents"
:
"所有文档"
,
"All Documents"
:
"所有文档"
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"所有用户"
,
"All Users"
:
"所有用户"
,
"Allow"
:
"允许"
,
"Allow"
:
"允许"
,
"Allow Chat Deletion"
:
"允许删除聊天记录"
,
"Allow Chat Deletion"
:
"允许删除聊天记录"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"选择一个模型"
,
"Select a model"
:
"选择一个模型"
,
"Select an Ollama instance"
:
"选择一个 Ollama 实例"
,
"Select an Ollama instance"
:
"选择一个 Ollama 实例"
,
"Select model"
:
"选择模型"
,
"Select model"
:
"选择模型"
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
"发送"
,
"Send"
:
"发送"
,
"Send a Message"
:
"发送消息"
,
"Send a Message"
:
"发送消息"
,
"Send message"
:
"发送消息"
,
"Send message"
:
"发送消息"
,
...
...
src/lib/i18n/locales/zh-TW/translation.json
View file @
4002ead6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"Advanced Parameters"
:
"進階參數"
,
"Advanced Parameters"
:
"進階參數"
,
"all"
:
"所有"
,
"all"
:
"所有"
,
"All Documents"
:
""
,
"All Documents"
:
""
,
"All selected models do not support image input, removed images"
:
""
,
"All Users"
:
"所有使用者"
,
"All Users"
:
"所有使用者"
,
"Allow"
:
"允許"
,
"Allow"
:
"允許"
,
"Allow Chat Deletion"
:
"允許刪除聊天紀錄"
,
"Allow Chat Deletion"
:
"允許刪除聊天紀錄"
,
...
@@ -392,7 +393,7 @@
...
@@ -392,7 +393,7 @@
"Select a model"
:
"選擇一個模型"
,
"Select a model"
:
"選擇一個模型"
,
"Select an Ollama instance"
:
"選擇 Ollama 實例"
,
"Select an Ollama instance"
:
"選擇 Ollama 實例"
,
"Select model"
:
""
,
"Select model"
:
""
,
"Selected model do
es
not support image inputs
.
"
:
""
,
"Selected model
s
do not support image inputs"
:
""
,
"Send"
:
""
,
"Send"
:
""
,
"Send a Message"
:
"傳送訊息"
,
"Send a Message"
:
"傳送訊息"
,
"Send message"
:
"傳送訊息"
,
"Send message"
:
"傳送訊息"
,
...
...
src/lib/stores/index.ts
View file @
4002ead6
import
{
APP_NAME
}
from
'
$lib/constants
'
;
import
{
APP_NAME
}
from
'
$lib/constants
'
;
import
{
type
Writable
,
writable
}
from
'
svelte/store
'
;
import
{
type
Writable
,
writable
}
from
'
svelte/store
'
;
import
type
{
GlobalModelConfig
,
ModelConfig
}
from
'
$lib/apis
'
;
// Backend
// Backend
export
const
WEBUI_NAME
=
writable
(
APP_NAME
);
export
const
WEBUI_NAME
=
writable
(
APP_NAME
);
...
@@ -44,17 +45,10 @@ export const showChangelog = writable(false);
...
@@ -44,17 +45,10 @@ export const showChangelog = writable(false);
export
type
Model
=
OpenAIModel
|
OllamaModel
;
export
type
Model
=
OpenAIModel
|
OllamaModel
;
type
ModelCustomInfo
=
{
id
?:
string
;
name
?:
string
;
description
?:
string
;
vision_capable
?:
boolean
;
};
type
BaseModel
=
{
type
BaseModel
=
{
id
:
string
;
id
:
string
;
name
:
string
;
name
:
string
;
custom_info
?:
ModelC
ustomInfo
;
custom_info
?:
ModelC
onfig
;
};
};
export
interface
OpenAIModel
extends
BaseModel
{
export
interface
OpenAIModel
extends
BaseModel
{
...
@@ -143,19 +137,6 @@ type Config = {
...
@@ -143,19 +137,6 @@ type Config = {
model_config
?:
GlobalModelConfig
;
model_config
?:
GlobalModelConfig
;
};
};
type
GlobalModelConfig
=
{
ollama
?:
ModelConfig
[];
litellm
?:
ModelConfig
[];
openai
?:
ModelConfig
[];
};
type
ModelConfig
=
{
id
?:
string
;
name
?:
string
;
description
?:
string
;
vision_capable
?:
boolean
;
};
type
PromptSuggestion
=
{
type
PromptSuggestion
=
{
content
:
string
;
content
:
string
;
title
:
[
string
,
string
];
title
:
[
string
,
string
];
...
...
src/routes/(app)/+page.svelte
View file @
4002ead6
...
@@ -265,7 +265,7 @@
...
@@ -265,7 +265,7 @@
const
hasImages
=
messages
.
some
((
message
)
=>
const
hasImages
=
messages
.
some
((
message
)
=>
message
.
files
?.
some
((
file
)
=>
file
.
type
===
'image'
)
message
.
files
?.
some
((
file
)
=>
file
.
type
===
'image'
)
);
);
if
(
hasImages
&&
!(model.custom_info?.vision_capable ?? true)) {
if
(
hasImages
&&
!(model.custom_info?.
params.
vision_capable ?? true)) {
toast
.
error
(
toast
.
error
(
$
i18n
.
t
(
'Model {{modelName}} is not vision capable'
,
{
$
i18n
.
t
(
'Model {{modelName}} is not vision capable'
,
{
modelName
:
model
.
custom_info
?.
name
??
model
.
name
??
model
.
id
modelName
:
model
.
custom_info
?.
name
??
model
.
name
??
model
.
id
...
@@ -949,6 +949,7 @@
...
@@ -949,6 +949,7 @@
bind:prompt
bind:prompt
bind:autoScroll
bind:autoScroll
bind:selectedModel={atSelectedModel}
bind:selectedModel={atSelectedModel}
{selectedModels}
{messages}
{messages}
{submitPrompt}
{submitPrompt}
{stopResponse}
{stopResponse}
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
4002ead6
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
const
hasImages
=
messages
.
some
((
message
)
=>
const
hasImages
=
messages
.
some
((
message
)
=>
message
.
files
?.
some
((
file
)
=>
file
.
type
===
'image'
)
message
.
files
?.
some
((
file
)
=>
file
.
type
===
'image'
)
);
);
if
(
hasImages
&&
!(model.custom_info?.vision_capable ?? true)) {
if
(
hasImages
&&
!(model.custom_info?.
params.
vision_capable ?? true)) {
toast
.
error
(
toast
.
error
(
$
i18n
.
t
(
'Model {{modelName}} is not vision capable'
,
{
$
i18n
.
t
(
'Model {{modelName}} is not vision capable'
,
{
modelName
:
model
.
custom_info
?.
name
??
model
.
name
??
model
.
id
modelName
:
model
.
custom_info
?.
name
??
model
.
name
??
model
.
id
...
@@ -963,6 +963,7 @@
...
@@ -963,6 +963,7 @@
bind:prompt
bind:prompt
bind:autoScroll
bind:autoScroll
bind:selectedModel={atSelectedModel}
bind:selectedModel={atSelectedModel}
{selectedModels}
{messages}
{messages}
{submitPrompt}
{submitPrompt}
{stopResponse}
{stopResponse}
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment