-
Notifications
You must be signed in to change notification settings - Fork 129
batch decisions with jev decide
jev decide answers one request file and exits, with no server: ./jev decide request.json
prints the answer, and --output answer.json writes it to a new file that is never
overwritten. The file holds the same body you would POST to /v1/systemone and gets the same
answer shape back, printed as indented JSON. A request the server would refuse prints the
server's error body on stderr and exits with status 1. For a batch you loop over files in the
shell.
The catch is cost per file. Every jev decide run loads the model before answering, so a loop
over ten thousand small files pays the load ten thousand times. For large batches, one file with
many questions, or one jev serve and a client loop, is the better shape. We have not published
a load-time measurement, so measure it on your machine before you choose.
This page is the request file and its errors, what --output does and does not do, shell loops
for bash and PowerShell, and when to switch to the server. Commands and file shapes are minimal
sketches to adapt; every flag shown is one of jev decide's options.
./jev decide request.jsonWith request.json holding the README's Quickstart body ("model": "jev-latest", the
double-charge text and the billing question), the output is the same JSON the server returns,
which in the README reads 0.94 for billing, with output_tokens 0. A model name that is
neither a jev-* alias nor the served model's name is rejected, exactly as the server does it.
The options you are most likely to touch are the same as the server's: --threads (all logical
CPUs by default, fewer if other heavy programs run), --model-dir (the model folder beside the
binary by default), and --ctx, the context limit per question in tokens, the state plus that
question (default 8,192; longer prompts are rejected, not truncated).
A request the server would refuse, such as a malformed file, an unknown field or a text over
the context limit, is refused by jev decide too: it prints the server's error body, as JSON, on
stderr and exits with status 1, so a loop can tell answers from failures by the exit status.
Keep the request file and the answer file together when you need to reproduce or audit a decision. What else belongs in such a record is on logging LLM decisions for audit.
--output answer.json creates the file, and its parent folders if needed, and refuses to write
if the file already exists: the command prints jev: ... with the error and exits with status 1.
The code's own comment gives the reason: results are create-only, so evidence is never silently
replaced.
Two consequences for batches:
- Reruns are safe. Point a second run at the same output folder and nothing already written is lost.
- Check first. The existence check happens when the answer is written, after the model has done the work. Skip existing outputs in your loop, as below, instead of letting each one fail at the end.
mkdir -p answers
for f in requests/*.json; do
out="answers/$(basename "$f")"
[ -e "$out" ] && continue
./jev decide --threads 8 "$f" --output "$out" \
|| echo "failed: $f" >&2
doneNew-Item -ItemType Directory -Force answers | Out-Null
foreach ($f in Get-ChildItem requests\*.json) {
$out = "answers\$($f.Name)"
if (Test-Path $out) { continue }
.\jev.exe decide --threads 8 $f.FullName --output $out
if ($LASTEXITCODE -ne 0) { Write-Warning "failed: $($f.Name)" }
}Run one loop at a time. Two loops on one CPU compete for the same cores, and each process loads
its own copy of the model; give the one process more --threads instead. The same caution applies when
you time a batch, see measuring LLM latency: median, p90 and warm-up.
Because each run pays the model load, the shape of the batch matters more than the loop:
- Many questions about one text belong in one file. Questions in a request share the state, which is read once; on the reference laptop three questions take about 66 ms together against 49 ms for one alone. A request takes up to 1,024 questions.
-
Many texts are better served by one
jev serveprocess and a client that posts them one after another: the model loads once and each request costs only inference, 26 to 112 ms for 30 to 191 tokens on an Intel Core Ultra 7 255H. The client side is on a Python client for local LLM decisions. -
A handful of files in CI, where starting and stopping a server is one moving part too many,
is where
jev decideis at its best; see running LLM yes/no checks in GitHub Actions.
jev decide changes how you call the model, not what it knows. It reads English only, answers
yes/no and choice questions well and score questions less well (they are early), and is weakest on
questions that need arithmetic or dates. A batch makes errors at scale just as easily as it makes answers, so score a
labelled sample before you trust a whole run; how to build one is on
building a yes/no test set for your own data.
Can I run jevos without a server? Yes. jev decide answers one request file and exits.
Does --output overwrite an existing file? No. It refuses, prints an error and exits with status 1.
What happens with a request the server would refuse? jev decide prints the server's error
body, as JSON, on stderr and exits with status 1.
Is jev decide faster than the server for many files? No. Each run loads the model; for many texts, run the server once and post to it.
How many questions can one file hold? Up to 1,024, all sharing one state.
See also: LLM regression tests in CI with yes/no checks, ask a local LLM a yes/no question and get P(yes) and curl examples for a local LLM decision API.
- Every flag, the create-only output and the exit status:
jev decidein jev. - The Quickstart example and latencies: the jev README (Intel Core Ultra 7 255H, 16 threads, through the HTTP API).
From the notes of jev, a yes/no decision model that runs on a laptop CPU. The output file is create-only because an answer file is evidence.
- Ask a local LLM a yes/no question and get P(yes)
- Zero-shot text classification with yes/no questions
- LLM policy decisions: put the rule in the question
- LLM as a judge on a CPU
- Why a small LLM says yes when the answer is no
- Small LLMs and arithmetic in yes/no questions
- Our held-out benchmark said 0.855, new questions said 0.757
- jevos vs Jev vs Laya for yes/no decisions
- An open-source alternative to Jev for yes/no decisions
- jevos vs the OpenAI API for yes/no classification
- jevos vs Ollama for yes/no decisions
- jevos vs bart-large-mnli for zero-shot classification
- A yes/no LLM vs a fine-tuned BERT classifier
- jevos vs SetFit: zero-shot vs few-shot classification
- jevos vs Llama Guard for content safety checks
- jev serve vs llama.cpp server for classification
- jevos vs LM Studio: a decision server, not a chat app
- Local vs hosted LLM decisions: latency, cost, privacy
- A yes/no LLM vs a business rules engine
- LLM decisions vs keyword rules and regex
- The fastest AI model for yes/no decisions
- What makes a local LLM fast on a CPU
- Why one forward pass beats generating an answer
- Prefill vs decode: where LLM latency comes from
- Why LLM latency grows with the length of the text
- Why a hosted LLM API cannot answer in 50 ms
- Many questions about one text: why the extra ones are cheap
- CPU or GPU for a small LLM
- Latency budgets: where a 200 ms model fits
- Measuring LLM latency: median, p90 and warm-up
- Q4_K_M vs Q8_0: speed and size for a small model
- Throughput vs latency for a decision server
- What P(yes) means, and what it does not
- LLM calibration explained with yes/no answers
- Expected calibration error (ECE), explained
- Temperature scaling for LLM probabilities
- Platt scaling for a yes/no model
- Reading a reliability diagram
- How to choose a threshold for P(yes)
- Thresholds when a wrong yes costs more than a wrong no
- Human in the loop AI with a review band
- Precision and recall at a P(yes) threshold
- Base rates: why a 0.9 yes can still be wrong often
- Combining yes/no answers with AND, OR and NOT
- Logits, log-odds and P(yes)
- LLM confidence scores: probabilities vs self-reports
- How to write yes/no questions an LLM answers well
- Negation in yes/no questions for an LLM
- One condition per question: splitting compound questions
- Ask whether the text says it at all
- Scores as yes/no thresholds: is it at least high?
- Sending JSON as the text: designing the state
- Why wording changes an LLM's answer, and how to test it
- Mainly about: questions for messages with several topics
- Yes/no questions about tone and emotion
- Asking about intent: what does the writer want?
- Yes/no questions about long documents
- Using an English-only LLM with other languages
- Content moderation with a local LLM
- A Discord moderation bot with a local LLM
- Spam detection with yes/no questions
- Review moderation with a local LLM
- Email triage with a local LLM
- Support ticket routing with yes/no questions
- Urgency detection in customer messages
- Sentiment analysis with yes/no questions
- Intent detection with a local LLM
- Lead qualification with yes/no questions
- Fraud case triage with a local LLM
- Phishing email screening with a local LLM
- Log and alert triage with a local LLM
- Checking text for personal data with yes/no questions
- Prompt injection screening with a small model
- Document classification with a local LLM
- Product categorization with yes/no questions
- Contract clause detection with a local LLM
- Refund request triage with a local LLM
- Detecting cancellation intent in customer messages
- RAG evaluation with yes/no questions
- RAG faithfulness check with a local LLM
- Hallucination detection with a local LLM
- LLM regression tests in CI with yes/no checks
- Rubric design for an LLM judge
- Pairwise comparison with a yes/no judge
- LLM judge bias and how to control it
- Evaluation metrics for yes/no classifiers
- Building a yes/no test set for your own data
- Accuracy by kind of question: why one number hides failures
- Generating test questions with answers computed by code
- Benchmark contamination and truly held-out tests
- An LLM router with yes/no questions
- A model cascade: small model first, large model on doubt
- Semantic routing vs yes/no questions
- Gating AI agent tool calls with yes/no checks
- AI agent guardrails with yes/no questions
- Stop conditions for AI agents
- Logging LLM decisions for audit
- Reducing LLM cost with local yes/no decisions
- Replacing chat LLM calls with yes/no questions
- Structured output vs a probability
- A Python client for local LLM decisions
- Calling a local LLM decision server from JavaScript
- Local LLM yes/no decisions in n8n
- A Slack bot that uses local LLM decisions
- Home Assistant automations with local LLM decisions
- A LangChain tool for local yes/no decisions
- Batch decisions from files with jev decide
- Running LLM yes/no checks in GitHub Actions
- Securing a local LLM server with an API key
- curl examples for a local LLM decision API
- Self-hosted AI for decisions
- A private LLM for text classification
- On-premise LLM for business decisions
- GDPR and automated decision-making with an LLM
- Offline AI for decisions: no network needed
- Edge AI decisions on a CPU
- Run an LLM locally without a GPU
- Small language models explained
- When a small model is enough, and when it is not
- An LLM on a laptop: what it can do in real time
- What is GGUF, for someone deploying a classifier
- GGUF quantization types explained: Q4_K_M, Q8_0 and others
- GGUF vs safetensors
- llama.cpp vs Ollama for a classification service
- llama-cpp-python vs calling llama.cpp through ctypes
- llama.cpp on Windows without compiling
- Running llama.cpp CPU only
- Using llama.cpp prebuilt binaries instead of building