Skip to main content

nself ai

nself ai — ɳSelf documentation.

Manage the ɳSelf AI plugin and local LLM stack.

Synopsis

nself ai <subcommand> [flags] [args]

Description

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.

Subcommands

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

Flags

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

ai local install

FlagDefaultDescription
--yesfalseNon-interactive mode
--no-modelsfalseSkip model pulls
--model""Pull only this model
--bind""host:port to bind Ollama to
--jsonfalseEmit JSON output

ai local models list

FlagDefaultDescription
--installedfalseShow only installed
--registeredfalseShow only registered
--jsonfalseEmit JSON output

ai local models add <model>

FlagDefaultDescription
--taskchatComma-separated task classes
--defaultfalseSet as default for the tasks

ai local models remove <model>

FlagDefaultDescription
--forcefalseRemove even if default

ai local models recommend

FlagDefaultDescription
--tierautoForce a tier (auto, minimal, balanced, max)

ai local health

FlagDefaultDescription
--watchfalseRe-poll every 2s
--jsonfalseEmit JSON output

ai local swap <model>

FlagDefaultDescription
--taskchatTask: chat, embed, classify, or all
--reason""Free-text reason (audit log)

ai local benchmark [model]

FlagDefaultDescription
--taskschatComma-separated tasks
--iterations5Iterations per task

ai chat <message>

FlagDefaultDescription
--model""Model to use (default: AI_DEFAULT_MODEL or gemma2:2b)
--jsonfalseEmit JSON output

ai pool status

FlagDefaultDescription
--jsonfalseEmit JSON output
--verbosefalseShow per-key details

ai pool provision

FlagDefaultDescription
--account""Google account email (required)

ai pool add

FlagDefaultDescription
--account""Google account email hint

ai pool remove

FlagDefaultDescription
--account""Remove by Google account email
--key-id""Remove by key index

ai pool rotate

FlagDefaultDescription
--key-id""Key index to rotate (required)

ai pool test

FlagDefaultDescription
--key-id""Test a specific key
--allfalseTest all keys

ai pool daily-reset

FlagDefaultDescription
--dry-runfalseShow what would reset without resetting

Examples

# 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

See Also