Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

refactor: exclude foundation-models from active and hidden providers in DropdownModelProvider and SettingsMenu

dev-miro26d42f64473d0e
diff --git a/web-app/src/containers/DropdownModelProvider.tsx b/web-app/src/containers/DropdownModelProvider.tsx
index 306337632..e9ffce8c0 100644
--- a/web-app/src/containers/DropdownModelProvider.tsx
+++ b/web-app/src/containers/DropdownModelProvider.tsx
@@ -261,6 +261,7 @@ const DropdownModelProvider = memo(function DropdownModelProvider({
providers.forEach((provider) => {
if (!provider.active) return
+ if (provider.provider === 'foundation-models') return
provider.models.forEach((modelItem) => {
// Skip embedding models - they can't be used for chat
@@ -342,7 +343,7 @@ const DropdownModelProvider = memo(function DropdownModelProvider({
// When not searching, show all active providers (even without models)
// Sort: local first, then providers with API keys or custom with models, then others, alphabetically
const activeProviders = providers
- .filter((p) => p.active)
+ .filter((p) => p.active && p.provider !== 'foundation-models')
.sort((a, b) => {
const aIsLocal = a.provider === 'llamacpp' || a.provider === 'mlx'
const bIsLocal = b.provider === 'llamacpp' || b.provider === 'mlx'
diff --git a/web-app/src/containers/SettingsMenu.tsx b/web-app/src/containers/SettingsMenu.tsx
index 3f9d96c45..7a6c1ea3b 100644
--- a/web-app/src/containers/SettingsMenu.tsx
+++ b/web-app/src/containers/SettingsMenu.tsx
@@ -58,12 +58,14 @@ const SettingsMenu = () => {
const activeProviders = providers.filter((provider) => {
if (!provider.active) return false
if (!IS_MACOS && provider.provider === 'mlx') return false
+ if (provider.provider === 'foundation-models') return false
return true
})
const hiddenProviders = providers.filter((provider) => {
if (provider.active) return false
if (!IS_MACOS && provider.provider === 'mlx') return false
+ if (provider.provider === 'foundation-models') return false
return true
})