From 76add8888e966ada2729956af1531b7d8fdf9ad4 Mon Sep 17 00:00:00 2001 From: Advait Jayant Date: Tue, 23 Jun 2026 22:54:37 +0100 Subject: [PATCH] Add 'ghost --local' to force the offline local model in one shot Local models are opt-in (GHOST_LOCAL=1), but there was no one-shot way to use one -- only the interactive /model picker. Add a --local flag that routes this run to the ollama-local provider's model (uncensored-local 32B if present, else ghost-tool 7B) via the engine's -m/--provider override, fully bypassing the scrubber + og-veil (true offline incognito). If no local model is installed it says how to add one. Verified: scrubber.log unchanged across a --local run (nothing left the box). --- README.md | 4 +++- bin/ghost | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10ec19a..1e178ce 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,12 @@ Then connect your account once and run **`ghost`**: ```bash ghost-login # browser login -> hands a session token back to this machine ghost # chat (default = Hermes 405B via the OpenGradient TEE gateway, OHTTP-private) +ghost --local # force the fully-offline local model (no scrubber, no og-veil, nothing leaves) ``` Inside, `/model` switches between the hosted line-up (Hermes 4 405B / 70B) and the -fully-local 32B. Optional install config via env: +fully-local model. `--local` does the same in one shot (requires a local install, `GHOST_LOCAL=1`). +Optional install config via env: ```bash GHOST_PROXY=1 ./install.sh # opt in to the Webshare rotating proxy (IP-mask the relay; off by default) diff --git a/bin/ghost b/bin/ghost index 930e258..3e93997 100755 --- a/bin/ghost +++ b/bin/ghost @@ -36,6 +36,24 @@ esac # before/after + restore map) WITHOUT sending anything. Lets you see what leaves the box. if [ "${1:-}" = "--preview" ]; then shift; exec "$PY" "__GHOST_HOME__/privacy/presidio_scrub.py" "$@"; fi +# --local: force the fully-offline local model for this run (true incognito -- nothing leaves the +# box, no scrubber/og-veil/network). Requires a local install (GHOST_LOCAL=1). Picks the local +# model from the ollama-local provider's default_model in config (uncensored-local 32B if present, +# else ghost-tool 7B). Without a local model installed, tells you how to get one. +if [ "${1:-}" = "--local" ]; then + shift + LM=$(grep -A4 '^ ollama-local:' "__GHOST_HOME__/profiles/uncensored/config.yaml" 2>/dev/null \ + | grep 'default_model:' | head -1 | sed 's/.*default_model:[[:space:]]*//') + [ -n "$LM" ] || LM="ghost-tool:latest" + OLLAMA_BIN="$(command -v ollama || echo /opt/homebrew/bin/ollama)" + if ! "$OLLAMA_BIN" list 2>/dev/null | grep -q "$(printf '%s' "$LM" | cut -d: -f1)"; then + echo "👻 ghost · ⚠️ no local model installed ($LM). Reinstall with GHOST_LOCAL=1 to add the offline model." >&2 + exit 1 + fi + echo "👻 ghost · 🔒 LOCAL mode = $LM (fully offline -- no scrubber, no og-veil, nothing leaves the box)" >&2 + exec "__ENG__/venv/bin/hermes" -p uncensored -m "$LM" --provider ollama-local "$@" +fi + # Are we connected to a hosted account? (hosted models need `ghost-login` -> og-veil login.) if "$PY" -m veil status >/dev/null 2>&1; then LOGIN="✅ connected"; else LOGIN="⚠️ not logged in (run: ghost-login)"; fi