A decision model takes context and questions with a fixed set of choices, and returns answers with a calibrated probability. No prose, nothing to parse. Decision models are 200x faster and 400x cheaper than LLMs making comparable judgements.
I wanted to play around with decision models in more places and without writing code or manually calling APIs. I wanted scripts to read like natural language and agents to be able to pick up the tool and use it after simply reading the help output.
brew install vsekhar/tap/decide
decide --set-config --model typesafe:jev-latest --api-key
API key: <paste your API key>
decide "Is Atlanta the capital of Georgia?"
yes
# Choose from among options
decide "What kind of weather is typical in Florida?" \
--option rainy \
--option sunny \
--option snowy
sunny
# Provide context (32k context window)
decide --context @ticket.txt \
"Which team handles this ticket?" \
--option shipping \
--option billing \
--option returns
billing
# Pick a level, least to most, explain each to the model
decide --context @ticket.txt \
"How urgent is this ticket?" \
--level not_urgent="Customer feedback or feature request" \
--level somewhat_urgent="Customer problem, not blocked" \
--level urgent="Customer blocked"
somewhat_urgent
# Multiple questions in one call, name questions for easier parsing
decide --context @ticket.txt \
"Which team handles this ticket?" \
--name team \
--option shipping \
--option billing \
--option returns \
"How urgent is this ticket?" \
--level not_urgent \
--level somewhat_urgent \
--level urgent \
"Should we issue a refund?"
team=billing
somewhat_urgent
yes
# Script-friendly exit codes
if decide --context "$body" "Is this message spam?" -q; then
mv "$file" spam/
fi
Other features:- Confidence: gate on the model's confidence in its answer with --min-confidence and --fallback
- Question files: load questions from a file, useful for detailed questionnaires under version control
- Scriptable: 0 is decided or yes, 1 is no, 2 is unsure, 10 is your mistake, 11 is network/model problem
- Agent skill: agents can get cursory information about files quickly and cheaply before or instead of reading them (example skill included in the repo) - token efficient, no MCP
- Statistics and distribution: output the model's confidence and probabilities across your choices
- JSON: read context as JSON objects, write decisions as JSON objects
- Streaming: decide once per line from stdin using --each (for JSONL pipelines)
- Economical: two orders of magnitude cheaper than LLMs (Jev: $0.042/Mtok input, free output)
- Fast: typical latency of 200ms end-to-end (400 token context with 5 questions)
- Scalable: unlimited questions per call, processed in parallel
Limitations:
- Typesafe or OpenRouter API key required
- macOS 26+ pre-built via Homebrew; macOS 15 and Linux build from source (requires Swift 6.2)
- Jev only (so far the only publicly available decision model)
See also:
- DecisionModels (https://github.com/vsekhar/DecisionModels): Swift library for static and dynamic decision model calls, inspired by Apple's FoundationModels library, and powering decide.
- llm-typesafe (https://github.com/simonw/llm-typesafe): JSON-oriented input and output, integrated into the general purpose (and very popular) llm command by simonw which is written in Python and has 14 runtime dependencies.
Swift 6.2, Apache 2.0
What do you think about the command line model? How are you plugging decision models into your systems?