diff --git a/lib/classes/ollama_model.dart b/lib/classes/ollama_model.dart index f09ff0bf..5ed52f99 100644 --- a/lib/classes/ollama_model.dart +++ b/lib/classes/ollama_model.dart @@ -74,6 +74,14 @@ class OllamaModel extends LargeLanguageModel { @override Future resetUri() async { + // Check Localhost + if ((await _checkIpForOllama('127.0.0.1')).isNotEmpty) { + uri = 'http://127.0.0.1:11434'; + notifyListeners(); + return; + } + + // If ip is set, check if it's valid if (_ip.isNotEmpty && (await _checkIpForOllama(_ip)).isNotEmpty) { uri = 'http://$_ip:11434'; notifyListeners();