From f6fd08f966d62dcdbacbdf5aa76c2877d2e907b5 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 22 Oct 2026 11:58:16 -0700 Subject: [PATCH] llm, add a safeguard when a model causes swap-stopper to reset ollama. --- tasks/workstation/linux/software/llm.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/workstation/linux/software/llm.yml b/tasks/workstation/linux/software/llm.yml index 6a1ba50..d1294cb 100644 --- a/tasks/workstation/linux/software/llm.yml +++ b/tasks/workstation/linux/software/llm.yml @@ -913,11 +913,18 @@ curl -s http://localhost:11434/api/generate \ -d '{"model":"'$model'","prompt":"","stream":false,"keep_alive":1'$context'}' \ >/dev/null 2>&1 + status=$? hdd="`ollama ls | grep $model | awk '{print $3 $4}'`" ram="`ollama ps | grep $model | awk '{print $3 $4}'`" ctx="`ollama ps | grep $model | awk '{print $7}'`" + if [[ "$status" != 0 ]]; then + ram="TOO LARGE $ram" + ctx="FAIL $ctx" + sleep 10 + fi + printf "$spacing\n" "$model" "$hdd" "$ctx" "$ram" ollama stop $model >/dev/null 2>&1