decide - Typed decisions on text with a small local model
================================================================================

A decision model reads a text and answers closed questions (one choice
among several, or yes/no) with probabilities. It does one forward pass
and generates no tokens, so it is fast on a CPU and its answer is
always one of the allowed choices.

decide drives laya (package ggmlc) with the Kev models (Apache 2.0,
fine-tuned Qwen3.5) and ships ready-made questions for SliTaz.

  decide pull                       Download kev-0.8b (828 MB)
  decide cooklog mesa               Probable cause of a failed cook
  decide shell 'hg push'            Risky shell command? (exit 1 if so)
  dmesg | decide yesno 'Is there a disk error?'
  decide ask 'Tone?' calm angry < mail.txt

Choice names are single words; give a description with name=text:

  decide ask 'Which area?' 'net=network or wifi' 'snd=sound' < bug.txt

Requirements: x86_64 with AVX2 (laya is built for the haswell level).


Measured on an i7-13700H, kev-0.8b, 6 threads
--------------------------------------------------------------------------------

  cooklog  29/32 real cook logs from the x86_64 and i486 woks, 6 causes
           (missing dependency, compile, link, download, autotools,
           packaging), about 3 s per log including model load.
  shell    22/24 labelled commands. Kev ranks well but its probabilities
           are squeezed toward 0.2-0.4, hence SHELL_THRESHOLD=0.3.
           Misses: cat ~/.ssh/id_rsa, echo ... >> ~/.profile. Use it as
           a second opinion, never as the only guard.

More threads is slower on hybrid CPUs (E-cores): the default is half
the CPUs, at most 6.


Files and environment
--------------------------------------------------------------------------------

  DECIDE_DIR       models, default ~/.local/share/decide
  DECIDE_MODEL     default kev-0.8b (see: decide models)
  DECIDE_SHARE     question files, default /usr/share/decide
  SHELL_THRESHOLD  default 0.3
  LAYA             laya binary, default laya

The question files in share/ are plain laya/Jev JSON: add a field to a
file, or write a new one, to ask something else.
