Skip to content

nself ai

Manage the ɳSelf AI plugin and local LLM stack.

nself ai <subcommand> [flags] [args]

nself ai manages the AI plugin (plugin-ai) and the optional local Ollama runtime that powers zero-config inference. It groups three areas: the local Ollama stack (install, models, health, swap, benchmark), a one-shot chat for quick verification, and the Gemini API key pool for cloud routing.

The ai local subtree installs and inspects an Ollama daemon and the small set of models recommended for the host RAM tier. ai pool manages auto-provisioned Gemini keys (OAuth-onboarded Google accounts, GCP project creation, key rotation, daily quota tracking) so the AI plugin always has free or near-free capacity.

Most flags are non-destructive. Pulling models requires network access. Pool subcommands talk to the AI plugin over its internal HTTP API; if the plugin is not running, commands report a clear error.

NameDescription
local installInstall Ollama, systemd service, firewall, and recommended models
local models listList installed and registered local models with diff
local models add <model>Pull a model via Ollama and register with plugin-ai
local models remove <model>Soft-delete a local model and uninstall from Ollama
local models recommendPrint recommended models for this host
local healthShow Ollama and plugin-ai health
local swap <model>Hot-swap the default model for a task
local benchmark [model]Run benchmark prompts against one or more models
chat <message>Send a quick chat message to the local AI
pool initInteractive wizard: add a Google account and auto-provision a Gemini key
pool statusShow pool status (keys, usage, capacity)
pool provisionNon-interactive provision using stored refresh token
pool addAdd a Google account via OAuth (opens browser)
pool removeRemove a key from the pool (soft-revoke + optional GCP delete)
pool rotateRotate a key (create new GCP key, revoke old)
pool testTest one or all keys with a 1-token Gemini request
pool daily-resetManually trigger the daily counter reset

Top-level nself ai exposes no flags; flags belong to each subcommand.

FlagDefaultDescription
--yesfalseNon-interactive mode
--no-modelsfalseSkip model pulls
--model""Pull only this model
--bind""host:port to bind Ollama to
--jsonfalseEmit JSON output
FlagDefaultDescription
--installedfalseShow only installed
--registeredfalseShow only registered
--jsonfalseEmit JSON output
FlagDefaultDescription
--taskchatComma-separated task classes
--defaultfalseSet as default for the tasks
FlagDefaultDescription
--forcefalseRemove even if default
FlagDefaultDescription
--tierautoForce a tier (auto, minimal, balanced, max)
FlagDefaultDescription
--watchfalseRe-poll every 2s
--jsonfalseEmit JSON output
FlagDefaultDescription
--taskchatTask: chat, embed, classify, or all
--reason""Free-text reason (audit log)
FlagDefaultDescription
--taskschatComma-separated tasks
--iterations5Iterations per task
FlagDefaultDescription
--model""Model to use (default: AI_DEFAULT_MODEL or gemma2:2b)
--jsonfalseEmit JSON output
FlagDefaultDescription
--jsonfalseEmit JSON output
--verbosefalseShow per-key details
FlagDefaultDescription
--account""Google account email (required)
FlagDefaultDescription
--account""Google account email hint
FlagDefaultDescription
--account""Remove by Google account email
--key-id""Remove by key index
FlagDefaultDescription
--key-id""Key index to rotate (required)
FlagDefaultDescription
--key-id""Test a specific key
--allfalseTest all keys
FlagDefaultDescription
--dry-runfalseShow what would reset without resetting
Terminal window
# Install Ollama and pull recommended models for this host
nself ai local install --yes
# Send a quick verification chat
nself ai chat "hello"
# See what models are recommended for the host RAM tier
nself ai local models recommend
# Pull and register a model, set as default for chat
nself ai local models add llama3.2:3b --default
# Onboard a new Google account and auto-provision a Gemini key
nself ai pool init
# Check pool capacity
nself ai pool status --verbose

Commands | Home