lxask v1.5.15
Reference

Configuration

lxask needs no configuration. Everything below is for when you want something other than the default.

#Files

All in ~/.local/share/lxask ($LXASK_HOME, else $XDG_DATA_HOME/lxask):

file what
model.gguf link to the model in models/ (about 990 MB)
restrict.gguf link to the model's restriction adapter in models/ (37 MB)
precision.gguf link to the model's precision adapter in models/ (37 MB)
embed.gguf the encoder used to search the documentation (37 MB)
docs.sqlite the documentation index: tldr pages and man page summaries and options (73 MB)
last.json the last answer, for lxask --bad
feedback.jsonl your --bad reports
settings your choices, as key = value lines (below)
token the secret other machines send to lxask --serve --listen (made by it, readable by you only)
LICENSE, NOTICE licences of the files above
*.previous what the last upgrade replaced

The program itself is ~/.local/bin/lxask.

#Environment variables

variable default what
LXASK_HOME ~/.local/share/lxask where the files above are
LXASK_MODEL $LXASK_HOME/model.gguf the model
LXASK_ADAPTER $LXASK_HOME/restrict.gguf the restriction adapter; off answers without it
LXASK_PRECISION $LXASK_HOME/precision.gguf the precision adapter; off answers without it
LXASK_EMBED_MODEL $LXASK_HOME/embed.gguf the encoder; without it, search is by keywords
LXASK_INDEX $LXASK_HOME/docs.sqlite the documentation index
LXASK_PACKAGE_MANAGERS found on the machine package managers to answer for, comma-separated (apt,dpkg or dnf,rpm)
LXASK_AS_ROOT found from the user 1: don't add sudo; 0: add it to commands that need root
LXASK_GPU_LAYERS 0 model layers on the GPU; only builds with a GPU backend (the releases are CPU only)
LXASK_TIMING unset set: print how long each start-up stage took and, for each answer, how its time split between reading the prompt, writing the reply and retrieval (the process that answers prints it: with a server, set it for lxask --serve)
LXASK_LOCAL_MAN the local_man setting, else on off: check options against the index only, not also against this machine's man pages (How it works)
LXASK_SERVE the serve setting auto: keep lxask loaded between questions; off: load it for each
LXASK_IDLE the idle setting, else 30 minutes without a question before the server stops (0: never); --idle overrides it
LXASK_SERVER the server setting host:port of another machine's lxask --serve --listen, to ask it instead of a model here
LXASK_TOKEN the token setting, else $LXASK_HOME/token the token for --listen, or for asking LXASK_SERVER
LXASK_UPDATE_CHECK the update_check setting, else on off: never look for a newer release (settings)
LXASK_VERIFY the verify setting, else on off: skip the model's second look at whether an answer does what was asked (How it works); --no-verify does it for one question

With LXASK_SERVER, the server answers as for its own machine: whether to add sudo and which package manager to use come from there (LXASK_AS_ROOT and LXASK_PACKAGE_MANAGERS in the server's environment), not from the machine asking.

--model FILE answers without the adapters, since an adapter is made for one model. The LINU_* names of lxask 0.8 and earlier still work; LXASK_* win.

#Settings

~/.local/share/lxask/settings, written by the installer:

ini
# lxask settings, written by install.sh
serve = auto      # keep lxask loaded between questions; off: load it for each question

serve = auto starts lxask in the background on the first question and stops it after 30 minutes without one (Usage). Running the installer again keeps your choice; sh install.sh --serve or --no-serve changes it.

To change the 30 minutes, add an idle line (you write this one; the installer keeps it):

ini
idle = 10         # stop after 10 minutes without a question; 0: never stop

It applies to every server started on this machine, by a question or by lxask --serve, except one started with --listen, which stops when idle only if --idle says so. --idle MINUTES on the command line overrides it, and a change takes effect from the next start (lxask --stop to restart now).

On a machine that asks another one's server (Usage), two more lines do what LXASK_SERVER and LXASK_TOKEN do:

ini
server = 192.168.1.10:7871
token = <the token from the server's ~/.local/share/lxask/token>

And these turn the second look and the release check off (both on by default):

ini
verify = off        # no second look at answers that pass the checks (a little faster)
update_check = off  # never look for a newer release

Once a day, apart from the answer, lxask asks GitHub for the newest release tag and writes it to ~/.local/share/lxask/latest; a newer one adds a line after the next answers (lxask: a newer release is out: v1.5.7 ...; 'lxask --upgrade' installs it). lxask --upgrade downloads the newest release's install.sh and runs it — the same upgrade as running install.sh by hand. The check is the only network traffic lxask makes on its own — answers stay offline — and it never delays or changes an answer. LXASK_UPDATE_CHECK=off does the same for one shell.

#Package managers

lxask looks at which package managers the machine has (apt/dpkg, dnf/yum/rpm, pacman, zypper, apk). If an answer uses another distribution's (yum on Ubuntu), that counts as a mistake and is retried. Listing and searching packages are rewritten for this machine: on Arch, apt search x becomes pacman -Ss x. A request that names a package manager ("with dnf") gets that one.

#sudo

Commands that always need root (installing packages, mount, mkfs, systemctl start, useradd, ...) get sudo, unless lxask runs as root, the request is about a container, or the request says "without sudo".

Edit this page on GitHub lxask 1.5.15 · MIT licence · made by Aaron Thomas