Skip to content

Ollama Integration

TFD-42 edited this page Aug 13, 2026 · 1 revision

Ollama Integration

Enrichment asks a local Ollama model to categorize each significant process (category, probable role, risk level, justification, educational explanation) and returns structured JSON. Calls stay on localhost unless you explicitly point --ollama-host elsewhere.

Model selection per device

The installers and the script share the same policy:

Device Default model Size
Android/Termux llama3.2:1b (mini) ~1.3 GB
macOS / Windows / Linux llama3:latest (medium) ~4.7 GB

Any installed model works — the wizard lists what GET /api/tags returns and lets you pick, and --model NAME forces one on the CLI.

Offline preparation

python3 process_analyzer_allinone.py --preload-model --model llama3

Starts/installs Ollama if needed, downloads the model (streamed, with a progress bar), then exits — one-time download, fully offline afterwards (except the 3D library CDN when opening the HTML).

Reliability details

  • Pre-flight check: before the enrichment loop, the script verifies once that the requested model exists (tolerant name/name:tag comparison). A typo fails immediately with the list of actually available models, instead of erroring on every process.
  • Warm-up call: a small throwaway prompt forces the model into memory before parallel calls start — otherwise simultaneous calls can all queue behind a still-loading model and time out together.
  • Modest parallelism by default (--max-workers 2): a local LLM usually serves sequentially (one GPU/CPU); more parallelism just piles up requests until they time out.
  • Automatic install (wizard only, with explicit consent): Homebrew on macOS, official script on Linux, OllamaSetup.exe on Windows, pkg install ollama on Termux.
  • Caching and retries: see Advanced Modes (--cache, --retry-failed).

Without Ollama

Everything still works: the deterministic Risk Engine runs unconditionally, and the Knowledge display mode falls back to a built-in knowledge base of common system processes.

Clone this wiki locally