diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx
index 080c19b0b..955a43a31 100644
--- a/web-app/src/containers/ChatInput.tsx
+++ b/web-app/src/containers/ChatInput.tsx
@@ -104,17 +104,7 @@ const ChatInput = ({ model, className, initialMessage }: ChatInputProps) => {
if (selectedModel && selectedModel?.id) {
try {
// Only check mmproj for llamacpp provider
- if (selectedProvider === 'llamacpp') {
- const hasLocalMmproj = await serviceHub
- .models()
- .checkMmprojExists(selectedModel.id)
- setHasMmproj(hasLocalMmproj)
- }
- // For non-llamacpp providers, only check vision capability
- else if (
- selectedProvider !== 'llamacpp' &&
- selectedModel?.capabilities?.includes('vision')
- ) {
+ if (selectedModel?.capabilities?.includes('vision')) {
setHasMmproj(true)
} else {
setHasMmproj(false)
diff --git a/web-app/src/containers/DropdownModelProvider.tsx b/web-app/src/containers/DropdownModelProvider.tsx
index d4f5cec36..db959ebd4 100644
--- a/web-app/src/containers/DropdownModelProvider.tsx
+++ b/web-app/src/containers/DropdownModelProvider.tsx
@@ -119,13 +119,20 @@ const DropdownModelProvider = ({
const model = provider.models[modelIndex]
const capabilities = model.capabilities || []
- // Add 'vision' capability if not already present
- if (!capabilities.includes('vision')) {
+ // Add 'vision' capability if not already present AND if user hasn't manually configured capabilities
+ // Check if model has a custom capabilities config flag
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const hasUserConfiguredCapabilities = (model as any)._userConfiguredCapabilities === true
+
+ if (!capabilities.includes('vision') && !hasUserConfiguredCapabilities) {
const updatedModels = [...provider.models]
updatedModels[modelIndex] = {
...model,
capabilities: [...capabilities, 'vision'],
- }
+ // Mark this as auto-detected, not user-configured
+ _autoDetectedVision: true,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ } as any
updateProvider('llamacpp', { models: updatedModels })
}
diff --git a/web-app/src/containers/dialogs/EditModel.tsx b/web-app/src/containers/dialogs/EditModel.tsx
index 68a268640..a07a5ae94 100644
--- a/web-app/src/containers/dialogs/EditModel.tsx
+++ b/web-app/src/containers/dialogs/EditModel.tsx
@@ -13,6 +13,7 @@ import {
IconPencil,
IconEye,
IconTool,
+ IconAlertTriangle,
// IconWorld,
// IconAtom,
// IconCodeCircle2,
@@ -105,6 +106,8 @@ export const DialogEditModel = ({
return {
...m,
capabilities: updatedCapabilities,
+ // Mark that user has manually configured capabilities
+ _userConfiguredCapabilities: true,
}
}
return m
@@ -145,6 +148,21 @@ export const DialogEditModel = ({
+ {/* Warning Banner */}
+
+
+
+
+
+ {t('providers:editModel.warning.title')}
+
+
+ {t('providers:editModel.warning.description')}
+
+
+
+
+
{t('providers:editModel.capabilities')}
diff --git a/web-app/src/locales/de-DE/providers.json b/web-app/src/locales/de-DE/providers.json
index c4a4961f4..7e6d68c0f 100644
--- a/web-app/src/locales/de-DE/providers.json
+++ b/web-app/src/locales/de-DE/providers.json
@@ -60,7 +60,11 @@
"tools": "Werkzeuge",
"vision": "Vision",
"embeddings": "Einbettungen",
- "notAvailable": "Noch nicht verfügbar"
+ "notAvailable": "Noch nicht verfügbar",
+ "warning": {
+ "title": "Mit Vorsicht fortfahren",
+ "description": "Das Ändern von Modellfunktionen kann Leistung und Funktionalität beeinträchtigen. Falsche Einstellungen können zu unerwartetem Verhalten oder Fehlern führen."
+ }
},
"addProvider": "Anbieter hinzufügen",
"addOpenAIProvider": "OpenAI Anbieter hinzufügen",
diff --git a/web-app/src/locales/en/providers.json b/web-app/src/locales/en/providers.json
index 7e8adb880..62fe69b8e 100644
--- a/web-app/src/locales/en/providers.json
+++ b/web-app/src/locales/en/providers.json
@@ -60,7 +60,11 @@
"tools": "Tools",
"vision": "Vision",
"embeddings": "Embeddings",
- "notAvailable": "Not available yet"
+ "notAvailable": "Not available yet",
+ "warning": {
+ "title": "Proceed with Caution",
+ "description": "Modifying model capabilities may affect performance and functionality. Incorrect settings could cause unexpected behavior or errors."
+ }
},
"addProvider": "Add Provider",
"addOpenAIProvider": "Add OpenAI Provider",
diff --git a/web-app/src/locales/id/providers.json b/web-app/src/locales/id/providers.json
index 421d622d3..803aac3e7 100644
--- a/web-app/src/locales/id/providers.json
+++ b/web-app/src/locales/id/providers.json
@@ -60,7 +60,11 @@
"tools": "Alat",
"vision": "Visi",
"embeddings": "Embedding",
- "notAvailable": "Belum tersedia"
+ "notAvailable": "Belum tersedia",
+ "warning": {
+ "title": "Lanjutkan dengan Hati-hati",
+ "description": "Memodifikasi kemampuan model dapat mempengaruhi kinerja dan fungsionalitas. Pengaturan yang salah dapat menyebabkan perilaku atau kesalahan yang tidak terduga."
+ }
},
"addProvider": "Tambah Penyedia",
"addOpenAIProvider": "Tambah Penyedia OpenAI",
diff --git a/web-app/src/locales/pl/providers.json b/web-app/src/locales/pl/providers.json
index fdbba1e3d..165d99b5e 100644
--- a/web-app/src/locales/pl/providers.json
+++ b/web-app/src/locales/pl/providers.json
@@ -60,7 +60,11 @@
"tools": "Narzędzia",
"vision": "Wizja",
"embeddings": "Osadzenia",
- "notAvailable": "Jeszcze nie dostępne"
+ "notAvailable": "Jeszcze nie dostępne",
+ "warning": {
+ "title": "Zachowaj Ostrożność",
+ "description": "Modyfikowanie możliwości modelu może wpłynąć na wydajność i funkcjonalność. Nieprawidłowe ustawienia mogą spowodować nieoczekiwane zachowanie lub błędy."
+ }
},
"addProvider": "Dodaj Dostawcę",
"addOpenAIProvider": "Dodaj Dostawcę OpenAI",
diff --git a/web-app/src/locales/vn/providers.json b/web-app/src/locales/vn/providers.json
index 59e3669ad..bd6bdb334 100644
--- a/web-app/src/locales/vn/providers.json
+++ b/web-app/src/locales/vn/providers.json
@@ -60,7 +60,11 @@
"tools": "Công cụ",
"vision": "Thị giác",
"embeddings": "Nhúng",
- "notAvailable": "Chưa có"
+ "notAvailable": "Chưa có",
+ "warning": {
+ "title": "Hãy Thận Trọng",
+ "description": "Việc sửa đổi khả năng của mô hình có thể ảnh hưởng đến hiệu suất và chức năng. Cài đặt không chính xác có thể gây ra hành vi hoặc lỗi không mong muốn."
+ }
},
"addProvider": "Thêm nhà cung cấp",
"addOpenAIProvider": "Thêm nhà cung cấp OpenAI",
diff --git a/web-app/src/locales/zh-CN/providers.json b/web-app/src/locales/zh-CN/providers.json
index ab3ee203d..ecc04df49 100644
--- a/web-app/src/locales/zh-CN/providers.json
+++ b/web-app/src/locales/zh-CN/providers.json
@@ -60,7 +60,11 @@
"tools": "工具",
"vision": "视觉",
"embeddings": "嵌入",
- "notAvailable": "尚不可用"
+ "notAvailable": "尚不可用",
+ "warning": {
+ "title": "谨慎操作",
+ "description": "修改模型功能可能会影响性能和功能。错误的设置可能导致意外行为或错误。"
+ }
},
"addProvider": "添加提供商",
"addOpenAIProvider": "添加 OpenAI 提供商",
diff --git a/web-app/src/locales/zh-TW/providers.json b/web-app/src/locales/zh-TW/providers.json
index 26298f3a3..316a9ed08 100644
--- a/web-app/src/locales/zh-TW/providers.json
+++ b/web-app/src/locales/zh-TW/providers.json
@@ -60,7 +60,11 @@
"tools": "工具",
"vision": "視覺",
"embeddings": "嵌入",
- "notAvailable": "尚不可用"
+ "notAvailable": "尚不可用",
+ "warning": {
+ "title": "請謹慎操作",
+ "description": "修改模型功能可能會影響效能和功能。錯誤的設定可能導致意外行為或錯誤。"
+ }
},
"addProvider": "新增提供者",
"addOpenAIProvider": "新增 OpenAI 提供者",
diff --git a/web-app/src/routes/settings/providers/$providerName.tsx b/web-app/src/routes/settings/providers/$providerName.tsx
index 6cad024a4..b24baf5cf 100644
--- a/web-app/src/routes/settings/providers/$providerName.tsx
+++ b/web-app/src/routes/settings/providers/$providerName.tsx
@@ -93,16 +93,19 @@ function ProviderDetail() {
const handleModelImportSuccess = async (importedModelName?: string) => {
// Refresh the provider to update the models list
await serviceHub.providers().getProviders().then(setProviders)
-
+
// If a model was imported and it might have vision capabilities, check and update
if (importedModelName && providerName === 'llamacpp') {
try {
- const mmprojExists = await serviceHub.models().checkMmprojExists(importedModelName)
+ const mmprojExists = await serviceHub
+ .models()
+ .checkMmprojExists(importedModelName)
if (mmprojExists) {
// Get the updated provider after refresh
- const { getProviderByName, updateProvider: updateProviderState } = useModelProvider.getState()
+ const { getProviderByName, updateProvider: updateProviderState } =
+ useModelProvider.getState()
const llamacppProvider = getProviderByName('llamacpp')
-
+
if (llamacppProvider) {
const modelIndex = llamacppProvider.models.findIndex(
(m: Model) => m.id === importedModelName
@@ -111,16 +114,25 @@ function ProviderDetail() {
const model = llamacppProvider.models[modelIndex]
const capabilities = model.capabilities || []
- // Add 'vision' capability if not already present
- if (!capabilities.includes('vision')) {
+ // Add 'vision' capability if not already present AND if user hasn't manually configured capabilities
+ // Check if model has a custom capabilities config flag
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const hasUserConfiguredCapabilities = (model as any)._userConfiguredCapabilities === true
+
+ if (!capabilities.includes('vision') && !hasUserConfiguredCapabilities) {
const updatedModels = [...llamacppProvider.models]
updatedModels[modelIndex] = {
...model,
capabilities: [...capabilities, 'vision'],
- }
+ // Mark this as auto-detected, not user-configured
+ _autoDetectedVision: true,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ } as any
updateProviderState('llamacpp', { models: updatedModels })
- console.log(`Vision capability added to model after provider refresh: ${importedModelName}`)
+ console.log(
+ `Vision capability auto-added to model after provider refresh: ${importedModelName}`
+ )
}
}
}
@@ -606,12 +618,10 @@ function ProviderDetail() {
}
actions={
- {provider && provider.provider !== 'llamacpp' && (
-
- )}
+
{model.settings && (