update local models

This commit is contained in:
Stijnus
2025-02-18 21:51:02 +01:00
parent 10af7c9835
commit ca7f5ad26b
3 changed files with 16 additions and 44 deletions

View File

@@ -238,7 +238,7 @@ export default function DebugTab() {
performance: false,
});
const { isLocalModel, providers } = useSettings();
const { providers } = useSettings();
// Subscribe to logStore updates
const logs = useStore(logStore.logs);
@@ -1135,16 +1135,22 @@ export default function DebugTab() {
}
}, [providers]);
// Monitor isLocalModel changes and check status periodically
// Monitor Ollama provider status and check periodically
useEffect(() => {
// Check immediately when isLocalModel changes
checkOllamaStatus();
const ollamaProvider = providers?.Ollama;
// Set up periodic checks every 10 seconds
const intervalId = setInterval(checkOllamaStatus, 10000);
if (ollamaProvider?.settings?.enabled) {
// Check immediately when provider is enabled
checkOllamaStatus();
return () => clearInterval(intervalId);
}, [isLocalModel, checkOllamaStatus]);
// Set up periodic checks every 10 seconds
const intervalId = setInterval(checkOllamaStatus, 10000);
return () => clearInterval(intervalId);
}
return undefined;
}, [providers, checkOllamaStatus]);
// Replace the existing export button with this new component
const ExportButton = () => {
@@ -1222,15 +1228,6 @@ export default function DebugTab() {
const ollamaProvider = providers?.Ollama;
const isOllamaEnabled = ollamaProvider?.settings?.enabled;
if (!isLocalModel) {
return {
status: 'Disabled',
color: 'text-red-500',
bgColor: 'bg-red-500',
message: 'Local models are disabled in settings',
};
}
if (!isOllamaEnabled) {
return {
status: 'Disabled',