Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Keep Ollama UI status in sync

Adam Eivy1396bc6f82fa
diff --git a/client/src/components/settings/LocalLlmTab.jsx b/client/src/components/settings/LocalLlmTab.jsx
index d4df515b77..f2e59791f6 100644
--- a/client/src/components/settings/LocalLlmTab.jsx
+++ b/client/src/components/settings/LocalLlmTab.jsx
@@ -163,12 +163,15 @@ export function LocalLlmTab() {
const [progressMsg, setProgressMsg] = useState('');
const [confirmAction, setConfirmAction] = useState(null);
const progressTimer = useRef(null);
+ const statusRequestId = useRef(0);
const selectedInitialized = useRef(false);
const loadStatus = useCallback(() => {
+ const requestId = ++statusRequestId.current;
setLoading(true);
return getLocalLlmStatus()
.then((s) => {
+ if (requestId !== statusRequestId.current) return;
setStatus(s);
// Default the model-management view to the active backend on first load.
if (!selectedInitialized.current && s?.backend) {
@@ -176,8 +179,12 @@ export function LocalLlmTab() {
selectedInitialized.current = true;
}
})
- .catch(() => toast.error('Failed to load local LLM status'))
- .finally(() => setLoading(false));
+ .catch(() => {
+ if (requestId === statusRequestId.current) toast.error('Failed to load local LLM status');
+ })
+ .finally(() => {
+ if (requestId === statusRequestId.current) setLoading(false);
+ });
}, []);
const loadCatalog = useCallback((backend, q) => {
@@ -219,6 +226,16 @@ export function LocalLlmTab() {
return fn()
.then((result) => {
if (successMsg) toast.success(typeof successMsg === 'function' ? successMsg(result) : successMsg);
+ if (typeof result?.running === 'boolean') {
+ setStatus((prev) => prev ? ({
+ ...prev,
+ ollama: {
+ ...prev.ollama,
+ installed: true,
+ available: result.running
+ }
+ }) : prev);
+ }
loadStatus();
loadCatalog(selected, query);
})
diff --git a/server/services/localLlm.js b/server/services/localLlm.js
index b4dc8447d1..3b0e0a2189 100644
--- a/server/services/localLlm.js
+++ b/server/services/localLlm.js
@@ -263,7 +263,7 @@ export async function listModels(backend, forceRefresh = false) {
*/
export async function getStatus() {
const [ollamaStatus, ollamaCli, lmStudioStatus, lmsCli, lmStudioModels] = await Promise.all([
- ollamaManager.getStatus(),
+ ollamaManager.getStatus(true),
commandExists('ollama', ['--version']),
lmStudioManager.getStatus(),
commandExists('lms', ['version']),
diff --git a/server/services/ollamaManager.js b/server/services/ollamaManager.js
index 5d134c89df..8fcd62f517 100644
--- a/server/services/ollamaManager.js
+++ b/server/services/ollamaManager.js
@@ -452,8 +452,8 @@ async function importModelFromGguf({ name, ggufPath, mode = 'copy' }) {
/**
* Aggregate status for the unified local-LLM UI.
*/
-async function getStatus() {
- const available = await checkOllamaAvailable()
+async function getStatus(forceRefresh = false) {
+ const available = await checkOllamaAvailable(forceRefresh)
const models = available ? await getInstalledModels(true) : []
return {
available,