From c0aebdb39639e676b56e4e231f1406b3f2384a41 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Sun, 13 Sep 2026 18:58:59 +0100 Subject: [PATCH 1/4] Add llmman to Install > AI and Remove > AI llmman runs the coding agents Omarchy already ships against a model on this machine: `llmman launch claude --model qwen3.8` fetches the tested upstream llama.cpp build for the GPU, loads the model and execs the agent. Its daemon speaks the Ollama, OpenAI and Anthropic APIs on one endpoint, models are plain OCI artifacts from Docker Hub or Hugging Face, and --provider points the same commands at a hosted model. It belongs next to LM Studio, Ollama and MLX as another way to run local models, and upstream ships an aarch64 Linux binary. The package is omarchy-pkgs' llmman-bin (omacom/omarchy-pkgs#428). The Install row dims on the command rather than the package, like Ollama's, because a cargo or curl install provides the same command; the Remove row keys on the package, which is the only thing omarchy-pkg-drop can act on. The remover stops the detached `llmman serve` daemon first (it has no stop command; pkill on its command line is upstream's own advice), drops the package, then deletes the store, config and the two files llmman writes into other agents' homes under its own name. The agents' own state beside them stays, and the tests pin that boundary. Same change as omacom/omarchy#11722, carried here because this menu has diverged from upstream's. --- bin/omarchy-remove-ai-llmman | 30 ++++++++++++++++++ default/omarchy/omarchy-menu.jsonc | 2 ++ manual/17-ai.md | 4 ++- test/shell.d/remove-ai-test.sh | 49 ++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100755 bin/omarchy-remove-ai-llmman diff --git a/bin/omarchy-remove-ai-llmman b/bin/omarchy-remove-ai-llmman new file mode 100755 index 000000000000..b225b39508c9 --- /dev/null +++ b/bin/omarchy-remove-ai-llmman @@ -0,0 +1,30 @@ +#!/bin/bash + +# omarchy:summary=Remove llmman along with every model it pulled. +# omarchy:requires-sudo=true + +# -u so an unset HOME is an error rather than a set of rm -rf paths rooted at /. +set -euo pipefail + +# `llmman launch` and `llmman run` leave a `llmman serve` daemon behind, +# detached from any terminal, with the store open and a model possibly still +# loaded. It has no stop command of its own; its own advice is this pkill, which +# matches the daemon's command line and no plain CLI invocation. +pkill -TERM -f 'llmman serve' 2>/dev/null || true + +omarchy-pkg-drop llmman-bin + +# The store (an OCI layout of every pulled model), the llama.cpp releases it +# downloaded and the prompt history all sit under one data directory; aliases, +# provider keys and the trust policy under one config directory. Both are +# llmman's own. So are the two files it writes into other agents' homes under +# its own name: the codex profile overlay and the AGY settings directory. The +# agents themselves, and anything else in ~/.codex and ~/.gemini, stay. +rm -rf \ + "$HOME/.local/share/llmman" \ + "$HOME/.config/llmman" \ + "$HOME/.codex/llmman.config.toml" \ + "$HOME/.gemini/llmman" + +echo "" +echo "llmman and its models have been removed." diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 3deb8e4129b5..c825436c5259 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -241,6 +241,7 @@ "install.ai.dictation": {"icon":"","label":"Dictation","disabled":"omarchy-pkg-present voxtype-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install"}, "install.ai.grok-bot": {"icon":"","iconFont":"omarchy","label":"Grok Bot","disabled":"omarchy-pkg-present grok-bot","action":"omarchy-install-and-launch 'Grok Bot' grok-bot grok-bot"}, "install.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","description":"Apple MLX on the M1 GPU via Vulkan, with a chat demo","disabled":"omarchy-cmd-present mlx-omarchy-demo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-mlx"}, + "install.ai.llmman": {"icon":"󰒋","label":"llmman","disabled":"omarchy-cmd-present llmman","action":"omarchy-install-app llmman llmman-bin"}, "install.ai.lm-studio": {"icon":"","iconFont":"omarchy","label":"LM Studio","disabled":"omarchy-pkg-present lmstudio-bin","action":"omarchy-install-app 'LM Studio' lmstudio-bin"}, "install.ai.ollama": {"icon":"","iconFont":"omarchy","label":"Ollama","disabled":"omarchy-cmd-present ollama","action":"if omarchy-cmd-present nvidia-smi; then ollama_pkg=ollama-cuda; elif omarchy-cmd-present rocminfo; then ollama_pkg=ollama-rocm; else ollama_pkg=ollama; fi; omarchy-install-app Ollama \"$ollama_pkg\""}, "install.ai.t3-code": {"icon":"","iconFont":"omarchy","label":"T3 Code","disabled":"omarchy-pkg-present t3code-bin","action":"omarchy-install-and-launch 'T3 Code' t3code-bin t3code"}, @@ -306,6 +307,7 @@ "remove.ai.dictation": {"icon":"","label":"Dictation","when":"omarchy-pkg-present voxtype-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-remove"}, "remove.ai.grok-bot": {"icon":"","iconFont":"omarchy","label":"Grok Bot","when":"omarchy-pkg-present grok-bot","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-grok-bot"}, "remove.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","when":"omarchy-cmd-present mlx-omarchy-demo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-mlx"}, + "remove.ai.llmman": {"icon":"󰒋","label":"llmman","when":"omarchy-pkg-present llmman-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-llmman"}, "remove.ai.lm-studio": {"icon":"","iconFont":"omarchy","label":"LM Studio","when":"omarchy-pkg-present lmstudio-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-lm-studio"}, "remove.ai.ollama": {"icon":"","iconFont":"omarchy","label":"Ollama","when":"omarchy-pkg-present ollama","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-ollama"}, "remove.ai.t3-code": {"icon":"","iconFont":"omarchy","label":"T3 Code","when":"omarchy-pkg-present t3code-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-t3-code"}, diff --git a/manual/17-ai.md b/manual/17-ai.md index c085e523de55..f8acfe4ca18e 100644 --- a/manual/17-ai.md +++ b/manual/17-ai.md @@ -48,7 +48,9 @@ The _Install > AI_ menu also carries a couple of graphical AI apps: the ChatGPT ### Local LLMs -Omarchy recommends two ways of running local LLM models: LM Studio and Ollama. LM Studio provides a GUI interface for finding open-weight models, installing them, and running them. It's a great way to get going easily. Ollama offers a CLI for doing so similarly. But if you're new to local models, I'd start with LM Studio. You can install either under _Install > AI_ in the Omarchy Menu. +Omarchy recommends three ways of running local LLM models: LM Studio, Ollama, and llmman. LM Studio provides a GUI interface for finding open-weight models, installing them, and running them. It's a great way to get going easily. Ollama offers a CLI for doing so similarly. But if you're new to local models, I'd start with LM Studio. You can install any of them under _Install > AI_ in the Omarchy Menu. + +[llmman](https://github.com/llmmanorg/llmman) is the one for pointing the coding agents above at a local model: `llmman launch claude --model qwen3.8` fetches the tested upstream `llama.cpp` build for your GPU, loads the model, and starts Claude Code against it (the same works for `opencode`, `codex`, `agy`, and others). Models are plain OCI artifacts, pulled straight from Docker Hub or Hugging Face, and `llmman serve` answers the Ollama, OpenAI, and Anthropic APIs on one endpoint, so anything that already talks to Ollama works unchanged. Swap `--model` for `--provider` to run the same agent against a hosted model instead. ### The Omarchy Skill diff --git a/test/shell.d/remove-ai-test.sh b/test/shell.d/remove-ai-test.sh index 8c7cb1533b71..bf66a127ad32 100644 --- a/test/shell.d/remove-ai-test.sh +++ b/test/shell.d/remove-ai-test.sh @@ -15,6 +15,14 @@ printf 'drop:%s\n' "$*" >>"$TEST_LOG" SCRIPT chmod +x "$tmp_dir/bin/omarchy-pkg-drop" +# omarchy-remove-ai-llmman stops the serve daemon before deleting its store; a +# real pkill here would take the developer's own daemon with it. +cat >"$tmp_dir/bin/pkill" <<'SCRIPT' +#!/bin/bash +printf 'pkill:%s\n' "$*" >>"$TEST_LOG" +SCRIPT +chmod +x "$tmp_dir/bin/pkill" + export TEST_LOG="$tmp_dir/log" export PATH="$tmp_dir/bin:$PATH" @@ -93,3 +101,44 @@ ollama_row=$(grep '^ "remove.ai.ollama":' "$ROOT/default/omarchy/omarchy-menu.j [[ $ollama_row == *'"when":"omarchy-pkg-present ollama"'* ]] || fail "Ollama removal is offered only where the package is installed" "$ollama_row" pass "Ollama removal is offered only where the package is installed" + +# llmman keeps its store, config and the files it drops into other agents' +# homes under its own name; the agents' own state next to them is not its to +# take. The detached `llmman serve` daemon has no stop command, so pkill is how +# it goes, and the stub above keeps that off the developer's own daemon. +fresh_home +mkdir -p "$HOME/.local/share/llmman/store" "$HOME/.config/llmman" "$HOME/.codex" \ + "$HOME/.gemini/llmman/antigravity-cli" "$HOME/.gemini/config/skills" "$HOME/.hermes" +touch "$HOME/.codex/llmman.config.toml" "$HOME/.codex/config.toml" \ + "$HOME/.gemini/llmman/antigravity-cli/settings.json" "$HOME/.hermes/config.yaml" +"$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null + +for gone in .local/share/llmman .config/llmman .codex/llmman.config.toml .gemini/llmman; do + [[ ! -e $HOME/$gone ]] || fail "llmman removal deletes its store, config and the files it wrote under its own name" "$gone" +done +pass "llmman removal deletes its store, config and the files it wrote under its own name" + +for kept in .codex/config.toml .gemini/config/skills .hermes/config.yaml; do + [[ -e $HOME/$kept ]] || fail "llmman removal keeps the agents' own state" "$kept" +done +pass "llmman removal keeps the agents' own state" + +grep -qx 'drop:llmman-bin' "$TEST_LOG" || fail "llmman removal drops the llmman-bin package" +pass "llmman removal drops the llmman-bin package" + +grep -qx "pkill:-TERM -f llmman serve" "$TEST_LOG" || fail "llmman removal stops the serve daemon before deleting its store" +pass "llmman removal stops the serve daemon before deleting its store" + +# Without HOME the rm -rf paths would degrade to /-rooted ones; -u makes that a +# refusal instead. +if env -u HOME "$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null 2>&1; then + fail "llmman removal refuses to run without HOME" +fi +pass "llmman removal refuses to run without HOME" + +# The command alone is also provided by a cargo or curl install that +# omarchy-pkg-drop will not touch, so the package is what the remover keys on. +llmman_row=$(grep '^ "remove.ai.llmman":' "$ROOT/default/omarchy/omarchy-menu.jsonc") +[[ $llmman_row == *'"when":"omarchy-pkg-present llmman-bin"'* ]] || + fail "llmman removal is offered only where the package is installed" "$llmman_row" +pass "llmman removal is offered only where the package is installed" From 5ad6c3573a7a2c39378fd40fc6f8b96bbcf3e7c5 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Sun, 4 Oct 2026 02:46:05 +0100 Subject: [PATCH 2/4] Check HOME before removing llmman Signed-off-by: Eric Curtin --- bin/omarchy-remove-ai-llmman | 4 +++- test/shell.d/remove-ai-test.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-remove-ai-llmman b/bin/omarchy-remove-ai-llmman index b225b39508c9..ced747699729 100755 --- a/bin/omarchy-remove-ai-llmman +++ b/bin/omarchy-remove-ai-llmman @@ -3,9 +3,11 @@ # omarchy:summary=Remove llmman along with every model it pulled. # omarchy:requires-sudo=true -# -u so an unset HOME is an error rather than a set of rm -rf paths rooted at /. set -euo pipefail +# Before anything else: without HOME, touch nothing (rm -rf paths would root at /). +: "${HOME:?HOME must be set}" + # `llmman launch` and `llmman run` leave a `llmman serve` daemon behind, # detached from any terminal, with the store open and a model possibly still # loaded. It has no stop command of its own; its own advice is this pkill, which diff --git a/test/shell.d/remove-ai-test.sh b/test/shell.d/remove-ai-test.sh index bf66a127ad32..656f4c8ebcfa 100644 --- a/test/shell.d/remove-ai-test.sh +++ b/test/shell.d/remove-ai-test.sh @@ -131,9 +131,11 @@ pass "llmman removal stops the serve daemon before deleting its store" # Without HOME the rm -rf paths would degrade to /-rooted ones; -u makes that a # refusal instead. +: >"$TEST_LOG" if env -u HOME "$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null 2>&1; then fail "llmman removal refuses to run without HOME" fi +[[ ! -s $TEST_LOG ]] || fail "llmman removal touches nothing without HOME" "$(<"$TEST_LOG")" pass "llmman removal refuses to run without HOME" # The command alone is also provided by a cargo or curl install that From 3d3bcc31abe71f6494558bf706fe990b5c6f488e Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Sun, 4 Oct 2026 13:25:52 +0100 Subject: [PATCH 3/4] Abort llmman removal if its daemon will not stop Signed-off-by: Eric Curtin --- bin/omarchy-remove-ai-llmman | 11 +++++++++++ test/shell.d/remove-ai-test.sh | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/bin/omarchy-remove-ai-llmman b/bin/omarchy-remove-ai-llmman index ced747699729..ec9a0565cbe8 100755 --- a/bin/omarchy-remove-ai-llmman +++ b/bin/omarchy-remove-ai-llmman @@ -14,6 +14,17 @@ set -euo pipefail # matches the daemon's command line and no plain CLI invocation. pkill -TERM -f 'llmman serve' 2>/dev/null || true +# A daemon that will not stop aborts the removal, rather than leaving it +# running on a deleted package and store. +for _ in {1..50}; do + pgrep -f 'llmman serve' >/dev/null || break + sleep 0.2 +done +if pgrep -f 'llmman serve' >/dev/null; then + echo "Could not stop llmman serve; llmman was not removed." >&2 + exit 1 +fi + omarchy-pkg-drop llmman-bin # The store (an OCI layout of every pulled model), the llama.cpp releases it diff --git a/test/shell.d/remove-ai-test.sh b/test/shell.d/remove-ai-test.sh index 656f4c8ebcfa..3e31a6e0fc10 100644 --- a/test/shell.d/remove-ai-test.sh +++ b/test/shell.d/remove-ai-test.sh @@ -23,6 +23,15 @@ printf 'pkill:%s\n' "$*" >>"$TEST_LOG" SCRIPT chmod +x "$tmp_dir/bin/pkill" +# The remover also waits for the daemon to exit; the stub reports it still +# running only when a test sets TEST_DAEMON_RUNNING, so the developer's own +# daemon never matters. +cat >"$tmp_dir/bin/pgrep" <<'SCRIPT' +#!/bin/bash +[[ -n ${TEST_DAEMON_RUNNING:-} ]] +SCRIPT +chmod +x "$tmp_dir/bin/pgrep" + export TEST_LOG="$tmp_dir/log" export PATH="$tmp_dir/bin:$PATH" @@ -138,6 +147,21 @@ fi [[ ! -s $TEST_LOG ]] || fail "llmman removal touches nothing without HOME" "$(<"$TEST_LOG")" pass "llmman removal refuses to run without HOME" +# A daemon that outlives the wait aborts the removal with the package and store +# intact. sleep is stubbed so the full wait does not run in the test. +mkdir -p "$HOME/.local/share/llmman" +printf '#!/bin/bash\n' >"$tmp_dir/bin/sleep" +chmod +x "$tmp_dir/bin/sleep" +: >"$TEST_LOG" +if TEST_DAEMON_RUNNING=1 "$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null 2>&1; then + fail "llmman removal aborts while the serve daemon is still running" +fi +rm -f "$tmp_dir/bin/sleep" +if grep -q '^drop:' "$TEST_LOG" || [[ ! -d $HOME/.local/share/llmman ]]; then + fail "llmman removal keeps the package and store while the serve daemon is still running" +fi +pass "llmman removal aborts while the serve daemon is still running" + # The command alone is also provided by a cargo or curl install that # omarchy-pkg-drop will not touch, so the package is what the remover keys on. llmman_row=$(grep '^ "remove.ai.llmman":' "$ROOT/default/omarchy/omarchy-menu.jsonc") From ccecadb93ba85cf54ef0d842c0326192f0c48ee6 Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Sun, 4 Oct 2026 13:28:44 +0100 Subject: [PATCH 4/4] Test llmman removal when the daemon exits mid-wait Signed-off-by: Eric Curtin --- test/shell.d/remove-ai-test.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/shell.d/remove-ai-test.sh b/test/shell.d/remove-ai-test.sh index 3e31a6e0fc10..7cc88bd24307 100644 --- a/test/shell.d/remove-ai-test.sh +++ b/test/shell.d/remove-ai-test.sh @@ -23,16 +23,19 @@ printf 'pkill:%s\n' "$*" >>"$TEST_LOG" SCRIPT chmod +x "$tmp_dir/bin/pkill" -# The remover also waits for the daemon to exit; the stub reports it still -# running only when a test sets TEST_DAEMON_RUNNING, so the developer's own -# daemon never matters. +# omarchy-remove-ai-llmman waits for the daemon to exit. The stub reports it +# running for as many calls as TEST_POLLS holds, then gone, so the developer's +# own daemon never matters. cat >"$tmp_dir/bin/pgrep" <<'SCRIPT' #!/bin/bash -[[ -n ${TEST_DAEMON_RUNNING:-} ]] +polls=$(cat "$TEST_POLLS" 2>/dev/null || echo 0) +((polls > 0)) || exit 1 +echo $((polls - 1)) >"$TEST_POLLS" SCRIPT chmod +x "$tmp_dir/bin/pgrep" export TEST_LOG="$tmp_dir/log" +export TEST_POLLS="$tmp_dir/polls" export PATH="$tmp_dir/bin:$PATH" fresh_home() { @@ -153,15 +156,24 @@ mkdir -p "$HOME/.local/share/llmman" printf '#!/bin/bash\n' >"$tmp_dir/bin/sleep" chmod +x "$tmp_dir/bin/sleep" : >"$TEST_LOG" -if TEST_DAEMON_RUNNING=1 "$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null 2>&1; then +echo 999 >"$TEST_POLLS" +if "$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null 2>&1; then fail "llmman removal aborts while the serve daemon is still running" fi -rm -f "$tmp_dir/bin/sleep" if grep -q '^drop:' "$TEST_LOG" || [[ ! -d $HOME/.local/share/llmman ]]; then fail "llmman removal keeps the package and store while the serve daemon is still running" fi pass "llmman removal aborts while the serve daemon is still running" +# One that exits while it is being waited on does not. +: >"$TEST_LOG" +echo 3 >"$TEST_POLLS" +"$ROOT/bin/omarchy-remove-ai-llmman" >/dev/null || fail "llmman removal proceeds once the serve daemon exits" +rm -f "$tmp_dir/bin/sleep" +grep -qx 'drop:llmman-bin' "$TEST_LOG" && [[ ! -e $HOME/.local/share/llmman ]] || + fail "llmman removal proceeds once the serve daemon exits" +pass "llmman removal proceeds once the serve daemon exits" + # The command alone is also provided by a cargo or curl install that # omarchy-pkg-drop will not touch, so the package is what the remover keys on. llmman_row=$(grep '^ "remove.ai.llmman":' "$ROOT/default/omarchy/omarchy-menu.jsonc")