diff options
Diffstat (limited to 'desktop/modules/ai/ai-state.sh')
| -rwxr-xr-x | desktop/modules/ai/ai-state.sh | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/desktop/modules/ai/ai-state.sh b/desktop/modules/ai/ai-state.sh index 8b10368..a4406ce 100755 --- a/desktop/modules/ai/ai-state.sh +++ b/desktop/modules/ai/ai-state.sh @@ -12,19 +12,17 @@ # GNU General Public License for more details. # # One sweep of the local AI stack for the drawer's AI page. Always prints -# these six lines, tab separated, and exits 0: +# these four lines, tab separated, and exits 0: # # engine<TAB>llama<TAB>up|down<TAB>idle|busy<TAB>model # engine<TAB>sd<TAB>up|down<TAB>idle|busy<TAB>model, "(sd-cli)" for a CLI run # app<TAB>assistant<TAB>running|stopped<TAB>- # app<TAB>chat<TAB>running|stopped<TAB>- -# app<TAB>imggen<TAB>running|stopped<TAB>model -# app<TAB>fanfic<TAB>running|stopped<TAB>pid # # An empty value is "-". A probe that fails reads as down or stopped, not as # an error: every row is something that may simply not be running. # -# The test stubs curl, pgrep, llamachat and imggen on PATH and points +# The test stubs curl, pgrep and llamachat on PATH and points # AI_ASSISTANT and AI_SD_LOG at fixtures; see test-ai-state.sh. set -u @@ -65,7 +63,7 @@ model_of() { sd() { local line busy=idle mtime - # A one-shot sd-cli (fanfictioner runs them) holds VRAM and generates for + # A one-shot sd-cli holds VRAM and generates for # as long as it lives, so it outranks whatever the web UI is doing. if line="$(pgrep -axo sd-cli)"; then row engine sd up busy "$(model_of "$line") (sd-cli)" @@ -81,8 +79,6 @@ sd() { } apps() { - local out pid - if "$ASSISTANT" status >/dev/null 2>&1; then row app assistant running - else @@ -94,23 +90,6 @@ apps() { else row app chat stopped - fi - - # imggen status exits 0 either way: the daemon's JSON when it is up, - # "daemon down" when it is not. - out="$(imggen status 2>/dev/null)" - if [[ "$out" == "{"* ]]; then - row app imggen running "$(jq -r '.model // "-"' <<<"$out" 2>/dev/null || echo -)" - else - row app imggen stopped - - fi - - # It runs through env, so the command line is python3 then the script, - # by path from ~/bin or by ./fanfictioner from the repo. - if pid="$(pgrep -u "$USER" -fo '^[^ ]*python3[^ ]* [^ ]*fanfictioner( |$)')"; then - row app fanfic running "$pid" - else - row app fanfic stopped - - fi } llama |
