Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions bin/omarchy-remove-ai-llmman
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# omarchy:summary=Remove llmman along with every model it pulled.
# omarchy:requires-sudo=true

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
# matches the daemon's command line and no plain CLI invocation.
pkill -TERM -f 'llmman serve' 2>/dev/null || true
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved

# Like the OpenClaw remover: 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
# 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."
2 changes: 2 additions & 0 deletions default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,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.hermes": {"icon":"","iconFont":"omarchy","label":"Hermes Desktop","disabled":"omarchy-pkg-present hermes-desktop","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-hermes"},
"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.openclaw": {"icon":"","iconFont":"omarchy","label":"OpenClaw","disabled":"omarchy-pkg-present openclaw","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-openclaw"},
Expand Down Expand Up @@ -313,6 +314,7 @@
"remove.ai.claude": {"icon":"","iconFont":"omarchy","label":"Claude Desktop","when":"omarchy-pkg-present claude-desktop","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-claude"},
"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.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.openclaw": {"icon":"","iconFont":"omarchy","label":"OpenClaw","when":"omarchy-pkg-present openclaw","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-openclaw"},
Expand Down
4 changes: 3 additions & 1 deletion manual/17-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ OpenClaw's desktop experience is its Control UI, which opens as a web app backed

### 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

Expand Down
65 changes: 65 additions & 0 deletions test/shell.d/remove-ai-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ printf 'pkill:%s\n' "$*" >>"$TEST_LOG"
SCRIPT
chmod +x "$tmp_dir/bin/pkill"

# omarchy-remove-ai-llmman 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
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
chmod +x "$tmp_dir/bin/pgrep"

# omarchy-remove-ai-perplexity asks through gum whether the user's data goes
# too. The stub answers "no" unless a test says otherwise and logs the call: a
# real gum would hang the run, and one that answered "yes" on its own would be
Expand Down Expand Up @@ -221,6 +230,62 @@ ollama_row=$(grep '^ "remove.ai.ollama":' "$ROOT/default/omarchy/omarchy-menu.j
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"

: >"$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"

# 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")
[[ $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"

# OpenClaw's gateway unit and web app launcher are the app's own; the agent
# state in ~/.openclaw is the user's. systemctl and openclaw are stubbed so the
# sandbox never reaches the real user manager or a real gateway.
Expand Down