embedding
Command line

Docs/Command line

Command line

Decisions from the shell, typed flags instead of JSON, and a JSONL batch that pays for one model load.


pip install vegaml installs the vegaml command. State in, decide()'s JSON out, ready for jq.

bash
vegaml "I was billed twice, refund me or I cancel." \
    --choice "team=Which team handles this?=billing,technical,sales" \
    --boolean "churn=Does the customer threaten to leave?"

Typed flags build the sheet without JSON#

flagshape
--boolean"id=instructions"
--choice"id=instructions=a,b,c"
--score"id=instructions=low,mid,high"

Each flag repeats. The score's comma list is its ordered level criteria, lowest first. Note what the flags cannot express: per-option definitions for a choice. Those matter, so for anything you will run twice, use a file.

bash
vegaml "..." --questions @questions.json
vegaml "..." --questions '{"team": {"type": "choice", "instructions": "...", "criteria": {...}}}'

--questions combines with the typed flags, and a duplicate id is an error rather than a silent overwrite.

Input and output#

  • The state is the positional argument. -, or piping with no argument, reads stdin.
  • --pretty indents. The default is one compact JSON object on one line, which is what you want in a pipeline.
  • --model picks the checkpoint: nothing for the default 0.8B, 4b, a Hub id, or a path.
  • --mode, --alpha, --views, --device and --max-len pass straight through to decide().

Batches#

bash
vegaml --jsonl tickets.jsonl \
    --boolean "urgent=Does this need a reply today?" > answers.jsonl

Each input line is {"state": ..., "questions": {...}?}; a line without questions uses the flags'. The checkpoint loads once, before the first line, which is the entire point: a thousand states pay for one load. Output is one result object per line, in input order.

Note

Pair it with jq for a one-line report.

Because the output is one JSON object per line, counting what happened needs no script:

bash
vegaml --jsonl tickets.jsonl --choice "team=Which team?=billing,technical,sales" \
  | jq -r '.answers.team | select(.abstain == false) | .choice' \
  | sort | uniq -c