A client for OpenRouter's decision models. Ask one typed questions about text or images and get probabilities back, rather than prose: a Choice between named options, a Score on an ordered scale, or a Noul, the probability that something is true.
Every model on OpenRouter's decisions endpoint works, and most read images;
jev model list prints them as OpenRouter offers them now. The default is Jev, the TypeSafe model this project began with and is named
after; -m picks another. They all sit on one endpoint
(https://openrouter.ai/api/alpha/decisions), so the key you need is an OpenRouter one, and --url
points the same questions at another endpoint.
A rules file is a policy over those answers: it reads each probability as the
degree to which a condition holds, and combines them with AND, OR, NOT and hedges into a
support score per decision, or into a crisp amount through fuzzy outputs.
A support score is the policy's, not a probability: what the numbers mean.
--svg draws the whole rule base. docs/rules.md is the
full guide to rules.toml: every table, operator and formula, the output formats, the errors, and
an example worked by hand.
A command for your terminal, a Rust library that also compiles for wasm32-unknown-unknown, a
Python package, and an Agent Skill that teaches a coding agent when to ask a model instead of judging
by eye — jev add skill writes it into your project. The package is fuzzy-jev, and the library
and the command are both called jev.
export OPENROUTER_API_KEY=sk-or-...
jev 'Help! My payouts have been failing for 3 days.' \
--noul 'is_urgent=Does this message convey urgency?' \
--choice 'department=Which team should handle this?|billing:Payments, invoicing, refunds|technical:Bugs, outages, integrations|sales:Pricing, upgrades, new accounts' \
--score 'frustration=How frustrated is the customer?|Calm|Frustrated|Very angry'is_urgent 0.95 yes
department billing confidence 0.80 (billing 0.87, technical 0.13, sales 0.00)
frustration 1.02 of 2, nearest "Frustrated" confidence 0.97
403 tokens in, 73 out, $0.000017, typesafe/jev-1.14-20261014
Every question sees the same state and is answered on its own, so ask all of them in one call: an extra question costs a few tokens and no extra round trip.
- Install
- Asking
- Fuzzy rules
- Drawing the rules
- Exploring in the browser
- The Agent Skill
- As a library
- From Python
- Development
- License
More in docs/: the rules guide and the Python guide.
From PyPI. For Python, the package is fuzzy-jev, imported as jev: see
From Python. Wheels are built for Linux and macOS, x86-64 and Arm, for CPython 3.10
and later.
uv add fuzzy-jev # or: pip install fuzzy-jevThis is the library, for Python code; the jev command comes from cargo, below.
From crates.io. The package is fuzzy-jev, since jev on crates.io is another project; the
command it installs is jev. Needs a Rust toolchain.
cargo install fuzzy-jev --lockedIt lands in ~/.cargo/bin, which rustup puts on your PATH, so jev works in any folder.
cargo install fuzzy-jev --locked --force updates it; cargo uninstall fuzzy-jev takes it off
your PATH again.
Then set OPENROUTER_API_KEY from an OpenRouter key. --dry-run
prints the request instead of sending it, and needs no key.
A question on the command line is ID=INSTRUCTIONS, then |-separated criteria:
| Flag | Criteria |
|---|---|
--noul |
none, or WHAT YES MEANS|WHAT NO MEANS |
--choice |
two or more options, each NAME or NAME:DESCRIPTION |
--score |
two to ten levels, lowest first |
Each flag can be repeated, and the answers print in the order the questions were written. Text
with a | in it, or structured criteria, goes in a JSON or TOML file of ids to questions passed
with --questions (-q); file questions come first, then the flags'.
| Option | |
|---|---|
STATE |
The state, as text. Without it, it's read from --state-file (-f, - for standard input), or from standard input when that isn't a terminal. |
--state-json |
Parse the state as JSON: cat ticket.json | jev --state-json -q questions.json |
--image (-i) |
A PNG or JPEG to judge, after any text; repeatable. See Images. |
--model (-m) |
Another model; the default is ~typesafe/jev-latest. See Models. |
--url |
Another endpoint. With one, OPENROUTER_API_KEY may be unset, for an endpoint that adds the key. |
--ollama |
Ask a model Ollama runs on this machine: --url http://localhost:11434/v1/systemone, no key. |
--text |
One line per question. The default. |
--table |
A table: question, type, answer, confidence, and every option's probability. |
--json |
The reply as this crate reads it (the fields it knows, re-encoded), for jq and scripts. |
--rules (-r) |
Fuzzy rules over the answers, from a TOML file; prints their outcome instead of the answers. |
--graph |
With -r: draw the rules in the terminal. |
--svg PATH |
With -r: draw the rules as an SVG image. Without a state, either one draws the structure alone, with no call. |
--timeout SECONDS |
Give up on the request after this long; 60 by default. It is not sent again. |
--dry-run |
Print the request, as it would be sent, instead of sending it. No key needed. |
Every model on the decisions endpoint works, and -m picks one. Which models there are is
OpenRouter's to say, and jev model list asks it each time, so a model it adds is there without a
new version of jev:
jev model list # a table: context window, price, what it reads, and its limits
jev model list --json # the same, for a script┌──────────────────────┬───────────┬────────┬───────────────────────────┬─────────────────────────┐
│ model │ context │ $/1M │ input │ limits │
├──────────────────────┼───────────┼────────┼───────────────────────────┼─────────────────────────┤
│ ~typesafe/jev-latest │ 262,144 │ $0.042 │ text, image │ │
│ cloudflare/clef-omni │ 65,536 │ $0.150 │ text, image, audio, video │ │
│ nace-ai/drex-max │ 262,144 │ $0.060 │ text, image │ 16 questions a call │
│ respan/span-01-lite │ ~3,000 │ free │ text │ yes/no only, plain text │
│ scaledown/classify-1 │ 1,000,000 │ $0.040 │ text, file │ plain text │
└──────────────────────┴───────────┴────────┴───────────────────────────┴─────────────────────────┘
Context is in tokens, and the price is per million input tokens. --image sends images; audio,
video and files go in a --state-json state, in the shape the model reads. It needs a connection
but no key, and Client::list_models gives the same list to Rust and Client.list_models to Python.
jev 'It is raining.' --noul 'raining=Is it raining?' -m respan/span-01-litePin a version for answers that don't change under you: the ~ id follows TypeSafe's latest Jev
(today typesafe/jev-1.14), and the reply's model names the one that answered, with its date,
such as typesafe/jev-1.14-20261014. Liquid's and Perplexity's ~ ids work the same way.
OpenRouter's listing doesn't say everything a model can't do, and isn't always right about what it
reads, so some models were called to find out. What that found is kept in jev as limits for those
models alone, and a request past them is refused before any call is made:
- The Span 01 models answer yes/no questions only, with plain-text instructions and criteria. A
Score, a Choice, or structured instructions asked of one is refused before any call is made:
question `anger`: respan/span-01 answers yes/no questions only, and this is a score. Span 02 answers every type. - The Span 01 models read about 3,000 tokens of a state, and don't say so when there is more: they take a state of any length, read its start and end, and skip the middle. A fact in the middle of a long one scores as if it weren't there. OpenRouter lists no context window for them, so that figure is measured. Keep what matters short, or use another model.
- Three models take fewer questions a call than the endpoint does:
nace-ai/drex-max16,parallel/decisions-fast:free100 andmorph/reflex128. A request with more is refused before it's sent; split the questions over two calls. - A text-only model is refused images before any call.
scaledown/classify-1is one, though OpenRouter lists it as reading them. scaledown/classify-1takes questions in plain text, with a description on every Choice option:--choice 'c=Which?|a:the first|b:the second', not--choice 'c=Which?|a|b', which is refused before the call:question `c`: scaledown/classify-1 needs a description for every option, and `a` has none. Structured instructions or criteria are refused too.jev model listmarks itplain text.- Any other model is taken at its word: sent as it is, and not checked.
--state-json sends the state as JSON rather than as text, so nested fields, numbers and lists
reach the model as what they are. A support ticket, ticket.json:
{
"subject": "Charged twice for the October invoice",
"plan": "enterprise",
"opened_days_ago": 6,
"prior_escalations": 2,
"messages": [
{"from": "customer", "text": "We were billed EUR 4,800 twice on 3 October. Please refund one."},
{"from": "support", "text": "Thanks, looking into it."},
{"from": "customer", "text": "Six days now and no answer. Our finance team is escalating."}
]
}The three question types, in one questions.json. A noul's criteria are keyed true and false,
which is what the endpoint calls them — the --noul flag spells the same thing
id=INSTRUCTIONS|WHAT YES MEANS|WHAT NO MEANS:
{
"team": {
"type": "choice",
"instructions": "Which team should own this ticket?",
"criteria": {
"billing": "charges, invoices, refunds",
"support": "the product itself, bugs, outages",
"success": "the relationship, renewals, escalations"
}
},
"urgency": {
"type": "score",
"instructions": "How urgently does this need a human today?",
"criteria": ["Can wait a week", "This week", "Today", "Now"]
},
"churn_risk": {
"type": "noul",
"instructions": "Is this account at risk of leaving?",
"criteria": {"true": "Threats, repeated escalation, money at stake", "false": "Routine, patient, one-off"}
}
}cat ticket.json | jev --state-json -q questions.jsonThe same questions in TOML, as questions.toml, ask the same thing: a [[question]] table per
question, in the order asked, with its id as name and its instructions as instruction. TOML has
no null, so a choice's options without descriptions are a list of names,
criteria = ["billing", "support"]; JSON takes that list too. A name ending in .json or .toml
says which a file is; otherwise (standard input, say) one that starts with { is JSON.
[[question]]
name = "team"
type = "choice"
instruction = "Which team should own this ticket?"
criteria = { billing = "charges, invoices, refunds", support = "the product itself, bugs, outages", success = "the relationship, renewals, escalations" }
[[question]]
name = "urgency"
type = "score"
instruction = "How urgently does this need a human today?"
criteria = ["Can wait a week", "This week", "Today", "Now"]
[[question]]
name = "churn_risk"
type = "noul"
instruction = "Is this account at risk of leaving?"
criteria = { true = "Threats, repeated escalation, money at stake", false = "Routine, patient, one-off" }team billing confidence 0.97 (billing 0.98, success 0.02, support 0.00)
urgency 2.58 of 3, nearest "Now" confidence 0.59
churn_risk 0.86 yes
571 tokens in, 72 out, $0.000024, typesafe/jev-1.14-20261014
The numbers move a little from call to call, so a threshold is worth setting with a margin rather than at the value one run happened to give.
With --json, each answer is named after its type — .noul, .choice (with .confidence and
.probabilities), .score — which is what a script gates on:
cat ticket.json | jev --state-json -q questions.json --json > answers.json
jq -r 'if .answers.churn_risk.noul > 0.8 then "page the account team" else "queue normally" end' answers.json--image (-i) puts a PNG or JPEG in the state, after any text:
jev 'Returned by a customer.' -i parcel.jpg --noul 'damaged=Is the parcel damaged?'
jev -i shelf.jpg --score 'stock=How full is the shelf?|Empty|Half full|Full' -m '~liquid/d1-latest'Give each image its own -i. They go to the model in the order written, and every question sees
all of them, so a question should say what to look for across them:
jev 'One parcel, from three sides.' -i front.jpg -i side.jpg -i back.jpg \
--noul 'damaged=Is the parcel damaged in any of these photos?'For a folder of images, build the flags in a loop:
args=(); for photo in photos/*.jpg; do args+=(-i "$photo"); done
jev 'One parcel, from every side.' "${args[@]}" --noul 'damaged=Is the parcel damaged in any of these photos?'-i photos/*.jpg doesn't work: -i takes one path, so the shell's second file becomes the text of
the state, and only one image is sent. A third is an error.
To get an answer for each image rather than one for them all, make one call per image:
ls photos/*.jpg | xargs -P 8 -I{} sh -c '
jev -i "$1" --noul "damaged=Is the parcel damaged?" --json |
jq -r --arg photo "$1" "[\$photo, .answers.damaged.noul] | @tsv"
' _ {}How many fit in one request depends on the model. jev doesn't count them: over the limit, the
endpoint refuses the whole request, and there are no partial answers.
| Images in a request | Models |
|---|---|
| 4 | respan/span-02, nace-ai/drex-max, the three cloudflare/clef models |
| 8 | Liquid's and Perplexity's |
| 16 | Baseten's, inception/mercury-decide, morph/reflex |
| 64 or more | Jev, openai/gpt-6-luna-decisions |
These come from calling each model with small images, and the models don't all state them:
cloudflare/clef and cloudflare/clef-flash failed at 5 without saying why, Mercury took 16 and
refused 32, Morph says 16 itself when it refuses 17, and 64 is the most that was tried. Large photos hit other limits first. Jev takes 16 MiB
per image and 32 MiB per request, base64 included, so about 24 MiB of files, and every image also
uses up the model's context.
- Most models read images, and
jev model listsays which: those withimageamong their inputs. One found to read text only is refused before any call is made:nace-ai/drex-v2.0 reads text only, and this state has images in it. Any other id is sent as it is. - With an image, the text comes only from
STATEor--state-file. Standard input isn't read unless-f -asks for it.--state-jsondoesn't combine with--image. - Sizes differ by model, so they are left to the endpoint: Jev refuses a side under 280 pixels or over 1568, and the others took a 64-pixel image. The format is checked before the call.
- Ask what is in an image, not where it comes in the list. Given two,
typesafe/jev-1.13and Decider Flash mixed up which one was second.
In Rust, a state with images is an array of jev::text_part and jev::image_part items, with an
image_part for each image:
let state = serde_json::json!([jev::text_part("One parcel, from two sides."), jev::image_part(&front)?, jev::image_part(&back)?]);These are OpenRouter's own image_url parts, not the assets map TypeSafe documents. Only Jev reads
assets everywhere: most other models refuse a reference inside text or an object, and Liquid's
take a reference that is the whole state as text and answer without having seen the image.
Ollama runs decision models on your own machine, such as Liquid's
d1 and the smaller d1-omni, which both read images. It
serves them on its own System One endpoint, which needs no key, and --ollama points there:
ollama pull d1
jev --ollama -m d1 'Help! My payouts have been failing for 3 days.' --noul 'is_urgent=Does this message convey urgency?'
jev --ollama -m d1 'Returned by a customer.' -i parcel.jpg --noul 'damaged=Is the parcel damaged?'Everything else works as it does on OpenRouter: every question type, -q, -r, the output
formats and --explore. For Ollama on another machine, or Ollama's cloud, give the URL instead:
--url http://gpu-box:11434/v1/systemone, or --url https://ollama.com/v1/systemone with the key
in OPENROUTER_API_KEY.
Ollama reads images differently: it takes the state as text and the images beside it, in a
top-level images array of bare base64. Any endpoint whose path is /v1/systemone is sent that
shape, so the same -i and image_part work on both; --dry-run prints what is sent. (Liquid's
own /decisions/v1/systemone is not Ollama's, and gets OpenRouter's.) In Rust it is
Client::new("").with_url(jev::OLLAMA_URL), and Client::with_ollama says which shape to send
whatever the URL; in Python, jev.Client(url=jev.OLLAMA_URL).
Ollama checks a request's text against 64 KiB and its whole body against 32 MiB, and the input must fit the loaded context window: an error from it says which.
The complete reference is
docs/rules.md. This section is the short tour.
A decision is often several answers combined: "a raincoat when it rains, unless it's hot". A rules file says that directly. It names the answers it needs as terms, combines them with fuzzy logic, and gives each outcome a support score. The rules are your policy; the model supplies the evidence. Reading a probability as a degree is a modelling choice, so a score says how strongly the policy supports an outcome, not how likely it is.
The questions, examples/rules/weather.json:
{
"temp": {"type": "score",
"instructions": "How warm is it outside? Cold is under 10 °C, Mild 10 to 22 °C, Hot over 22 °C; …",
"criteria": ["Cold", "Mild", "Hot"]},
"humidity": {"type": "score",
"instructions": "How humid is the air? Dry is under 40% relative humidity, Normal 40 to 70%, Humid over 70%; …",
"criteria": ["Dry", "Normal", "Humid"]},
"raining": {"type": "noul",
"instructions": "Is it raining, or about to?",
"criteria": {"true": "Rain is falling, or the state says it is about to start", "false": "No rain, and none expected soon"}}
}The rules, examples/rules/wear.toml:
[logic] # optional
and = "min" # min | product | lukasiewicz
or = "max" # max | probsum | bounded
[decide] # optional
threshold = 0.5
[terms]
cold = "temp.Cold" # a Score level, by its exact text
mild = "temp.Mild"
hot = "temp.Hot"
humid = "humidity.Humid"
raining = "raining" # a Noul, by its id
# stormy = "sky.storm" (a Choice option, from a "sky" choice: clear, cloudy, storm)
[[rule]]
if = "cold"
then = "coat"
[[rule]]
if = "mild AND NOT raining"
then = "light jacket"
[[rule]]
if = "raining AND NOT hot"
then = "raincoat"
[[rule]]
if = "raining"
then = "umbrella"
[[rule]]
if = "hot AND humid"
then = "t-shirt"
[[rule]]
if = "humid OR hot"
then = "breathable fabric"
weight = 1.0 # optional, 0 to 1; the rule's score is multiplied by itjev '16°C, the air feels sticky, and a light drizzle has started.' \
-q examples/rules/weather.json -r examples/rules/wear.tomlcoat 0.01
light jacket 0.03
raincoat 0.97 yes
umbrella 0.97 yes
t-shirt 0.01
breathable fabric 1.00 yes
threshold 0.50
475 tokens in, 47 out, $0.000020, typesafe/jev-1.14-20261014
- Terms are lowercase names, and every word in a rule is a term or an operator. A term points
at a Noul by its id, at a Score level by the question id, a
., and the level's exact text, or at a Choice option by its name. - Operators are uppercase:
AND,OR,NOT, parentheses, and the hedgesVERY(x²),SOMEWHAT(√x),EXTREMELY(x³) andINDEED(pushed toward 0 or 1). Hedges andNOTbind tightest, thenAND, thenOR. A hedge reshapes a score and moves where the threshold falls; it doesn't make "angry" mean "very angry". [logic]picks the AND and the OR for the whole file.minandmax, the defaults, let the weakest condition and the strongest reason decide.productandprobsummake every doubt lower the score and every reason raise it, andprobsumcounts a reason written twice twice. None of them is the probability of a compound event; levels of one question exclude each other, so their probabilities add (bounded).- Rules with the same
thenare joined by the file's OR, and an item is a yes at or over the threshold. - Checked before the call. Every term is resolved against the questions first, so a typo costs
nothing, and
--dry-runcatches it too. The error names what does exist:[terms] hot: `temp` has no level `hot`; its levels are `temp.Cold`, `temp.Mild`, `temp.Hot`. An answer or a probability missing from the reply is an error, never a silent zero, and so is a number that isn't a probability or a distribution that can't be one rounded to two places. --tableadds the rules behind each score, and--jsonprints{"reply": …, "outcome": …}, so a script keeps every answer.
When the answer is an amount ("how long to water?") rather than a yes, a rule can conclude in an output: a crisp axis with named fuzzy sets. A set's rules are joined into its score, each set is clipped at its score, the clipped shapes are merged with the file's OR, and the value is the centre of the merged shape, worked out analytically rather than sampled. This is Mamdani inference with centroid defuzzification.
examples/rules/irrigation.toml, with
examples/rules/rain.json asking how much it rained:
[terms]
scarce = "rainfall.Scarce"
regular = "rainfall.Regular"
large = "rainfall.Large"
[output.irrigation] # minutes of watering this week
range = [0, 100]
short = [0, 0, 20, 40] # a trapezoid: rises a→b, flat b→c, falls c→d
medium = [30, 50, 70] # a triangle: a, peak, c
long = [60, 80, 100, 100] # a shoulder, held up to the end of the range
[[rule]]
if = "scarce"
then = "irrigation IS long"
[[rule]]
if = "regular"
then = "irrigation IS medium"
[[rule]]
if = "large"
then = "irrigation IS short"jev 'A fairly normal week: two moderate showers, and the soil is damp but drying at the surface.' \
-q examples/rules/rain.json -r examples/rules/irrigation.tomlirrigation 49.49 (short 0.02, medium 0.97, long 0.01)
then = "OUTPUT IS SET" always concludes in an output, and a misspelt one is an error that
suggests the closest name; any other then is an item, and one file can have both. The value says
where the support lies, not how much of it there is, so read it with its sets' scores, printed
beside it. When no rule for an output scores above zero, its value is - (null in JSON) rather
than a made-up number. The file has no units: say them in a comment, as above.
For everything together (a Choice, hedges, parentheses, a weight, probsum, a threshold, and items
alongside an output), see the support-triage example,
examples/rules/triage.toml, which
docs/rules.md works through by hand.
--svg PATH draws the rules as an image, and --graph draws them in the terminal. Without a
state (no argument, no -f, nothing on standard input) or with --dry-run, either one draws the
structure alone and makes no call, which is a free way to check a rules file. With a state, every
part carries its number.
jev '16°C, the air feels sticky, and a light drizzle has started.' \
-q examples/rules/weather.json -r examples/rules/wear.toml --svg wear.svgThat is the drawing at the top of this page. The image is laid out the way a fuzzy rule base is usually drawn, with one row per rule:
- Premises: a column per question, with a bar per level, option, or no and yes, filled to its
probability; the one a rule reads is in bold. Under a Score, the red arrow is its expected level,
drawn apart because the rules don't read it. A probability the reply leaves out is marked
missing. - Rules: the
ifas a tree of its operators, each with what it came to. - Conclusions: an output's sets, with the rule's own set clipped at its score, or an item's bar against the threshold.
- Final: each output's merged shape with an arrow at its centroid, and every item's score.
With an output, the conclusions are its sets clipped at each rule's score, and the final column is their merged shape with an arrow at its centroid. The irrigation rules:
jev 'A fairly normal week: two moderate showers, and the soil is damp but drying at the surface.' \
-q examples/rules/rain.json -r examples/rules/irrigation.toml --svg irrigation.svgIn the terminal, --graph prints each rule as a tree, and each term with every level's
probability (the term's own in brackets):
R3 raining AND NOT hot ⇒ raincoat
AND (min) 0.97
├─ raining 0.97 ← raining: no 0.03 · [yes 0.97]
└─ NOT (1 − x) 0.99
└─ hot 0.01 ← temp: Cold 0.01 · Mild 0.98 · [Hot 0.01]
⇒ raincoat 0.97 ███████████████████▍
An output is drawn as a plot of its merged shape, with ↑ at its centre:
irrigation = 49.49
1.0 ┤░░░░░░░░░░░░░ ▃▇▇▃ ░░░░░░░░░░░░░
│░░░░░░░░░░░░░░░░ ▁▄██████▄▁ ░░░░░░░░░░░░░░░░
│░░░░░░░░░░░░░░░░░░░ ▃▅██████████▅▄ ░░░░░░░░░░░░░░░░░░░
│░░░░░░░░░░░░░░░░░░░░░▃▇██████████████▇▃░░░░░░░░░░░░░░░░░░░░░
│▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▄████████████████████▄▁░░░░░░░░░░░░░░░░░░
0.0 └─────────────────────────────┬──────────────────────────────
0 ↑ 49.49 100
short medium long
jev --explore opens a page in the browser for writing a state, questions and rules, and seeing
what they come to. It is the command, in a page: the same questions, the same rules engine, and the
same drawing. It takes no images yet, so --explore doesn't combine with --image.
jev --explore
jev --explore -q examples/rules/weather.json -r examples/rules/wear.toml # start from these files
jev --explore 'Help! My payouts have been failing for 3 days.' -q examples/rules/triage.json -r examples/rules/triage.tomlOn the left, a card each for the state (text, or JSON), the questions and the rules:
- Questions as a form (a card per question: its id, yes/no, choice or score, the instructions,
and its options or levels) or as JSON, the same as a
-qfile. The two stay in step, and the JSON is pretty-printed. - Rules in TOML, the same as an
-rfile. The ⓘ on the card opens a guide to writing them: terms,if/then/weight,AND/OR/NOTand the hedges, the[logic]functions, the threshold, and outputs. - JSON and TOML are highlighted as they are typed, and a mistake shows under the field it is in, before anything is asked.
- Each card folds to a line that says what is in it. Load an example fills all three from
examples/rules, and Reset clears them, with an undo.
On the right, what they come to:
- The rules diagram, the
--svgdrawing, redrawn as the questions or the rules change, at no cost. It zooms, fits, pans, and can take the whole width. - Run (⌘/Ctrl ↵) asks the model. Then the decision, a card per item with its score against the threshold and each output's value, sits above the diagram: hovering a card lights up the rules behind it, and hovering a rule its card. The model's answers follow as probability bars, with the model, tokens and cost.
- The text and JSON the command prints: the outcome, the
--graphtree, the answers, what--jsonprints and the request--dry-runshows, each with a button to save it, as is the SVG.
The page is served on 127.0.0.1 only, on any free port (--port picks one), and --no-open
prints the address without opening a browser. The key stays in the jev process, read from
OPENROUTER_API_KEY as always. The address carries a random token for this run after its #, and
nothing that reads your inputs or spends the key answers without it, so neither another site open in
the same browser nor another user of the machine can use it.
Without a key, the page still checks and draws the rules. It loads Fira Code from Google Fonts,
and falls back to the system's monospace font offline.
A coding agent asked to "sort these tickets" or "which of these need a human?" will usually read
them itself and write a paragraph of opinion. The skill teaches it to reach for jev instead: one
call, a probability per item, and a number it can threshold on.
cd your-project
jev add skillcreated .agents/skills/jev/SKILL.md
created .agents/skills/jev/references/patterns.md
The jev skill is in .agents/skills/jev. Agents that read .agents will find it.
jev add skill |
writes it to .agents/skills/jev, the convention most agents read |
jev add skill --claude |
writes it to .claude/skills/jev instead |
jev add skill --tool |
writes the skill for an agent whose jev is a tool it calls with JSON, rather than this command |
jev add skill --force |
replaces files that are there and differ |
The two files are compiled into the binary, so an installed jev carries its own skill and needs
no source tree to hand it over. Nothing is overwritten without --force: a file that is already
what would be written is left alone, so running it twice says unchanged rather than churning
your diff.
What it teaches is when the tool fits — classifying, routing, triaging, rating, flagging, and
anything where a confidence number beats an opinion — how to write the three question types, the
patterns for putting many items through one call, and how to design fuzzy rules over the answers. Read
skills/jev/SKILL.md and
skills/jev/references/patterns.md before installing it, as
you would any instruction you're adding to a project.
[dependencies]
jev = { package = "fuzzy-jev", version = "0.8", default-features = false }let client = jev::Client::new(&std::env::var("OPENROUTER_API_KEY")?);
let reply = client
.decide("I was charged twice this month", [("urgent", jev::Question::noul("Is this urgent?"))])
.await?;default-features = false leaves out the CLI's dependencies; the library then builds for
wasm32-unknown-unknown too, where requests go through the host's fetch. The command feature
adds question specs (jev::spec), the command's own printing (jev::print) and the rules engine
(jev::rules) without the command, for another program that wants to offer jev the way the
terminal does:
let rules = jev::rules::Rules::parse(&std::fs::read_to_string("wear.toml")?, questions.iter().map(|(id, q)| (id.as_str(), q)))?;
let outcome = rules.evaluate(&reply)?; // items and outputs, with their scores
let svg = rules.graph_svg(Some(&reply))?; // or graph_text, for a terminalpip install fuzzy-jevimport jev
client = jev.Client() # the key from OPENROUTER_API_KEY
questions = jev.load_questions(open("examples/rules/triage.json").read())
rules = jev.Rules(open("examples/rules/triage.toml").read(), questions) # checked now, before a call
reply = client.decide("I can't log in and payroll is due today", questions)
reply.choice("team").choice, reply.noul("blocked")
outcome = rules.evaluate(reply)
outcome.yes # the items at or over the threshold
open("triage.svg", "w").write(rules.graph_svg(reply))The package is the Rust library underneath, so questions, replies and rules files mean the same in
both. decide_async is the awaitable form, and decide releases the GIL while it waits.
docs/python.md is the whole guide: questions, the reply, rules, drawings,
errors, threads and asyncio, and releasing.
cargo test # offline
cargo test --tests -- --ignored # a few real calls; passes without calling when the key isn't set
cargo run --example triage -- "Could you tell me what the enterprise plan costs?"CI runs cargo fmt --check, clippy for the host and for wasm32-unknown-unknown, and the tests.
Pushing a tag such as v0.2.0 builds the four binaries and puts them on a Release; the same build
can be started by hand from the Actions tab, which leaves them as artifacts.
The same tag publishes the Python package to PyPI; building and releasing it.
Extracted from wasm-agent, where this began as a client
for Jev alone, in crates/jev, and where dx's shell offers the same command to an agent. This repository was called
jev-cli until the fuzzy rules arrived; GitHub redirects the old URLs.
MIT — see LICENSE. The bundled Agent Skill says the same in its own frontmatter, so a
project that runs jev add skill carries it with the files.